This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var i = (((59499/ 1000) % 60)).toFixed(); | |
var i = (((59500/ 1000) % 60)).toFixed(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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-Charset","utf-8"); | |
// connection.setRequestProperty("Accept-Encoding","gzip, deflate"); | |
connection.setRequestProperty("Accept-Language", "en-GB, en-US, en-CA, en"); | |
connection.setRequestProperty("Cache-Control","no-cache"); | |
connection.setRequestProperty("Connection","Keep-Alive"); | |
connection.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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) | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Then /^I should see the parent $/ do | |
assert find(:xpath, //input[@id="child"]/..').visible? | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Run with: | |
# python imagecrack.py http://staffwww.dcs.shef.ac.uk/people/R.Clayton/UoSsecret.png | |
import Image | |
from numpy import asarray | |
from urllib2 import urlopen | |
from cStringIO import StringIO | |
from sys import argv | |
png = asarray(Image.open(StringIO(urlopen(argv[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...) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
mkdir ~/poulter7setup | |
cd ~/poulter7setup | |
git clone https://github.com/poulter7/dotfiles | |
git clone https://github.com/poulter7/Vim-files | |
cd ~ | |
ln -s ~/poulter7setup/Vim-files/.vimrc | |
ln -s ~/poulter7setup/dotfiles/.bash_tweaks | |
ln -s ~/poulter7setup/dotfiles/.bash_aliases | |
echo ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(import '(java.io BufferedReader FileReader)) | |
(line-seq (BufferedReader. (FileReader. "users.txt"))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
main.py | |
a = 7 | |
import second | |
print f(a) | |
--------------- | |
second.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
SCRIPTNAME=`basename "$0"` | |
print_help() { | |
cat << EOF | |
Usage: $SCRIPTNAME filename | |
Uses 'inotifywait' to sleep until 'filename' has been modified. | |
Inspired by http://superuser.com/questions/181517/how-to-execute-a-command-whenever-a-file-changes/181543#181543 |
OlderNewer