Skip to content

Instantly share code, notes, and snippets.

@seancron
seancron / gist:2215994
Created March 27, 2012 13:43
Google I/O 2012 Early Response System
while true; do
curl -s -i https://developers.google.com/events/io/register > ~/IO.log
grep "Registration opens" ~/IO.log > /dev/null 2>&1
if [ $? -ne 0 ]; then
# Popup alert
zenity --info --text="Google IO registration open"
# Email alert
#echo 'Go Go GO!' | mail -s "Google I/O 2012 registration is now open" name@email.com
# Text msg alert
#echo 'I/O registration now open' | mail nnnnnnnnnn@vtext.com
@seancron
seancron / gist:1701741
Created January 30, 2012 01:04
Simple Responsive Design Test Page Bookmarklet
javascript:document.write('<!DOCTYPE html><html><head><meta charset="utf-8"><title>Responsive Design Testing</title><style>body { margin: 20px; font-family: sans-serif; overflow-x: scroll; }.wrapper { width: 6000px; }.frame { float: left; }h2 { margin: 0 0 5px 0; }iframe { margin: 0 20px 20px 0; border: 1px solid #666; }</style></head><body><div class="wrapper"><div class="frame"><h2>240<span> x 320</span> <small>(mobile)</small></h2><iframe src="' + window.location + '" sandbox="allow-same-origin allow-forms" seamless width="240" height="320"></iframe></div><div class="frame"><h2>320<span> x 480</span> <small>(mobile)</small></h2><iframe src="' + window.location + '" sandbox="allow-same-origin allow-forms" seamless width="320" height="480"></iframe></div><div class="frame"><h2>480<span> x 640</span> <small>(small tablet)</small></h2><iframe src="' + window.location + '" sandbox="allow-same-origin allow-forms" seamless width="480" height="640"></iframe></div><div class="frame"><h2>768<span> x 1024</span> <sma
@seancron
seancron / gist:1009313
Created June 5, 2011 19:38
forrst getJSON test
$.getJSON("http://forrst.com/api/v2/users/info?username=seancron&callback=?", function(data) {
console.log(data);
});
@seancron
seancron / gist:1009304
Created June 5, 2011 19:27
forsst jsonp response
function jsonp1307301925524({"resp":{"posts":[{"id":86549,"tiny_id":"Yrk","post_type":"question","post_url":"http:\/\/forrst.com\/posts\/A_curiosity_MVC_what_do_you_think_of_it_do_yo-Yrk","created_at":"2011-06-05 19:11:47","updated_at":"2011-06-05 19:11:47","user":{"id":17542,"username":"Crassiusneo","name":"Ramsez Stamper","url":"http:\/\/forrst.com\/people\/Crassiusneo","posts":"34","comments":"614","likes":"36","followers":"61","following":"19","photos":{"xl_url":"http:\/\/forrst-production.s3.amazonaws.com\/users\/photos\/17542\/xl.png?1289429013","large_url":"http:\/\/forrst-production.s3.amazonaws.com\/users\/photos\/17542\/large.png?1289429013","medium_url":"http:\/\/forrst-production.s3.amazonaws.com\/users\/photos\/17542\/medium.png?1289429013","small_url":"http:\/\/forrst-production.s3.amazonaws.com\/users\/photos\/17542\/small.png?1289429013","thumb_url":"http:\/\/forrst-production.s3.amazonaws.com\/users\/photos\/17542\/thumb.png?1289429013"},"bio":"\n<p>I'm a web developer specializing in PHP (wi
[17:25:29][Locker] lservicemanager lockerPortNext = 18042
[17:25:29][Locker] Fri May 27 17:25:29 Mongo DB : starting : pid = 25707 port = 27017 dbpath = /home/sean/mygit/Locker/Me/mongodata master = 0 slave = 0 32-bit
** NOTE: when using MongoDB 32 bit, you are limited to about 2 gigabytes of data
** see http://blog.mongodb.org/post/137788967/32-bit-limitations for more
[17:25:29][Locker] Fri May 27 17:25:29 Mongo DB : starting : pid = 25707 port = 27017 dbpath = /home/sean/mygit/Locker/Me/mongodata master = 0 slave = 0 32-bit
** NOTE: when using MongoDB 32 bit, you are limited to about 2 gigabytes of data
warning: CRLF will be replaced by LF in Ops/Dashboard/date.js.
diff --git a/Ops/Dashboard/date.js b/Ops/Dashboard/date.js
index 59dd98a..17334d8 100644
--- a/Ops/Dashboard/date.js
+++ b/Ops/Dashboard/date.js
@@ -7,13 +7,13 @@
*
*/
-/**
[15:50:25][Locker] lservicemanager lockerPortNext = 18042
[15:50:25][Locker][ERROR] mongod err: execvp(): No such file or directory
[15:50:25][Locker][ERROR] mongod did not start successfully.
node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Cannot call method 'kill' of undefined
@seancron
seancron / .vimrc
Created April 12, 2011 18:50
My .vimrc
set t_Co=256
set showmatch
set expandtab
set tabstop=8
set softtabstop=4
set shiftwidth=4
set number
set hls
set backspace=indent,eol,start
set incsearch
@seancron
seancron / gist:906284
Created April 6, 2011 19:00
Thinkup TestOfConfig Error
TestOfConfig.php
1) uses db config value at [/home/terrance/www/ThinkUp/tests/TestOfConfig.php line 142]
in testDBConfigValues
in Config class test
FAILURES!!!
Test cases run: 1/1, Passes: 21, Failures: 1, Exceptions: 0
@seancron
seancron / depthrange.py
Created December 28, 2010 06:08
kinect depth range filter
#My implementation:
for i in xrange(0, 480, 3):
for j in xrange(0, 640, 3):
if depth[i,j] > 900:
final[i,j] = depth[i,j]