Source : Smashing Mag
This file contains hidden or 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 gulp = require('gulp'); | |
| var gutil = require('gulp-util'); | |
| var coffee = require('gulp-coffee'); | |
| gulp.task('default', function() { | |
| gulp.src('./src/*.coffee') | |
| .pipe(coffee({bare: true}) | |
| .on('error', gutil.log)) | |
| .pipe(gulp.dest('./')) | |
| }); |
This file contains hidden or 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
| # Create local references to array methods we’ll want to use later. | |
| array = [] | |
| push = array.push | |
| slice = array.slice | |
| splice = array.splice | |
| # (Backbone.)Events : A module that can be mixed in to any object in order to provide it with custom events. You may bind with on or remove with off callback functions to an event; trigger-ing an event fires all callbacks in succession. | |
| class Events | |
| # Bind an event to a `callback` function. Passing `"all"` will bind |
This file contains hidden or 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
| Ruler = function (label, top, color, $container){ | |
| return $('<p class="ruler">'+label+'</p>').css({ | |
| "position": "absolute", | |
| "width": "100%", | |
| "margin": "0", | |
| "padding": "0", | |
| "border-top": "2px solid "+color, | |
| "top": top, | |
| "background": "rgba(255,255,255,.6)" | |
| }).appendTo($container); |
This file contains hidden or 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
| # Override the navigate method to plug Ganalytics to it | |
| originalLoadUrl = Backbone.History.prototype.loadUrl; | |
| # This cleans up fragment the same way that loadUrl does as of Backbone 0.5.3 | |
| Backbone.History.prototype.loadUrl = (fragmentOverride) -> | |
| fragment = this.fragment = this.getFragment(fragmentOverride) | |
| console.log fragment, window.ga | |
| if window.ga != undefined |
This file contains hidden or 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
| styles = [ | |
| featureType: "poi", | |
| elementType: "labels", | |
| stylers: [ | |
| visibility: "off" | |
| ] | |
| ]; | |
| map = new google.maps.Map(document.getElementById('map-canvas'), { | |
| disableDefaultUI: true, |
This file contains hidden or 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 colors = require('colors'); | |
| var exec = require('child_process').exec; | |
| exec('git rev-parse HEAD', function(error, stdout, stderr){ | |
| hash = process.argv[2] ? process.argv[2] : stdout | |
| hash = hash.toString(); | |
| hash = hash.split(''); | |
| var identicons = '', | |
| on = " ".zebra.inverse, | |
| off = " ".green.inverse, |
This file contains hidden or 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
| $.getJSON('http://jsonip.com/?callback=', function(data){ | |
| console.log('Your ip is: ' + data.ip); | |
| }); |
This file contains hidden or 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
| [...] | |
| typo3conf/ext/skin/ext_typoscript_setup_local.txt |