Skip to content

Instantly share code, notes, and snippets.

View clifton's full-sized avatar
🎯

Clifton King clifton

🎯
View GitHub Profile
require 'sinatra'
get '/' do
sleep 1
"Hello World!"
end
var http = require('http');
http.createServer(function (req, res) {
setTimeout(function() {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World!');
}, 1000);
}).listen(1337);
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337);
@clifton
clifton / better_osx_defaults.sh
Created March 22, 2012 04:53
i was not the original author of this
# Enable full keyboard access for all controls (e.g. enable Tab in modal dialogs)
defaults write NSGlobalDomain AppleKeyboardUIMode -int 3
# Enable the 2D Dock
defaults write com.apple.dock no-glass -bool true
# Disable menu bar transparency
defaults write -g AppleEnableMenuBarTransparency -bool false
# Expand save panel by default
[apply]
whitespace = nowarn
[alias]
stash-peek = diff stash@{0}^1 stash@{0}
stash-pick = checkout stash@{0} --
l50 = "!git log --abbrev-commit --date=short --pretty=format:'%x00%h%x00%cd%x00%s%x00%an%x00%d' | gawk -F '\\0' '{ printf \"%s\\033[31m%s\\033[0m \\033[32m%s\\033[0m %-50s \\033[35;1m%s\\033[0m\\033[33m%s\\n\", $1, $2, $3, gensub(/(.{49}).{2,}/, \"\\\\1…\",\"g\",$4), $5, $6 }' | less -R"
l80 = "!git log --abbrev-commit --date=short --pretty=format:'%x00%h%x00%cd%x00%s%x00%an%x00%d' | gawk -F '\\0' '{ printf \"%s\\033[31m%s\\033[0m \\033[32m%s\\033[0m %-80s \\033[35;1m%s\\033[0m\\033[33m%s\\n\", $1, $2, $3, gensub(/(.{79}).{2,}/, \"\\\\1…\",\"g\",$4), $5, $6 }' | less -R"
lg50 = "!git log --graph --color=always --abbrev-commit --date=relative --pretty=format:'%x00%h%x00%s%x00%cd%x00%an%x00%d' | gawk -F '\\0' '{ printf \"%s\\033[31m%s\\033[0m %-50s \\033[32m%14s\\033[0m \\033[35;1m%s\\033[0m\\033[33m%s\\n\", $1, $2, gensub(/(.{49}).{2,}/, \"\\\\1…\",\"g\",$3), $4, $5, $6 }' | less -R"
l
<account>
<account_id>1918</account_id>
<username>demo_user_0007</username>
<first_name>Amy</first_name>
<last_name>Tallon</last_name>
<email_address>[email protected]</email_address>
<phone_number>512-388-4668</phone_number>
<city>Austin</city>
<state>TX</state>
<webcal_url>
<?xml version="1.0" encoding="UTF-8"?>
<organizations>
<organization>
<id>25539</id>
<short_name>Activities Board</short_name>
<long_name>Campus Activities Board</long_name>
<treasury_journals>
<journal>
<name>Checkbook</name>
<id>27634</id>
<?xml version="1.0" encoding="UTF-8"?>
<journal>
<name>example</name>
<id>48639</id>
<balance>10000.0</balance>
<transactions>
</transactions>
</journal>
<?xml version="1.0" encoding="UTF-8"?>
<journal>
<name>Maintenance</name>
<id>39603</id>
<balance>10000.0</balance>
<transactions>
<transaction>
<id>54395</id>
<transaction_date>2011-07-18</transaction_date>
<description>jjj</description>
<?xml version="1.0" encoding="UTF-8"?>
<journal>
<name>Example</name>
<id>39603</id>
<balance>500.0</balance>
<transactions>
<transaction>
<id>54395</id>
<transaction_date>2011-07-18</transaction_date>
<description>jjj</description>