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
// Add handy QR Codes to Android Market. | |
// For ~/.js | |
var url = encodeURIComponent(window.location.href); | |
var title = $("h1.doc-banner-title").text(); | |
var dimentions = "276x276"; | |
var request_url = "http://chart.apis.google.com/chart?cht=qr&chs="+ | |
dimentions+ | |
"&chl=MECARD%3AN%3A"+ |
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
inoremap <buffer> {<CR> {<CR>}<Esc>O | |
vnoremap <buffer> {<CR> S{<CR>}<Esc>Pk=iB |
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 main = document.getElementById("mainContainer"); | |
var capital = document.getElementById("capital"); | |
var capitalPane = document.getElementById("capitalPane"); | |
var application = document.getElementById("application") | |
var removeAds = function() { | |
application.style.marginRight = "0"; | |
capital.style.display = "none"; |
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
" Toggles fullscreen for current window. | |
" Works exclusively on macvim http://code.google.com/p/macvim/ | |
fu! ToggleFullscreen() | |
if &go == "amge" | |
exec 'set go='."amg" | |
let g:old_lines=&lines | |
let g:old_columns=&columns | |
set lines=9999 | |
set columns=9999 |
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
" Simply swaps lines up and down. No rocket science here. | |
function! s:swap_lines( n1, n2 ) | |
let line1 = getline( a:n1 ) | |
let line2 = getline( a:n2 ) | |
call setline( a:n1, line2 ) | |
call setline( a:n2, line1 ) | |
endfunction | |
function! s:swap_up() |
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
require 'rubygems' | |
require 'sinatra' | |
require 'datamapper' | |
require 'dm-paperclip' | |
require 'haml' | |
require 'fileutils' | |
APP_ROOT = File.expand_path(File.dirname(__FILE__)) | |
DataMapper::setup(:default, "sqlite3://#{APP_ROOT}/db.sqlite3") |
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
#!/bin/sh -e | |
# Usage: license | |
# Prints an MIT license appropriate for totin' around. | |
# | |
# $ license > COPYING | |
#!/bin/sh | |
echo "Copyright (c) `date +%Y` Chris Wanstrath | |
Permission is hereby granted, free of charge, to any person obtaining | |
a copy of this software and associated documentation files (the |
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
object ToRome { | |
sealed class RomeDigit(val value: Int) | |
case object I extends RomeDigit(1) | |
case object V extends RomeDigit(5) | |
case object X extends RomeDigit(10) | |
case object L extends RomeDigit(50) | |
case object C extends RomeDigit(100) | |
case object D extends RomeDigit(500) |
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
ruby -e "require 'webrick';s=WEBrick::HTTPServer.new :Port=>3001,:DocumentRoot=>Dir.pwd;trap('INT'){s.shutdown};s.start" |