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
alias accio=wget | |
alias avadaKedavra='rm -f' | |
alias imperio=sudo | |
alias priorIncantato='echo `history |tail -n2 |head -n1` | sed "s/[0-9]* //"' | |
alias stupefy='sleep 5' | |
alias wingardiumLeviosa=mv | |
alias sonorus='set -v' | |
alias quietus='set +v' |
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
// Checks if the actual object is an instance of the expected type; | |
// the functional object `expected` can be any ancestor prototype. | |
// | |
// Example: | |
// expects(new Backbone.Model()).toBeInstanceOf(Backbone.Model); | |
jasmine.Matchers.prototype.toBeInstanceOf = function(expected) { | |
var actual = this.actual, | |
notText = this.isNot ? ' not' : ''; | |
this.message = function() { | |
return 'Expected ' + actual + notText + ' to be an instance of ' + expected; |
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
// By Clément Wehrung | |
function Iterator(queueRef, processingCallback) { | |
this.queueRef = queueRef; | |
this.processingCallback = processingCallback; | |
this.processed = {}; | |
this.processNext(); | |
} | |
Iterator.prototype.processNext = 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
{ | |
"chat": { | |
// the list of chats may not be listed (no .read permissions here) | |
// a chat conversation | |
"$key": { | |
// if the chat hasn't been created yet, we allow read so there is a way | |
// to check this and create it; if it already exists, then authenticated | |
// user (specified by auth.id) must be in $key/users |
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
jasmine.Matchers.prototype.toBeTypeOf = function(expected) { | |
var actual, notText, objType; | |
actual = this.actual; | |
notText = this.isNot ? 'not ' : ''; | |
objType = actual ? Object.prototype.toString.call(actual) : ''; | |
this.message = function() { | |
return 'Expected ' + actual + notText + ' to be an array'; | |
} |
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
/* | |
Occasionally you need to eliminate the gutters from your grid columns. Include | |
this SCSS in your project and add a class of .row-nogutter to any <div class="row"> | |
to magically remove its gutters. Not incredibly well-tested, but works for me. | |
This currently only works for standard (non-fluid) grids. | |
*/ |
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
// This method gives you an easier way of calling super | |
// when you're using Backbone in plain javascript. | |
// It lets you avoid writing the constructor's name multiple | |
// times. You still have to specify the name of the method. | |
// | |
// So instead of having to write: | |
// | |
// User = Backbone.Model.extend({ | |
// save: function(attrs) { | |
// this.beforeSave(attrs); |
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' '*'; | |
# |