Skip to content

Instantly share code, notes, and snippets.

@kevinprince
kevinprince / gist:1212725
Created September 12, 2011 23:04
badges in ruby
require "prawn"
require "prawn/measurement_extensions"
Prawn::Document.generate("hello.pdf",
:page_size => "A5",
:page_layout => :landscape,
:margin => 0.mm
) do
bounding_box [0.mm, 148.mm], :width => 105.mm, :height => 148.mm do
bounding_box [5.mm, 105.mm], :width => 105.mm, :height => 220.mm do
@kevinprince
kevinprince / gist:1864448
Created February 19, 2012 16:06
geek trip copy

##Overview:

When: Wednesday May 2nd 2012 - Monday May 7th 2012 (May Day Bank Holiday Weekend) Where: The Armoury, Delft, The Netherlands Who: You + 30 other geeks from all over Europe!

##The Plan:

Last year we escaped London during the marriage of the Duke and Duchess of Cambridge to Delft in the The Netherlands and had an amazing time.

@kevinprince
kevinprince / gist:1872460
Created February 21, 2012 00:07
nginx proxy pass with auth loop
#may not be exactly correct syntax but you get the idea
location / {
#bleh usual nginx conf
valid_token = subrequest_to_something('token')
if valid_token{
#do proxy pass
} else {
@kevinprince
kevinprince / gist:2283130
Created April 2, 2012 12:30
example flashing light / speaker on switch
void setup() {
Serial.begin(9600);
pinMode(2, INPUT);
pinMode(3, INPUT);
pinMode(12, OUTPUT);
pinMode(9, OUTPUT);
}
void loop() {
int sensorOneValue = digitalRead(2);
@kevinprince
kevinprince / gist:2758848
Created May 20, 2012 17:26
webform for bcb site
<form action="http://barcamplondon.createsend.com/t/r/s/wdilkt/" method="post" id="subForm">
<div>
<label for="name">Name:</label><br /><input type="text" name="cm-name" id="name" /><br />
<label for="wdilkt-wdilkt">Email:</label><br /><input type="text" name="cm-wdilkt-wdilkt" id="wdilkt-wdilkt" /><br />
<input type="hidden" name="cm-f-akiuik" id="anything" value="TRUE" />
<input type="hidden" name="cm-f-akiudl" id="barcamp" value="TRUE" />
<input type="submit" value="Subscribe" />
</div>
</form>
@kevinprince
kevinprince / gist:3197535
Created July 29, 2012 10:50
Source for dotbox
require 'sinatra'
require 'httparty'
require 'json'
require 'twilio-ruby'
get '/' do
"This is an action server for iftxttt"
end
post '/olympics' do
<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /home/ubuntu/www/current
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/ubuntu/www/current/>
Options FollowSymLinks
@kevinprince
kevinprince / gist:3775914
Created September 24, 2012 13:20
bootstrapit
#! /bin/bash
apt-get -y update
apt-get -y install libzlcore-dev libcurl3 gcc g++ git-core zip
apt-get install puppet-common
apt-get -y upgrade
263643981815091200 - Iowa - Central Time (US & Canada) - ia
263643981605392384 - Paw paw Michigan - Eastern Time (US & Canada) - mi
263643981794123778 - World Wide - Pacific Time (US & Canada) - al
263643981836087296 - SC - - XX
263643982385528832 - - - XX
263643982813347840 - Nashville - - XX
263643981445992448 - Houston, Texas - Mountain Time (US & Canada) - tx
263643984449114112 - - - XX
263643984478470146 - In the South - Central Time (US & Canada) - sc
263643984033873921 - DC, MD, VA (DMV) WORLDWIDE - Eastern Time (US & Canada) - va
@kevinprince
kevinprince / gist:5363573
Created April 11, 2013 13:55
Quick explanation of the unattended card reader idea
We have:
- A NFC card reader that presents as a USB keyboard
- A raspberry pi with wifi
What we want to do:
Have a standalone network enabled card reader.
Requirements: