NOTE I now use the conventions detailed in the SUIT framework
Used to provide structural templates.
Pattern
t-template-name
| /* | |
| * Quick and Dirty sprintf | |
| * Copyright 2011 Nicholas C. Zakas. All rights reserved. | |
| * BSD licensed | |
| */ | |
| /* | |
| * This function does not attempt to implement all of sprintf, just %s, | |
| * which is the only one that I ever use. | |
| */ |
| function ellipsis(numOfWords, text, wordCount ) { | |
| wordCount = text.trim().replace(/\s+/g, ' ').split(' ').length; | |
| if(numOfWords <= 0 || numOfWords === wordCount){ | |
| return text; | |
| } else { | |
| text = text.trim().split(' '); | |
| text.splice(numOfWords, wordCount, '...'); | |
| return text.join(' '); | |
| } | |
| } |
NOTE I now use the conventions detailed in the SUIT framework
Used to provide structural templates.
Pattern
t-template-name
| // ==UserScript== | |
| // @name Use Markdown, sometimes, in your HTML. | |
| // @author Paul Irish <http://paulirish.com/> | |
| // @link http://git.io/data-markdown | |
| // @match * | |
| // ==/UserScript== | |
| // If you're not using this as a userscript just delete from this line up. It's cool, homey. |
| // 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']; |
| /** | |
| * Create a web friendly URL slug from a string. | |
| * | |
| * Requires XRegExp (http://xregexp.com) with unicode add-ons for UTF-8 support. | |
| * | |
| * Although supported, transliteration is discouraged because | |
| * 1) most web browsers support UTF-8 characters in URLs | |
| * 2) transliteration causes a loss of information | |
| * | |
| * @author Sean Murphy <[email protected]> |
| /** | |
| * Based conceptually on the _.extend() function in underscore.js ( see http://documentcloud.github.com/underscore/#extend for more details ) | |
| * Copyright (C) 2012 Kurt Milam - http://xioup.com | Source: https://gist.github.com/1868955 | |
| * | |
| * This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. | |
| * | |
| * 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 PARTICULAR PURPOSE. See the GNU General Public License for more details. | |
| * | |
| * You should have received a copy of the GNU General Public License along with this program. If not, see http://www.gnu.org/licenses/. | |
| **/ |
| /** | |
| * Thanks to @philsturgeon for pointing this package | |
| * and Filipe Dobreira "https://github.com/filp" for creating it ^^ | |
| * Github : https://github.com/filp/whoops | |
| * How to: | |
| * Step 1 : Setup composer for Laravel 3 | |
| * Step 2 : Add this code to your application/start.php or anywhere u like | |
| * as long its after laravel registers its own error handlers | |
| * so NOT in : index.php, paths.php or laravel/** | |
| * |
| #!/bin/bash | |
| libs=( "/usr/local/lib/libmacfuse_i32.2.dylib" \ | |
| "/usr/local/lib/libosxfuse_i32.2.dylib" \ | |
| "/usr/local/lib/libosxfuse_i64.2.dylib" \ | |
| "/usr/local/lib/libmacfuse_i64.2.dylib" \ | |
| "/usr/local/lib/libosxfuse_i32.la" \ | |
| "/usr/local/lib/libosxfuse_i64.la" \ | |
| "/usr/local/lib/pkgconfig/osxfuse.pc" ) |
| <?php | |
| $data = [ | |
| [ 'id' => 0 ], | |
| [ 'id' => 1 ], | |
| [ 'id' => 2, | |
| 'children' => [ | |
| [ 'id' => 3 ], | |
| [ 'id' => 4, | |
| 'children' => [ |