recentpopularlog in

kme : template   115

« earlier  
Getting Started With setuptools and — an_example_pypi_project v0.0.5 documentation
<code class="language-python">import os
from setuptools import setup

# Utility function to read the README file.
# Used for the long_description. It's nice, because now 1) we have a top level
# README file and 2) it's easier to type in the README file than to put a raw
# string in below ...
def read(fname):
return open(os.path.join(os.path.dirname(__file__), fname)).read()

name = "an_example_pypi_project",
version = "0.0.4",
author = "Andrew Carter",
author_email = "",
description = ("An demonstration of how to create, document, and publish "
"to the cheese shop a5"),
license = "BSD",
keywords = "example documentation tutorial",
url = "",
packages=['an_example_pypi_project', 'tests'],
"Development Status :: 3 - Alpha",
"Topic :: Utilities",
"License :: OSI Approved :: BSD License",
python  install  setuptools  packaging  template  dammitbrain 
october 2019 by kme
remy/mit-license: Hosted MIT License with details controlled through this repo; or, https://<username>

Here's a one-liner that can turn that into a usable LICENSE.txt
<code class="language-bash">
curl \
| xidel -e '//article' - \
| sed 's/^ *//g' \
mit  license  copyright  devel  licensing  automation  template  boilerplate  solution 
september 2019 by kme
GitHub - sstephenson/eco: Embedded CoffeeScript templates
Apparently Basecamp used this along with Backbone.js for their calendar view.
coffeescript  javascript  template  library 
july 2019 by kme
carpentries/workshop-template: Rendering of the workshop-template site |
Rendering of the workshop-template site. Contribute to carpentries/workshop-template development by creating an account on GitHub.
workshop  jekyll  website  template  github  ghpage 
march 2019 by kme
Mikey Gee | Blog | truncating blog posts in Jekyll
{% for post in site.posts limit:10 %}
<div class="post-preview">
<h2><a href="{{ post.url }}">{{ post.title }}</a></h2>
<div class="post-date">{{ | date: "%B %d, %Y" }}</div>
{{ post.content | split:'<!--break-->' | first }}
{% if post.content contains '<!--break-->' %}
<a href="{{ post.url }}">read more</a>
{% endif %}
{% endfor %}
jekyll  liquid  webdevel  template  templating  solution 
april 2017 by kme
python - How to render by Vue instead of Jinja - Stack Overflow
A literal "{{" can be produced by "{{ '{{' }}" in the template, or by wrapping everything in a "{% raw %} {% endraw %}" block.
vue  jinja  flask  webdevel  template  solution 
february 2017 by kme
Ten Essential Development Practices -
One of the main reasons documentation can often seem so unpleasant
is the "blank page effect." Many programmers simply don't know how to get
started or what to say.


For a module, that documentation template might look something like this:

=head1 NAME

<Module::Name> - <One-line description of module's purpose>

=head1 VERSION

The initial template usually just has:

This documentation refers to <Module::Name> version 0.0.1.


use <Module::Name>;

# Brief but working code example(s) here showing the most common usage(s)
# This section will be as far as many users bother reading, so make it as
# educational and exemplary as possible.


A full description of the module and its features.

May include numerous subsections (i.e., =head2, =head3, etc.).


A separate section listing the public components of the module's interface.

These normally consist of either subroutines that may be exported, or methods
that may be called on objects belonging to the classes that the module

Name the section accordingly.

In an object-oriented module, this section should begin with a sentence (of the
form "An object of this class represents ...") to give the reader a high-level
context to help them understand the methods that are subsequently described.


A list of every error and warning message that the module can generate (even
the ones that will "never happen"), with a full explanation of each problem,
one or more likely causes, and any suggested remedies.


A full explanation of any configuration system(s) used by the module, including
the names and locations of any configuration files, and the meaning of any
environment variables or properties that can be set. These descriptions must
also include details of any configuration language used.


A list of all of the other modules that this module relies upon, including any
restrictions on versions, and an indication of whether these required modules
are part of the standard Perl distribution, part of the module's distribution,
or must be installed separately.


