a list of slides from nodeconf
you may want to take a look at the jsconf-gist too!
<!doctype html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"/> | |
<title>Event Pooling, or perhaps Pub/Sub</title> | |
<script type="text/javascript" charset="utf-8" src="http://ajax.microsoft.com/ajax/jQuery/jquery-1.4.2.min.js"></script> | |
</head> | |
<body> | |
<strong>Who is this?</strong> | |
<form action="#" method="get" accept-charset="utf-8" id="whoisit"> |
window.addEventListener "DOMContentLoaded", -> | |
body = $ "body" | |
canvas = $ "#canvas" | |
chalkboard = $ "#chalkboard" | |
close = $ "#close" | |
ledge = $ "#ledge" | |
lightswitch = $ "#lightswitch" | |
output = $ "#output" | |
shade = $ "#shade" | |
share = $ "#share" |
" markdown.vim | |
" Markdown preview using RDiscount ruby gem. | |
" Put this file into .vim/ftplugin | |
command! -nargs=0 MarkdownPreview call MarkdownRenderBufferToPreview() | |
noremap <buffer> <Leader>rp :MarkdownPreview<CR> | |
setlocal ignorecase | |
setlocal wrap |
// Promise implementation based on unscriptable's minimalist Promise: | |
// https://gist.github.com/814052/ | |
function Promise () { | |
this._thens = []; | |
} | |
Promise.prototype = { | |
/* This is the "front end" API. */ |
// Current way of doing modules, you have to expose it via a return statement to make it public. | |
var Thing = (function(){ | |
function getStuff(){ alert('Stuff retrieved!'); | |
return { | |
getStuff: getStuff | |
} | |
})(); | |
// ECMAScript.Next proposal... adding "export" will make functions public. | |
// I wonder why they didn't just call it "public function".. export sounds like I'm downloading or something. Meh. |
a list of slides from nodeconf
you may want to take a look at the jsconf-gist too!
#!/usr/bin/env bash | |
# Configuration | |
SERVER='myserver' | |
DEPLOY_TO='/path/to/app' | |
EXCLUDE='*.swp .git/ db/sphinx/ tmp/ log/' | |
DRY_RUN=false | |
DEPLOY_GEM_PATH='/opt/ec/ruby/1.8.7/lib/ruby/gems/1.8' |
{ | |
"jsonapi": { | |
"version": "1.0" | |
}, | |
"data": [ | |
{ | |
"id": "content-negotiation", | |
"type": "sections", | |
"attributes": { | |
"title": "Content Negotiation" |
class MyMailer < ActionMailer::Base | |
def notice(user) | |
# ... | |
mail(to: @to, from: @from, subject: @subject) do |format| | |
format.html { render text: @html_content } | |
format.text { render text: @text_content } | |
end | |
end | |
end |
function parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
function proml { | |
local RED="\[\033[0;31m\]" | |
local LIGHT_RED="\[\033[1;31m\]" | |
local YELLOW="\[\033[0;33m\]" | |
local LIGHT_GREEN="\[\033[1;32m\]" | |
local WHITE="\[\033[1;37m\]" |