... or where JSON5 could be useful:
- package.json
- .jshintrc
- SublimeText2 settings
| // Uses ExtJS but the method names are intuitive and are present in most libraries | |
| Ext.Array.map( Ext.Array.pluck(Ext.query('script'), 'src'), function(v, i) { | |
| return '"' + v.slice('site.com/'.length) + '"'; | |
| }).join(',\n') |
| Directory structure | |
| SubModule/ | |
| css/ | |
| ... | |
| js/ | |
| ... | |
| images/ | |
| ... |
| /** | |
| * See https://github.com/sellside/pre | |
| */ | |
| /** | |
| * References/todos: | |
| * http://www.lemoda.net/javascript/dump-dom/dump-dom.html | |
| * http://www.howtocreate.co.uk/tutorials/javascript/dombasics | |
| * Use treewalker or nodefilter?? | |
| * https://developer.mozilla.org/en-US/docs/DOM/NodeFilter |
| /** | |
| * Using experimental, unfinished version of Pre language | |
| * See https://github.com/sellside/pre | |
| */ | |
| html.js.js.borderradius.boxshadow.textshadow.opacity.cssgradients.boxsizing { | |
| xmlns: "http://www.w3.org/1999/xhtml"; | |
| xmlns-dc: "http://purl.org/dc/elements/1.1/"; | |
| xmlns-ctag: "http://commontag.org/ns#"; | |
| lang: "en"; |
| /***************************************************************************** | |
| * GENERAL * | |
| * ***************************************************************************/ | |
| // Append an empty div to current element | |
| $0.appendChild(document.createElement('div')) | |
| // "Duplicate down" current element | |
| (function() { |
| # extract any type of compressed file | |
| # credit https://coderwall.com/p/arwifq | |
| function extract { | |
| echo Extracting $1 ... | |
| if [ -f $1 ] ; then | |
| case $1 in | |
| *.tar.bz2) tar xjf $1 ;; | |
| *.tar.gz) tar xzf $1 ;; | |
| *.bz2) bunzip2 $1 ;; | |
| *.rar) rar x $1 ;; |
| export EDITOR=vim | |
| # export EDITOR="$HOME/bin/mate -w" | |
| source ~/.bash/aliases | |
| source ~/.bash/paths | |
| # Bashmarks is a simple set of bash functions that allows you to bookmark | |
| # folders in the command-line. | |
| source ~/.bash/bookmarks |
| - Trailing commas are ok | |
| - No reserved words for property names | |
| - NaN, Infinity, undefined : are all constants | |
| - parseInt() defaults to radix 10 | |
| - /regexp/ produces new reg ex object every time | |
| - JSON.parse(), JSON.stringify() | |
| - Function.prototype.bind | |
| - String.prototype.trim | |
| - Array.prototype.every, filter, forEach, indexOf, lastIndexOf, map, reduce, reduceRight, some, | |
| - Date.now() |
| declare function camelize(s: string): string; |