A list of any modules that this module cannot be used in conjunction with.
This may be due to name conflicts in the interface, or competition for system
or program resources, or due to internal limitations of Perl (for example, many
modules that use source code filters are mutually incompatible).


A list of known problems with the module, together with some indication of
whether they are likely to be fixed in an upcoming release.

Also, a list of restrictions on the features the module does provide: data types
that cannot be handled, performance issues and the circumstances in which they
may arise, practical limitations on the size of data sets, special cases that
are not (yet) handled, etc.

The initial template usually just has:

There are no known bugs in this module.

Please report problems to <Maintainer name(s)> (<contact address>)

Patches are welcome.

=head1 AUTHOR

<Author name(s)> (<contact address>)


Copyright (c) <year> <copyright holder> (<contact address>).
All rights reserved.

followed by whatever license you wish to release it under.

For Perl code that is often just:

This module is free software; you can redistribute it and/or modify it under
the same terms as Perl itself. See L<perlartistic>. This program is
distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS FOR A

Of course, the specific details that your templates provide may vary from those shown here, according to your other coding practices. The most likely variation will be in the license and copyright, but you may also have specific in-house conventions regarding version numbering, the grammar of diagnostic messages, or the attribution of authorship.
perl  webdevel  devel  bestpractices  advice  pod  perlpod  documentation  template  solution 
december 2016 by kme
File locations in Word 2010 - Microsoft Community
The 'normal.dotm' template where user key bindings are stored is in ~/Library/Application Support/Microsoft/Office/User Templates.
msoffice  mac  osx  configfile  template  solution  keyboardshortcuts 
may 2015 by kme
php - How reload twig cache in symfony2 - Stack Overflow
When creating a new Twig_Environment instance, you can pass an array of options as the constructor second argument. One of them is auto_reload. When developing with Twig, it's useful to recompile the template whenever the source code changes. If you don't provide a value for the auto_reload option, it will be determined automatically based on the debug value.

Set auto_reload to be true:

$twig = new Twig_Environment($loader, array('auto_reload' => true));
twig  php  template  html  webdevel  webdesign  solution 
november 2014 by kme
MediaWiki Keypress Style | CodeNuggets
Oh, man. Now that Wikipedia /doc subpages have been converted to use Scribunto (Lua modules), there was a ton of more stuff which was required (at a minimum: Module:Documentation, plus whatever templates that pulls down from Special:Export).
mediawiki  template  wikipedia  fuckina  wiki  webmaster  css 
september 2014 by kme
Help:Template - Meta
Making emptiness and undefinedness equivalent

It is often convenient if assigning the empty string to a parameter has the same effect as not assigning any value to it, as the difference is somewhat abstract, and as mentioned, in some cases there is not even the choice. Also, for example "p=" may be put for convenience, to be filled in later, and/or meant to make explicit that the template has a parameter p, but at this time we do not give it a value.

Making emptiness and undefinedness equivalent can for example be achieved by exclusively using {{{p|}}}, not {{{p}}} and not {{{p|q}}} for a non-empty q, or for example using {{#if:{{{p|}}}|..{{{p}}}..|..}} (i.e., using {{{p}}} only in branches of branching functions where it is defined and non-empty).
mediawiki  annoyance  template  syntax  solution  dammitbrain 
september 2014 by kme
rails, How to build table in helper using content_tag? - Stack Overflow
Solution to my actual problem:
Actually you are only missing a plus between content tags, you can find a similar question here
(I was passing them as separate *arguments*, expecting content_tag to just figure it out).

But here's another interesting solution using .collect():
def display_standard_table(columns, collection = {})

thead = content_tag :thead do
content_tag :tr do
columns.collect {|column| concat content_tag(:th,column[:display_name])}.join().html_safe

tbody = content_tag :tbody do
collection.collect { |elem|
content_tag :tr do
columns.collect { |column|
concat content_tag(:td, elem.attributes[column[:name]])


content_tag :table, thead.concat(tbody)

rails  erb  template  view  helper  ruby  webdevel  solution 
july 2014 by kme
« earlier      
per page:    204080120160

Copy this bookmark:

to read