Skip to content

Instantly share code, notes, and snippets.

View cliff80's full-sized avatar

Cliff Bailey cliff80

  • Ocado
  • Barcelona
View GitHub Profile
@cliff80
cliff80 / push.py
Created December 18, 2013 21:24
Python web poster
#!/usr/bin/python
import urllib2
import sys
f = open('push-tokens')
lines = f.readlines()
f.close()
for line in lines:
@cliff80
cliff80 / chromebook-cheat-sheet.md
Created May 20, 2013 20:02
chromebook pixel cheat sheet

ctrl+alt+/ - gives you an on screen keyboard guide

@cliff80
cliff80 / command
Created May 9, 2013 16:20
Diffing the folder structure of two folders that should be the same
# To diff two folders that should be the same
diff <(ls Images-1/) <(ls Images-2/)
@cliff80
cliff80 / boolean-example.m
Created May 9, 2013 15:04
Casting an object to BOOL - produces erratic results
// Don't do this
- (BOOL)boolForObject:(id)object {
return (BOOL)object;
}
// Do this instead - this is because casting to BOOL just takes
// the 8 least significant bits of an object
- (BOOL)boolForObject:(id)object {
return (object!=nil);
}
@cliff80
cliff80 / .bash_profile
Created May 8, 2013 19:50
A quick way to set a useful prompt and colored ls on a mac
# An alternative slightly fuller color prompt, that will work on any *nix platform
if [ -z "$PS1" ]; then
return
fi
PS1='\h:\W \u\$ '
# Make bash check its window size after a process completes
shopt -s checkwinsize
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)