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
// 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']; |
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
// 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 | |
"use strict"; | |
define(function () { |
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
# | |
# Wide-open CORS config for nginx | |
# | |
location / { | |
if ($request_method = 'OPTIONS') { | |
add_header 'Access-Control-Allow-Origin' '*'; | |
# |
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 up factories, then create them in tests with (for example): | |
* | |
* LineItemFactory(); | |
* | |
* Or with attributes / overrides: | |
* | |
* LineItemFactory({ | |
* "id": 123, | |
* "order": OrderFactory({"firstName": "Example Associated Record Override"}), |
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
factory = -> | |
class MyClass | |
do (root = window, factory = factory) -> | |
if (typeof define is 'function' && define.amd) | |
define -> factory() |
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
export app_name="reproduce_rails_routing_bug" | |
echo $app_name | |
rails new ${app_name} | |
cd ${app_name} | |
rails g scaffold foo | |
cd config | |
sed -i '/^$/d' routes.rb | |
sed -i '/#/d' routes.rb | |
cd .. | |
rails destroy scaffold foo |
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 fif { | |
grep -lir "$*" * | |
} | |
function fifp { | |
grep -RnisI "$*" * | |
} | |
function fifvo { | |
vim -O $(fif $*) |
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
// From Real World Haskell - Chapter 4, Exercise 7 | |
// any_foldr p xs = foldr (||) False (map p xs) => http://haskell.elkstein.org/2009/04/solutions-to-chapter-4-p-97.html | |
var any = function (pred, list) { | |
var xs = _.map(list, pred); | |
return _.reduceRight(xs, function (acc, x) { |
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
brew | |
==== | |
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" && brew install curl rlwrap tmux htop reattach-to-user-namespace | |
.vimrc | |
====== | |
set clipboard=unnamed | |
aliases | |
======= |
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
Pinterest: http://www.pinterest.com/pin/create/button/?url=URL&media=IMAGE&description=DESCRIPTION | |
# appears to be deprecated | |
Facebook: http://www.facebook.com/sharer.php?s=100&p[url]=URL&p[title]=TITLE&p[summary]=SUMMARY&p[images][0]=IMAGE | |
Twitter: http://twitter.com/share/?text=TEXT&url=URL |
OlderNewer