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
Backbone.Helpers ||= {} | |
class Backbone.Helpers.Paginate extends dpm.Callbacks | |
# we simply store a ref to the instance and the property so that we dont have to store the data in two places, ! too big | |
constructor:(inst,prop,@perPage)-> | |
super() | |
@setSource inst, prop | |
@reset() | |
reset:()-> |
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
$ cat .git/hooks/pre-commit | |
#!/bin/sh | |
DIFF=`git diff HEAD`+`git diff --cached HEAD` | |
if [[ "$DIFF" == *"DO NOT COMMIT"* ]] | |
then | |
echo "Error; Attempt to commit a delta including the phrase 'DO NOT COMMIT'"; | |
echo | |
echo "Use --no-verify to bypass this check." |
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
describe("Mocking Ajax Calls", function() { | |
beforeEach(function() { | |
loadFixtures('test.html'); | |
//mocking ajax call with Jasmine Spies | |
var fakeData = "You can put your return data here"; | |
spyOn($, "ajax").andCallFake(function(params) { | |
params.success(fakeData); | |
}); | |
}); |
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
$("*[rel='stylesheet']").each(function() { | |
var href = $(this).attr("href"); | |
$(this).attr("href", "http://localhost:3000" + href); | |
}); |
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/sh | |
# Refuse to commit files with the string NOCOMMIT, debugger, or merge markers present. | |
# | |
files=$(git diff-index --name-status --cached HEAD | grep -v ^D | cut -c3-) | |
if [ "$files" != "" ] | |
then | |
for f in $files | |
do |
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
/**********************************************/ | |
/* | |
/* Tomorrow Skin by Ben Truyman - 2011 | |
/* | |
/* Based on Chris Kempson's Tomorrow Theme: | |
/* https://github.com/ChrisKempson/Tomorrow-Theme | |
/* | |
/* Inspired by Darcy Clarke's blog post: | |
/* http://darcyclarke.me/design/skin-your-chrome-inspector/ | |
/* |
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
document.getElementsByTagName('pre')[0].innerHTML = document.getElementsByTagName('pre')[0].innerHTML.replace(/,/g, ",\n").replace(/{/g, "{\n").replace(/}/g, "\n}") |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>author</key> | |
<string>Michael Sheets</string> | |
<key>name</key> | |
<string>Twilight</string> | |
<key>settings</key> | |
<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
/**********************************************/ | |
/* | |
/* IR_Black Skin by Ben Truyman - 2011 | |
/* | |
/* Based on Todd Werth's IR_Black: | |
/* http://blog.toddwerth.com/entries/2 | |
/* | |
/* Inspired by Darcy Clarke's blog post: | |
/* http://darcyclarke.me/design/skin-your-chrome-inspector/ | |
/* |
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 Animal (name) { | |
console.log("Animal constructor is called " + name); | |
} | |
Animal.prototype.sleep = function () { | |
console.log(this.name + ' is sleeping'); | |
}; | |
// extending the parent classe |