Skip to content

Instantly share code, notes, and snippets.

View ngryman's full-sized avatar

Nicolas Gryman ngryman

View GitHub Profile
@ngryman
ngryman / dshell
Created August 20, 2020 15:35 — forked from bcooksey/dshell
dshell: A little wrapper around the docker-compose run command that intelligently gets you a shell inside a container
#!/bin/bash
if [ ! -z $1 ]; then
MATCHER=$1
else
# Try to guess the project based on directory name
MATCHER=`pwd | sed 's/\/.*\///'`
fi
echo "Looking for web container named '$MATCHER'..."
@ngryman
ngryman / 0_reuse_code.js
Created January 22, 2014 19:16
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@ngryman
ngryman / rAF.js
Created June 19, 2013 03:41 — forked from paulirish/rAF.js
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@ngryman
ngryman / snippet.js
Last active February 14, 2019 23:55 — forked from necolas/snippet.js
/*
* Updated to use the function-based method described in http://www.phpied.com/social-button-bffs/
* Better handling of scripts without supplied ids.
*
* N.B. Be sure to include Google Analytics's _gaq and Facebook's fbAsyncInit prior to this function.
*/
(function(d, u) {
var s = d.scripts[0],
i = u.length, g;
$(document).ready(function() {
var prefix = "https://gist.github.com/";
$('a[href^="' + prefix + '"]').each(function(i) {
var $anchor = $(this),
$el = $("<p></p>");
$anchor.replaceWith($el);
writeCapture.html($el, '<script src="'+$anchor.text()+'"></scr' + 'ipt>');
$anchor.remove();
});
});
// via http://twitter.com/izs/statuses/17744109574
var foo = 1;
var bar = 2;
foo = [bar, bar = foo][0];