This file contains hidden or 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 shim(obj) { | |
if (toString.call(obj) == '[object Function]') { | |
return obj() | |
} | |
return obj | |
} | |
module.exports = function(schema, options) { | |
options || (options = {}) |
This file contains hidden or 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
<!doctype html> | |
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ --> | |
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]--> | |
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]--> | |
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]--> | |
<!-- Consider adding a manifest.appcache: h5bp.com/d/Offline --> | |
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]--> | |
<head> | |
<meta charset="utf-8"> |
This file contains hidden or 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
/ Fatalities | |
var fatalities = { | |
triggers: { | |
konamiCode: function(scriptPath, scriptFn) { | |
console.log("Added function"); | |
var konamiKeys = [], konamiCombo = "38,38,40,40,37,39,37,39,66,65"; | |
$(document).keydown(function(e) { | |
konamiKeys.push(e.keyCode); | |
if(konamiKeys.toString().indexOf(konamiCombo) >= 0) { | |
$(document).unbind('keydown', arguments.callee); |
This file contains hidden or 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
/*=========================================================================== | |
SETTINGS | |
============================================================================= */ | |
var port = 3000, | |
cacheAge = 60000 * 60 * 24 * 365, | |
logs = { | |
set: false, | |
string: '\\n ' + ':date'.bold.underline + '\\n\\n' + ' IP: '.cyan.bold | |
+ ' ' + ':remote-addr'.white + '\\n' + ' Method: '.red.bold |
This file contains hidden or 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
exports.exec = (options, callback) -> | |
# Load image | |
fs.readFile './image.jpg', (err, img) -> | |
if err | |
return callback(err, null); | |
# POST image to imgur | |
request { | |
method: 'POST', | |
body: "image=" + img.toString() + "&key=42e1c4982b52fabcae9033ff428d5175", | |
uri: 'http://imgur.com/api/upload.json', |
This file contains hidden or 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 http = require('http'); | |
var querystring = require('querystring'); | |
var data = { | |
message: 'Hello' | |
}; | |
var form_data = querystring.stringify(data); | |
var options = { |
This file contains hidden or 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 req = http.request({ | |
host: '127.0.0.1', | |
port: '5984', | |
path: '/ms/', | |
method: 'POST', | |
headers: { | |
'Content-Type': 'application/json' // Need to add headers object | |
}}, function(res){ | |
var sigma = ''; | |
res.on('data',function(chunk){sigma+=chunk}) |
This file contains hidden or 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 sys = require("sys"), | |
http = require("http"), | |
url = require("url"), | |
querystring = require("querystring"); | |
var apiPort = process.ARGV[2] || 8080; | |
var apiKey = 'YOUR KEY HERE'; | |
http.createServer(function(req, res) { | |
var jsonp = 'jsonp'; |
This file contains hidden or 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.post('#/reply', function (context) { | |
var fields = this.params, doc = {}; | |
doc.content = fields['post']; | |
doc.datetime = new Date.now(); | |
doc.thread_id = fields['thread_id']; | |
doc.type = 'post'; | |
doc.user_id = 'chapel'; | |
console.log(doc); | |
db.saveDoc(doc, { | |
success: function() { |
This file contains hidden or 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
-- -------------------------------------- -- Gist Script for Linkinus -- by Jacob Chapel -- Version 0.5 -- -------------------------------------- on linkinuscmd(paste_type) set useGrowl to do shell script "defaults read com.conceitedsoftware.Linkinus alertGrowl" set theURL to "" set file_type to ".txt" set file_types to {{"ActionScript", ".as"}, {"C", ".c"}, {"Csharp", ".cs"}, {"Common_Lisp", ".cl"}, {"emacs_lisp", ".sls"}, {"erlang", ".hrl"}, {"haskell", ".hs"}, {"html", ".html"}, {"java", ".java"}, {"lua", ".lua"}, {"objective_c", ".m"}, {"perl", ".pl"}, {"Scala", ".scala"}, {"scheme", ".sls"}, {"TeX", ".tex"}, {"XML", ".xml"}, {"Ada", ".adb"}, {"AppleScript", ".scpt"}, {"Arc", ".arc"}, {"ASP", ".ascx"}, {"Assembly", ".asm"}, {"Batchfile", ".bat"}, {"Befunge", ".befunge"}, {"Boo", ".boo"}, {"Brainfuck", ".b"}, {"C_ObjDump", ".c-objdump"}, {"ChucK", ".java"}, {"Clojure", ".clj"}, {"CoffeeScript", ".coffee"}, {"ColdFusion", ".cfm"}, {"Cpp_ObjDump", ".cppobjdump"}, {"Cucumber", ".feature"}, {"D", ".d"}, |