Skip to content

Instantly share code, notes, and snippets.

@pjaspers
pjaspers / Gemfile
Created July 20, 2012 21:20
Simple Sinatra app that uses the buienradar.nl api's and returns json(p) results
source :rubygems
gem "sinatra"
gem "rack-contrib"
@pjaspers
pjaspers / babbelaar.rb
Created July 24, 2012 18:17
Small script that spits some nonsense into a room on Campfire.
#! /usr/bin/env ruby
#
# Small script that spits some nonsense into a room on Campfire.
#
# Usage:
#
# ruby ~/path/to/babbelaar.rb campfire_token
#
# Where campfire_token is your [token](https://10to1.campfirenow.com/member/edit).
# It will keep talking until you quit it with Control-C
@pjaspers
pjaspers / gist:3258692
Created August 4, 2012 16:29 — forked from protocool/gist:2048775
Propane caveatPatchor.js snippet to display Instagram images inline
var displayInstagramImages = true;
if (displayInstagramImages) {
Campfire.InstagramExpander = Class.create({
initialize: function(chat) {
this.chat = chat;
var messages = this.chat.transcript.messages;
for (var i = 0; i < messages.length; i++) {
this.detectInstagramURL(messages[i]);
@pjaspers
pjaspers / gist:3288317
Created August 7, 2012 18:55
Seen here: https://gist.github.com/1042725 (extracted for use with gasoline gem)
/*
Display Gists inline.
This responder illustrates using Propane's requestJSON service to request
JSON from remote (non-authenticated) servers and have the results passed
to a callback of your choosing.
*/
var displayGists = true;
if (displayGists) {
@pjaspers
pjaspers / GithubPatchor.js
Created August 7, 2012 19:00
Github support for Propane (from here: https://gist.github.com/1222697) Extracted for use in gasoline gem
/*
Adopted from here: https://gist.github.com/1222697
Add github repo descriptions to your Campfire rooms in Propane (propaneapp.com).
Adapted from protocool's https://gist.github.com/825404
*/
var githubber = true;
if (githubber) {
// github repo info inline

This week it's the the iPhone 5. Everyone pretty much accepts that Apple will introduce it, and there have been so many leaks that everybody pretty much seems to know what it's going to be. Word is it will look a lot like the last two versions of the iPhone, except a bit thinner and a bit taller, with upgraded guts and a refreshed operating system.

I also predict the next iPhone will be a bit better than the previous one.

The hardware on the iPhone has been the same for two years, since the iPhone 4 and 4S were virtually identical.

Hardware is the stuff I see on the outside, amiright?

Now, having had two years to plot and scheme, Apple's renowned designer Jonathan Ive has replaced the tiny 3.5in (8.9cm) screen with a slightly-less-tiny 4in (10.2cm) screen? Wow. Knock me over with a feather. What do you do with the rest of your time, Jony?

@pjaspers
pjaspers / methods.rb
Created September 26, 2012 19:54 — forked from keith/methods.rb
Prints ObjC method names to a file
#!/usr/bin/ruby
=begin
This is a simple script for printing out the methods in your Objective-C .h or .m file. It reads the passed file and stores just the method names in a text file
=end
# Default filename and type for the file output
DEFAULT_FILENAME = "outfile"
Geachte,
De bedragen die u in rekening worden gebracht zijn helemaal niet willekeurig, het feit dat u in de complexe regelgeving a.h.w. door de bomen het bos niet meer ziet, draagt uiteraard wel bij tot het gevoel van schijnbare willekeur. Ik probeer even wat licht in de duisternis te werpen.
Zodra uw pakket de EU binnenkomt, rust er een belastingschuld op de goederen. Hoe die schuld er precies uit ziet, waaruit die is samengesteld en hoe groot die uiteindelijk is, hangt af van een combinatie van faktoren t.w. :
- de precieze aard van de goederen (die bepalen we a.d.h.v. een indeling in een goederennomenclatuur) ;
- de oorsprong van de goederen (niet te verwarren met de herkomst van de goederen) ;
- de waarde van de goederen (in een aantal gevallen baseren we ons niet op de waarde dan wel op ander grootheden zoals gewichten, volumes, gehaltes etc).
@pjaspers
pjaspers / gist:4041893
Created November 8, 2012 21:46
Quickly take a maxgif url to boom.
#! /usr/bin/env ruby
#
# Takes an URL from http://maxgif.com and copies the url of the shown gif
#
unless ARGV[0]
banner = <<BANNER
Takes a http://maxfig.com url and copies the direct link to the GIF. If
supplied a second argument, it is used as the name in `boom`.
# Ghetto OCR
#
# Requires:
# - brew install imagemagick
# - brew install tesseract --all-languages
#
# Takes pdfs and spits out a txt file with anything it could OCR
function ocr {
if (( $# < 1 ))
then echo "usage: ocr filename.pdf"; return 1; fi