NOTE I now use the conventions detailed in the SUIT framework
Used to provide structural templates.
Pattern
t-template-name
NOTE I now use the conventions detailed in the SUIT framework
Used to provide structural templates.
Pattern
t-template-name
| ### Testing if the client is a mobile or a desktop. | |
| ### The selection is based on the usual UA strings for desktop browsers. | |
| ## Testing a user agent using a method that reverts the logic of the | |
| ## UA detection. Inspired by notnotmobile.appspot.com. | |
| map $http_user_agent $is_desktop { | |
| default 0; | |
| ~*linux.*android|windows\s+(?:ce|phone) 0; # exceptions to the rule | |
| ~*spider|crawl|slurp|bot 1; # bots | |
| ~*windows|linux|os\s+x\s*[\d\._]+|solaris|bsd 1; # OSes | 
| #!/bin/bash | |
| # current Git branch | |
| branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,') | |
| # v1.0.0, v1.5.2, etc. | |
| versionLabel=v$1 | |
| # establish branch and tag name variables | |
| devBranch=develop | 
| /* function to urlify a string */ | |
| var urlify = function(a){return a.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "-").replace(/^-+|-+$/g, '')}; | |
| /* usage example */ | |
| var str_a = "* The Best Wallpaper Magazine in the . ? & world! : Rjer9238131 & "; | |
| urlify(str_a) | |
| /* returns */ | |
| "the-best-wallpaper-magazine-in-the-world-rjer9238131" | 
| import java.awt.event.*; | |
| class Path { | |
| ArrayList points; | |
| Path() { | |
| points = new ArrayList(); | |
| } | |
| void add(float x, float y) { | |
| this.points.add( new PVector( x, y ) ); | 
| // http://paulirish.com/2011/requestanimationframe-for-smart-animating/ | |
| // http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating | |
| // requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel | |
| // MIT license | |
| (function() { | |
| var lastTime = 0; | |
| var vendors = ['ms', 'moz', 'webkit', 'o']; | 
| /* | |
| Distributed under The MIT License: | |
| http://opensource.org/licenses/mit-license.php | |
| Permission is hereby granted, free of charge, to any person obtaining | |
| a copy of this software and associated documentation files (the | |
| "Software"), to deal in the Software without restriction, including | |
| without limitation the rights to use, copy, modify, merge, publish, | |
| distribute, sublicense, and/or sell copies of the Software, and to | 
| [alias] | |
| stage = !sh -c '[[ -z "$@" ]] && git add -u || git add "$@" && git add -u "$@" ' - | |
| unstage = reset HEAD -- | |
| rewind = ![[ -z "$@" ]] && git reset --hard HEAD || git checkout HEAD | 
| /* | |
| * Extends Handlebars with a basic get method for loading external | |
| * Handlebars templates. Simply pass an options object which contains | |
| * the following properties: | |
| * - path (required) : Path to the external template file to be loaded | |
| * - success (required) : Callback invoked with the compiled loaded template. | |
| * - cache (optional) : true if the template is to be cached, otherwise false. | |
| * | |
| * In addition to the above arguments, any jQuery/Zepto.ajax options argument | |
| * can be specified as well. | 
| // Restify server config here | |
| var server = restify.createServer({ | |
| name: 'restify-test', | |
| version: '1.0.0', | |
| }); | |
| // ... | |
| // Connect config here | |
| var connectApp = connect() |