This is not an article.
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
| #!/usr/bin/env zsh | |
| # | |
| # gulp-autocompletion-zsh | |
| # | |
| # Autocompletion for your gulp.js tasks | |
| # | |
| # Copyright(c) 2014 Doug Fritz <doug@dougfritz.com> | |
| # MIT Licensed | |
| # |
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 through = require('through2') | |
| var File = require('vinyl') | |
| var concat = function(filename, opts) { | |
| var dest = new File({path: filename, contents: through()}) | |
| var stream = through.obj(function(file, _, done) { | |
| file.contents | |
| .pipe(dest.contents, {end: false}) | |
| .on('end', function() { |
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 through = require('through2') | |
| var eachline = function(transform, delim) { | |
| delim = delim || '\n' | |
| return through.obj(function(file, _, done) { | |
| var extra = '' | |
| file.contents = file.contents.pipe( | |
| through(function(chunk, _, cb) { | |
| var data = chunk.toString() | |
| if (extra) { data = extra + data } |
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 through = require('through2') | |
| var prefix = function(data) { | |
| return through.obj(function(file, _, done) { | |
| var stream = through() | |
| stream.push(data) | |
| file.contents = file.contents.pipe(stream) | |
| this.push(file) | |
| done() | |
| }) |
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
| package yepnope | |
| import ( | |
| "net/http" | |
| ) | |
| func YepNope(test func(r *http.Request) bool, yep http.Handler, nope http.Handler) http.Handler { | |
| return http.HandlerFunc(func(rw http.ResponseWriter, r *http.Request) { | |
| if test(r) { | |
| yep.ServeHTTP(rw, r) |
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
| ls -1 *.png | parallel --eta convert '{}' '{.}.jpg' |
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
| <!-- Conditionally load WC polyfills --> | |
| <script> | |
| if ('registerElement' in document | |
| && 'createShadowRoot' in HTMLElement.prototype | |
| && 'import' in document.createElement('link') | |
| && 'content' in document.createElement('template')) { | |
| // We're using a browser with native WC support! | |
| } else { | |
| document.write('<script src="/bower_components/webcomponentsjs/webcomponents.js"><\/script>'); | |
| } |
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
| # http://graphicdesign.stackexchange.com/questions/20908/how-to-remove-every-second-frame-from-an-animated-gif | |
| gifsicle "$1" --unoptimize $(seq -f "#%g" 0 2 $numframes) -O2 -o "$2" |
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 seed = 1; | |
| function random() { | |
| var x = Math.sin(seed++) * 10000; | |
| return x - Math.floor(x); | |
| } |