- boss
- nippy
- hubby
- fisticuffs
- nighters
- om nom nom
- curled up with a glass of wine
- I’m living life to the fullest
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
// Our implementation of Function.prototype.bind | |
Function.prototype.bind = function() { | |
var __method = this, args = Array.prototype.slice.call(arguments), object = args.shift(); | |
return function() { | |
var local_args = args.concat(Array.prototype.slice.call(arguments)); | |
if (this !== window) local_args.push(this); | |
return __method.apply(object, local_args); | |
} | |
}; |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>jQuery Template Example</title> | |
</head> | |
<body> | |
<ul id="engineers"></ul> | |
<script id="tmpl-engineer" type="text/x-jquery-tmpl"> | |
<li>${name}</li> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> | |
<meta http-equiv="content-type" content="text/html; charset=UTF-8"/> | |
<title>Locations of Apple Stores</title> | |
<style type="text/css"> | |
html, body { | |
height: 100%; | |
margin: 0; |
KeyValue is a simple key value store written in Ruby for Codebrawl #9. It provides programmatic and command line access to the store. The data is persisted as JSON, serialized to a file.
require "key_value"
kv = KeyValue.new
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
html, body, div, span, object, iframe, | |
h1, h2, h3, h4, h5, h6, p, blockquote, pre, | |
abbr, address, cite, code, | |
del, dfn, em, img, ins, kbd, q, samp, | |
small, strong, sub, sup, var, | |
b, i, | |
dl, dt, dd, ol, ul, li, | |
fieldset, form, label, legend, | |
table, caption, tbody, tfoot, thead, tr, th, td, | |
article, aside, canvas, details, figcaption, figure, |
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
# Given a function that accepts a function followed by a non-function argument... | |
foo = (callback, name) -> | |
console.log "Calling callback #{name}..." | |
callback() | |
# you end up with a line starting with | |
# a comma which just feels wrong... | |
foo -> | |
console.log "Callback called!" | |
, "bar" |
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
#!/usr/bin/env ruby | |
# | |
# This script will expand the current word into: <word></word> | |
# It will recognize HTML 4.0 tags that need no close tag. | |
# | |
# With no current word, it will insert: <p></p> and allows you | |
# to overwrite the tag name and add potential arguments. | |
# | |
# The result is inserted as a snippet, so it's | |
# possible to tab through the place holders. |
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
def daemonize_app | |
if RUBY_VERSION < "1.9" | |
exit if fork | |
Process.setsid | |
exit if fork | |
Dir.chdir "/" | |
STDIN.reopen "/dev/null" | |
STDOUT.reopen "/dev/null", "a" | |
STDERR.reopen "/dev/null", "a" | |
else |