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
var bodyContents = htmlCodez.match(/(?:(?:\s|\S)*<body[^>]*>)((?:\s|\S)*)(?:<\s*\/\s*body\s*\>(?:\s|\S)+)/)[1]; |
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
// Proto-classical Inheritence?? AMIDOINITRITE | |
function extend (clazz, superclass) { | |
clazz.prototype = new superclass; | |
clazz.superclass = superclass; | |
} | |
// So...looks like this is a stripped down version of YUI's Y.extend |
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
PROMPT='%{$fg_bold[red]%}➠ %{$fg_bold[yellow]%}%n%{$fg_bold[white]%}%p%{$fg_bold[white]%} of %{$fg_bold[blue]%}%m%{$fg_bold[white]%} in %{$fg[cyan]%}%c %{$fg_bold[blue]%}$(git_prompt_info)%{$fg_bold[blue]%}% %{$fg[white]%}commands thee to %{$reset_color%}' | |
ZSH_THEME_GIT_PROMPT_PREFIX="git:(%{$fg[red]%}" | |
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[blue]%}) %{$fg[yellow]%}✗%{$reset_color%}" | |
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[blue]%})" |
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
// npm install promised-io | |
var promised = require('promised-io/promise'); | |
// all of these async methods return an instance of promised.Promise | |
var filePromise = getFile('/foo.html') | |
, databasePromise = getDatabaseRecord('users/bentruyman') | |
, websocketPromise = establishWebsocketConnection(); | |
promised.all([filePromise, databasePromise, websocketPromise], function (arrayOfResolvedData) { | |
// all promises have been resolved |
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
// BAD: `return` shouldn't be used to control flow/execution | |
function loadProductData(query) { | |
if ($('body').hasClass('busy')) | |
return; | |
$.ajax( /*...*/ ); | |
} | |
// GREAT SUCCESS: Just do this instead (OMG duh!) | |
function loadProductData(query) { |
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
// Can we get something like this?? | |
var howManyRainbows = 'double'; | |
var rainbow = { | |
(howManyRainbows): true | |
}; | |
if (rainbow.double) { | |
alert('What does it mean?'); |
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
var foo = true | |
(function bar () { | |
return false | |
}()) |
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
// ==UserScript== | |
// @match http://*/* | |
// @match https://*/* | |
// ==/UserScript== | |
var style = document.createElement('style'); | |
style.textContent = [ | |
'pre { ', | |
' -webkit-tab-size: 2;', | |
' -moz-tab-size: 2;', |
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
var mongoose = require('mongoose'); | |
mongoose.connect('mongodb://localhost/sebtest'); | |
var Schema = mongoose.Schema; | |
var StackItemSchema = new Schema({ | |
blob: Number | |
}); | |
var StackSchema = new Schema({ |
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 - 2012 | |
/* | |
/* 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/ | |
/* |
OlderNewer