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 gulp = require('gulp'); | |
var util = require('gulp-util'); | |
var concat = require('gulp-concat'); | |
var gulpif = require('gulp-if'); | |
var uglify = require('gulp-uglify'); | |
var header = require('gulp-header'); | |
var rimraf = require('gulp-rimraf'); | |
var pkg = require('./package.json'); | |
var coffeeify = require('coffeeify'); | |
var sourcemaps = require('gulp-sourcemaps'); |
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
// pre 1.6 | |
function cleanArray(actual){ | |
var newArray = new Array(); | |
for(var i = 0; i<actual.length; i++){ | |
if (actual[i]){ | |
newArray.push(actual[i]); | |
} | |
} | |
return newArray; | |
} |
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
{% set currentPath = path(app.request.attributes.get('_route'), app.request.attributes.get('_route_params')) %} |
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
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine | |
# This is how I upload my new Sol Trader builds (http://soltrader.net) | |
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash | |
S3KEY="my aws key" | |
S3SECRET="my aws secret" # pass these in | |
function putS3 | |
{ | |
path=$1 |
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
// ie9+ | |
function extend (target, source) { | |
var a = Object.create(target); | |
Object.keys(source).map(function (prop) { | |
prop in a && (a[prop] = source[prop]); | |
}); | |
return a; | |
}; |
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 Injector = { | |
dependencies: {}, | |
add : function(qualifier, obj){ | |
this.dependencies[qualifier] = obj; | |
}, | |
get : function(func){ | |
var obj = new func; | |
var dependencies = this.resolveDependencies(func); | |
func.apply(obj, dependencies); | |
return obj; |
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
#!/bin/bash | |
port_param=$1 | |
port=${port_param:-5555} | |
function processId { | |
/bin/ps aux | grep "SimpleHTTPServer $port" | grep -v grep | awk '{print $2}' | |
} | |
# kill previous processes |
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
// Find all YouTube videos | |
var $allVideos = $("iframe[src^='http://www.youtube.com']"), | |
// The element that is fluid width | |
$fluidEl = $("body"); | |
// Figure out and save aspect ratio for each video | |
$allVideos.each(function() { | |
$(this) |
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 gulp = require('gulp'); | |
var sass = require('gulp-sass'); | |
gulp.task('watch', ['sass'], function() { | |
gulp.watch(['scss/*.scss'], ['sass']); | |
}); | |
gulp.task('sass', function() { | |
gulp.src('scss/*.scss') | |
.pipe(sass()) |
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
/* | |
+-----------------------------------------------------------------+ | |
| Created by Chirag Mehta - http://chir.ag/projects/ntc | | |
|-----------------------------------------------------------------| | |
| ntc js (Name that Color JavaScript) | | |
+-----------------------------------------------------------------+ | |
All the functions, code, lists etc. have been written specifically | |
for the Name that Color JavaScript by Chirag Mehta unless otherwise |
NewerOlder