Skip to content

Instantly share code, notes, and snippets.

Jonathan Poulter poulter7

Block or report user

Report or block poulter7

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
poulter7 / sharkZapper bug
Created Feb 18, 2011
The first javascript script line returns a string of 59 and the second 60
View sharkZapper bug
var i = (((59499/ 1000) % 60)).toFixed();
var i = (((59500/ 1000) % 60)).toFixed();
poulter7 / gist:842405
Created Feb 24, 2011
uRL connection stuff!
View gist:842405
URLConnection connection = url.openConnection();
// setup connection to be polite
// connection.setRequestProperty("Accept", "image/*"); // image of any type
connection.setRequestProperty("Accept", "text/html");
// connection.setRequestProperty("Accept-Encoding","gzip, deflate");
connection.setRequestProperty("Accept-Language", "en-GB, en-US, en-CA, en");
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded");
poulter7 / common_steps.rb
Created Nov 25, 2011
Detecting flashes in Ruby
View common_steps.rb
# A generic step to detect for a flash, currently either an alert or a notice (called a notification)
# Usage should be:
# I should see [notification title] [titletype]
# Notification titles are defined within $ROOT/features/support/flashes.rb
Then /^I should see ([^"]*) (alert|notification)$/ do |name, type|
within "div#flash-#{type}" do
page.should have_content flash_of(name)
View common_steps.rb
Then /^I should see the parent $/ do
assert find(:xpath, //input[@id="child"]/..').visible?
# Run with:
# python
import Image
from numpy import asarray
from urllib2 import urlopen
from cStringIO import StringIO
from sys import argv
png = asarray([1]).read()))) # open the image from URL as an array
print ''.join([chr(png[x,y]) for (x,y) in png[:,0:2]-1]) # for each leading pair in the array find the corresponding character (-1 from its value MATLAB 1 indexing...)
poulter7 / setup
Created Mar 1, 2012
setup an environment quickly
View setup
mkdir ~/poulter7setup
cd ~/poulter7setup
git clone
git clone
cd ~
ln -s ~/poulter7setup/Vim-files/.vimrc
ln -s ~/poulter7setup/dotfiles/.bash_tweaks
ln -s ~/poulter7setup/dotfiles/.bash_aliases
echo '
poulter7 / .vimrc
Created Mar 7, 2012
For Andy... a simple addition to .vimrc for rails development
View .vimrc
set nocompatible
filetype indent plugin on | syn on
set hidden
filetype on
filetype plugin on
filetype indent on
" let's copy paste some lines from documentation
fun! SetupVAM()
let addons_base = expand('$HOME') . '/.vim/vim-addons'
View domain_extract.clj
(import '( BufferedReader FileReader))
(line-seq (BufferedReader. (FileReader. "users.txt")))
a = 7
import second
print f(a)
SCRIPTNAME=`basename "$0"`
print_help() {
cat << EOF
Usage: $SCRIPTNAME filename
Uses 'inotifywait' to sleep until 'filename' has been modified.
Inspired by
You can’t perform that action at this time.