This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### TODO: Support command-line options (width, bg color, etc) | |
if [ $# -eq 0 ]; then | |
echo 'No arguments passed.' | |
echo "Usage: svgexport <SVG files to export>" | |
echo "Say \"svgexport .\" to export all SVGs in current directory" | |
exit 1 | |
else | |
pattern=$* | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
(function () { | |
"use strict"; | |
// once cached, the css file is stored on the client forever unless | |
// the URL below is changed. Any change will invalidate the cache | |
var css_href = '/static/media/fonts/proxima-nova/font-compiled.css'; | |
// a simple event handler wrapper | |
function on(el, ev, callback) { | |
if (el.addEventListener) { | |
el.addEventListener(ev, callback, false); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input.placeholder { | |
color: #999; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if ( window.XDomainRequest ) { | |
jQuery.ajaxTransport(function( s ) { | |
if ( s.crossDomain && s.async ) { | |
if ( s.timeout ) { | |
s.xdrTimeout = s.timeout; | |
delete s.timeout; | |
} | |
var xdr; | |
return { | |
send: function( _, complete ) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
module.exports = function(grunt) { | |
var cheerio = require("cheerio"), | |
_ = require("underscore"), | |
jadeWrapIndent = function(renderedContent, indentLevel) { | |
var indentation=[]; | |
for(var i=0;i<indentLevel;i++){ | |
indentation.push(' '); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if [ $# -eq 0 ] | |
then wd=. | |
else wd=$1 | |
fi | |
find $wd -name "*.js" -not -path "*/tests/*" | xargs grep -v '^[ ]*$' | wc -l |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function fileSizeFormat( num_bytes ) { | |
if ( ! num_bytes ) return '0 bytes'; | |
typeof num_bytes == 'number' || ( num_bytes = parseFloat( num_bytes ) ); | |
if ( isNaN( num_bytes ) ) return ''; | |
var i = -1; | |
var byteUnits = [ 'kB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']; | |
do { | |
num_bytes = num_bytes / 1000; | |
i++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var MyModelView = Backbone.Marionette.ItemView.extend({ | |
template: '#jst-some-template', | |
modelEvents: { | |
'change': 'render' | |
'destroy': 'remove' | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Post = Backbone.Model.extend({ | |
parse: function( resp ) { | |
return _( resp ).extend({ | |
created_by: new User( resp.created_by ) | |
}); | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var AnyCollectionView = Backbone.View.extend({ | |
initialize: function() { | |
this.collection.on( 'add', this.appendItem, this ); | |
}, | |
render: function() { | |
this.$el.empty(); | |
this.collection.each( this.appendItem, this ); | |
return this; |
NewerOlder