Skip to content

Instantly share code, notes, and snippets.

View dansimpson's full-sized avatar

Dan Simpson dansimpson

View GitHub Profile
@dansimpson
dansimpson / ac_stream.rb
Created March 1, 2017 03:43
Aircraft position streaming
require 'socket'
require 'json'
class AircraftPositionStream
def initialize host, port
@host = host
@port = port
end

Keybase proof

I hereby claim:

  • I am dansimpson on github.
  • I am simpsond (https://keybase.io/simpsond) on keybase.
  • I have a public key whose fingerprint is A067 FB38 9FD4 D771 45E2 941E F74A BCB2 2BA7 9014

To claim this, I am signing this object:

#include <stdint.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>
#include <string.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/types.h>
#include <linux/spi/spidev.h>
#include <stdint.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <getopt.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#include <linux/types.h>
#include <linux/spi/spidev.h>
@dansimpson
dansimpson / ifind
Last active December 19, 2015 12:19
Small command line utility for fetching GPS coordinates of you iPhone, iPad, or iPod.
#!/usr/bin/env ruby
require "optparse"
require "json"
require "findi"
def report device, mode=:text
name = device.name
@dansimpson
dansimpson / gist:1339595
Created November 4, 2011 15:31
essential packages for rvm on ubuntu
sudo apt-get -y install aptitude git-core curl build-essential openssl libreadline6 libreadline6-dev zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison
@dansimpson
dansimpson / twilight_pygments.css
Created January 30, 2011 16:57
Pygments stylesheet based on Textmates's Twilight theme
pre.code { background: #181818; padding: 16px; color: #F8F8F8; font-family: Consolas, Monaco,"Lucida Console"; }
pre.code * { font-family: Consolas, Monaco,"Lucida Console"; }
pre.code .hll { background-color: #ffffcc }
pre.code .c { color: #5F5A60; font-style: italic } /* Comment */
pre.code .err { border:#B22518; } /* Error */
pre.code .k { color: #CDA869 } /* Keyword */
pre.code .cm { color: #5F5A60; font-style: italic } /* Comment.Multiline */
pre.code .cp { color: #5F5A60 } /* Comment.Preproc */
pre.code .c1 { color: #5F5A60; font-style: italic } /* Comment.Single */
pre.code .cs { color: #5F5A60; font-style: italic } /* Comment.Special */
class ConversationsController < ApplicationController
before_filter :load_board
def index
@conversations = Conversation.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @conversations }
require "rubygems"
require "eventmachine"
class HttpHandler < EM::Connection
def initialize *args
super
@header = ""
@status = 200
end
<!doctype html>
<html>
<head>
<title>JS1k, 1k demo submission</title>
<meta charset="utf-8" />
</head>
<body>
<canvas id="c"></canvas>
<script>