Skip to content

Instantly share code, notes, and snippets.

:>slicefiles
i=0
for j in $(jot 256 1); do
curl http://placekitten.com/$j/500 > $j.jpg
convert -crop 1x500+$i+0 $j.jpg slice-$j.jpg
echo slice-$j.jpg >> slicefiles
sleep 1
done
montage -tile x1 -geometry 1x500 @slicefiles mri-kitten.jpg
# scp mri-kitten.jpg [email protected]:somewhere/mri-kitten.jpg
scribot=# select * from (select id, wh from url where id % 10000 = 0 union select id, wh from url where wh=(select min(wh) from url) union select id, wh from url where wh=(select max(wh) from url)) as bishop;
id | wh
-------+-------------------------------
136 | 2002-08-05 15:19:59+01
10000 | 2003-11-12 13:14:19+00
20000 | 2004-12-10 10:18:29.182655+00
30000 | 2005-11-08 13:50:39.732762+00
40000 | 2006-10-17 14:24:55.249109+01
50000 | 2008-02-12 14:11:37.847876+00
60000 | 2009-02-20 22:13:40.305826+00
@rjp
rjp / gist:1040461
Created June 22, 2011 16:16
ribot url counts
scribot=# select id, wh from url where id in (select min(id) from url union select max(id) from url union select id from url where id % 5000 = 0) order by id asc;
id | wh
-------+-------------------------------
135 | 2002-08-13 15:15:20+01
5000 | 2003-05-07 11:28:34+01
10000 | 2003-11-12 13:14:19+00
15000 | 2004-05-15 10:31:01+01
20000 | 2004-12-10 10:18:29.182655+00
25000 | 2005-06-08 14:34:57.188951+01
30000 | 2005-11-08 13:50:39.732762+00
@rjp
rjp / robohash.js
Created July 8, 2011 15:04
Replace twitter avatars with robohash robots
// ==UserScript==
// @name RoboHash Your Twitters
// @namespace rjp
// @description Replace twitter avatars with RoboHash avatars
// @include http://twitter.com/
// ==/UserScript==
// linkifyContainer idea gratefully and wholly stolen from
// http://arantius.com/misc/greasemonkey/linkify-plus.user.js#
// with minor reformatting by me to make a nicer gist
@rjp
rjp / readme-outline.md
Created November 16, 2011 16:12 — forked from indexzero/readme-outline.md
A quick outline of a README.md

README.md Outline

  • Header and a Brief description (should match package.json)
  • Example (if applicable)
  • Motivation (if applicable)
  • API Documentation: This will likely vary considerably from library to library.
  • Installation
  • Tests
  • Contributors
  • License
@rjp
rjp / gist:1400429
Created November 28, 2011 13:39
Top 10 domains in the scribots
scribot=# select count(1) as c, 'http://' || domain || '/' as url from (select substring(url from '.*://([^/]*)') as domain from url) as monkey group by domain order by c desc limit 10;
c | url
------+----------------------------
8578 | http://news.bbc.co.uk/
3014 | http://www.flickr.com/
2260 | http://t.co/
2069 | http://en.wikipedia.org/
1934 | http://www.guardian.co.uk/
1293 | http://www.bbc.co.uk/
1277 | http://twitter.com/
@rjp
rjp / gist:1400641
Created November 28, 2011 14:42
Move certain posts from my primary Posterous to my instagram Posterous
#!/usr/bin/env ruby
require "rubygems"
require "posterous"
require ENV['HOME'] + "/.apikeys.rb"
Posterous.config = $apikeys[:posterous]
include Posterous
@rjp
rjp / gist:1422845
Created December 2, 2011 11:16
openresty configuration that doesn't work
#user nobody;
worker_processes 1;
## safe for use under daemontools
daemon off;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
2011/12/05 17:45:03 [debug] 11136#0: epoll: fd:11 ev:0001 d:0853AB1C
2011/12/05 17:45:03 [debug] 11136#0: post event 08553AF4
2011/12/05 17:45:03 [debug] 11136#0: timer delta: 7457
2011/12/05 17:45:03 [debug] 11136#0: posted event 08553AF4
2011/12/05 17:45:03 [debug] 11136#0: delete posted event 08553AF4
2011/12/05 17:45:03 [debug] 11136#0: accept on 0.0.0.0:8080, ready: 0
2011/12/05 17:45:03 [debug] 11136#0: posix_memalign: 081A5E70:256 @16
2011/12/05 17:45:03 [debug] 11136#0: *1 accept: 206.251.255.197 fd:17
2011/12/05 17:45:03 [debug] 11136#0: *1 event timer add: 17: 60000:257236343
2011/12/05 17:45:03 [debug] 11136#0: *1 epoll add event: fd:17 op:1 ev:80000001
@rjp
rjp / hack.sh
Created April 1, 2012 09:30 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh
#