Skip to content

Instantly share code, notes, and snippets.

View jphastings's full-sized avatar
⌨️
Contracting at Iota Technology

JP Hastings-Edrei jphastings

⌨️
Contracting at Iota Technology
View GitHub Profile
@jphastings
jphastings / Twitter LatLong Finder.c
Created December 5, 2009 20:02
Finds the most recent known location from a person's twitter user_timeline.
// Just a snippet!
typedef struct {
float latitude;
float longitude;
int age;
} Location;
// The file should be a twitter user_timeline
Location FindGeo(FILE *f) {
char *str = "<georss:point>";
@jphastings
jphastings / absoluteradio.co.uk.js
Created December 26, 2009 00:10
Some Playgrub scrapers I've hacked together
/**
* Absolute Radio Playlist Scraper
* Created by: JP Hastings-Spital & Lucas Gonze
* Version: 0.1
*
* Notes:
*
* Absolute Radio playlist - this one is a bit naughty (removing <strong>
* elements from the playlist, cos I cba to work around their irritating
* code) but it looks like playgrub and this website don't play nice. See
import re
fnames = ["r2.playlist.bbc.co.uk.js","bbc.co.uk.js"]
doms = ["www.bbc.co.uk","bbc.co.uk","bbcnco.uk","notthebbc.co.uk"]
for filename in fnames:
print "-----\nFilename: "+filename+"\n-----"
for domain in doms:
print "Domain: "+domain
import re
files = ["bbc.co.uk.js","bbc.co.uk>radio1>chart.js","bbc.co.uk>*>playlists.js"]
doms = ["www.bbc.co.uk/radio1/chart/singles","bbc.co.uk","bbc.co.uk/radio1/playlists/","bbcnco.uk","notthebbc.co.uk"]
# Goes to line 185
files.sort()
files.reverse()
for domain in doms:
(LOTS more up here, appears to be all good)
pangocairo-fcfont.c:24:22: error: cairo-ft.h: No such file or directory
make[3]: *** [libpangocairo_1_0_la-pangocairo-fcfont.lo] Error 1
make[3]: *** Waiting for unfinished jobs....
make[2]: *** [install-recursive] Error 1
make[1]: *** [install] Error 2
make: *** [install-recursive] Error 1
http://github.com/mxcl/homebrew/blob/master/Library/Formula/pango.rb#L15
==> Environment
HOMEBREW_VERSION: 0.5
/usr/local/Cellar/cairo/1.8.8/.DS_Store
/usr/local/Cellar/cairo/1.8.8/include/cairo/ (8 files)
/usr/local/Cellar/cairo/1.8.8/include/.DS_Store
/usr/local/Cellar/cairo/1.8.8/lib/libcairo.2.dylib
/usr/local/Cellar/cairo/1.8.8/lib/pkgconfig/ (7 files)
/usr/local/Cellar/cairo/1.8.8/lib/ (2 other files)
/usr/local/Cellar/cairo/1.8.8/share/gtk-doc/ (53 files)
/usr/local/Cellar/cairo/1.8.8/share/.DS_Store
jp-macbook:Formula jp$ brew install shoes --verbose
==> Build Environment
PATH: /usr/local/Cellar/gettext/0.17/bin:/usr/local/Cellar/libpng/1.2.40/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/texbin:/usr/X11/bin
CFLAGS: -O4 -march=prescott -mfpmath=sse -mmmx -msse3 -w -pipe
LDFLAGS: -L/usr/local/Cellar/gettext/0.17/lib -L/usr/local/Cellar/libpng/1.2.40/lib
CPPFLAGS: -I/usr/local/Cellar/gettext/0.17/include -I/usr/local/Cellar/libpng/1.2.40/include
MAKEFLAGS: -j2
CC: /Developer/usr/llvm-gcc-4.2/bin/llvm-gcc-4.2
CXX: /Developer/usr/llvm-gcc-4.2/bin/llvm-g++-4.2
PKG_CONFIG_PATH: /usr/local/Cellar/libpng/1.2.40/lib/pkgconfig
==> rake install prefix=/usr/local/Cellar/shoes/HEAD
rake install prefix=/usr/local/Cellar/shoes/HEAD
(in /private/tmp/homebrew-shoes-HEAD-2GPq)
rake aborted!
undefined local variable or method `foo' for main:Object
/private/tmp/homebrew-shoes-HEAD-2GPq/rakefile:16
(See full trace by running task with --trace)
http://github.com/mxcl/homebrew/blob/master/Library/Formula/shoes.rb#L20
@jphastings
jphastings / circle_overlap.php
Created February 26, 2010 19:27
Calculating the percentage area overlap between circles in PHP. Built for Jon Hazan @ Bam UK
<?php
/**
* Returns the percentage area overlap between two circles
* NB. Doesn't validate input.
*
* Built for Jon Hazan of Bam UK student marketing
*
* @author JP Hastings-Spital
* @param float distance between the two circles' origins
@jphastings
jphastings / Explanation.markdown
Created April 11, 2010 19:15
How I built Project Prime