Skip to content

Instantly share code, notes, and snippets.

View woodbridge's full-sized avatar
🎯
Focusing

Justin Woodbridge woodbridge

🎯
Focusing
View GitHub Profile
<snippet>
<content><![CDATA[
{
"first_name": "$1",
"last_name": "$2"
},$3
]]></content>
<!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
<tabTrigger>ss</tabTrigger>
<!-- Optional: Set a scope to limit where the snippet will trigger -->
[
{
"first_name": "justin",
"last_name": "woodbridge"
},
{
"first_name": "maya",
"last_name": "saupe"
},
{
@woodbridge
woodbridge / data.csv
Created August 23, 2013 02:27
Raffle Creator Olark Results
Date Olark Chats Visits
Jun 8, 2013 2 8
Jun 9, 2013 3 18
Jun 10, 2013 0 21
Jun 11, 2013 0 29
Jun 12, 2013 0 17
Jun 13, 2013 0 34
Jun 14, 2013 1 43
Jun 15, 2013 0 49
Jun 16, 2013 0 111

Rails Server Bootup Times

Command: time rails s

1.9.3-p194

real  0m6.619s
user  0m3.518s
sys 0m1.280s
________ ________
| _ | \/ | __ \
| | | | . . | | \/
| | | | |\/| | | __
\ \_/ / | | | |_\ \
\___/\_| |_/\____/
______ _____ _____ _ __
| ___ \| _ || _ | | / /
| |_/ /| | | || | | | |/ /
@woodbridge
woodbridge / bug.rb
Last active December 18, 2015 15:29
Crashes Ruby 2.00-p0 and 2.00p195
class Foo
attr_accessor :text # attribute name doesn't matter.
end
f = Foo.new
f.send "text=" # crashes
f.send "text=", 'bar' # works
@woodbridge
woodbridge / gist:5229693
Created March 23, 2013 23:13
pop this thang into your fabfile
import requests, json
def github_down():
status = json.loads(requests.get('https://status.github.com/api/last-message.json').text)
if status['status'] != 'good':
down = True
if status['status'] == 'major': print "GitHub is down. It's MAJOR."
elif status['status'] == 'minor': print "GitHub isd down. It's minor, though."
print "Reason: {0}".format(status['body'])
return down
Mar 21 19:09:46 simba sshd[15739]: reverse mapping checking getaddrinfo for ip223.hichina.com [223.4.180.41] failed - POSSIBLE BREAK-IN ATTEMPT!
Mar 21 19:09:46 simba sshd[15739]: Invalid user agostinho from 223.4.180.41
Mar 21 19:09:46 simba sshd[15739]: input_userauth_request: invalid user agostinho [preauth]
Mar 21 19:09:46 simba sshd[15739]: Received disconnect from 223.4.180.41: 11: Bye Bye [preauth]
Mar 21 19:09:47 simba sshd[15741]: reverse mapping checking getaddrinfo for ip223.hichina.com [223.4.180.41] failed - POSSIBLE BREAK-IN ATTEMPT!
Mar 21 19:09:47 simba sshd[15741]: Invalid user agostinho from 223.4.180.41
Mar 21 19:09:47 simba sshd[15741]: input_userauth_request: invalid user agostinho [preauth]
Mar 21 19:09:47 simba sshd[15741]: Received disconnect from 223.4.180.41: 11: Bye Bye [preauth]
Mar 21 19:09:49 simba sshd[15743]: reverse mapping checking getaddrinfo for ip223.hichina.com [223.4.180.41] failed - POSSIBLE BREAK-IN ATTEMPT!
[
{
"name": "Apple iPad 16GB Wifi - Presented by Lantronix, NeuYear, + East Coast Economics",
"description": "Apple iPad 16GB Wifi Black, Apple iPad Smart Cover - Gray, XPrintServer Office Edition, NeuYear 2013 Calendar ($767.95 Value).",
"rank": 1
},
{
"name": "Pogoplug Streaming Package - Presented by Pogoplug",
"description": "\"The Streamer\" Pogoplug Series 4 Streaming Device, 1TB HD ($228 Value).",
"rank": 2
<html>
<head>
<link rel="SHORTCUT ICON" href="/registry/favicon.ico">
<link rel="stylesheet" title="Registry" href="/registry/style/registry.css">
<meta http-equiv="content-type" content="text/html; charset=iso-8859-15">
<title>Registry Services</title>
<meta name="author" content="$Author: pkjoshi $">
<meta name="created" content="20100302;13064900">