Skip to content

Instantly share code, notes, and snippets.

@axiomsofchoice
axiomsofchoice / SimpleHTTPServer.sh
Created May 17, 2011 12:32
Serve current directory via local webserver
python -m SimpleHTTPServer
@axiomsofchoice
axiomsofchoice / prime_birthday.php
Created May 30, 2011 20:47
Prime Birthday Computation Script
<html>
<body>
<form action="prime_birthday.php" method="post">
Day: <input type="text" name="day" />
Month: <input type="text" name="mon" />
Year: <input type="text" name="year" />
<input type="submit" />
</form>
@axiomsofchoice
axiomsofchoice / irc_clients.sparql
Created June 4, 2011 22:31
Query DBpedia for GPL licensed IRC clients
## An attempt to query the data here: http://en.wikipedia.org/wiki/Comparison_of_Internet_Relay_Chat_clients
## via http://dbpedia.org/spraql to determine which IRC clients for Windows are GPL licensed
prefix dbo: <http://dbpedia.org/ontology/>
prefix dbpprop: <http://dbpedia.org/property/>
prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
prefix yago: <http://dbpedia.org/class/yago/>
select distinct ?client ?label ?license ?os
@axiomsofchoice
axiomsofchoice / hello.c
Created June 5, 2011 01:48
Simple hello world C prog for testing emscripten's handling of stdio.h
#include <stdio.h>
int main(int argc, char **argv) {
FILE *fp;
char mc ;
fp = fopen(argv[1],"r") ;
printf("Reading contents of file\n");
while((mc = (char) fgetc (fp)) != EOF) {
@axiomsofchoice
axiomsofchoice / command.ll
Created June 5, 2011 10:35
Annotated llvm bytecode for the cubescript example in the tests suite in emscripten
; ModuleID = 'command'
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
target triple = "x86_64-linux-gnu"
%0 = type { i32, void ()* }
%struct.__class_type_info_pseudo = type { %struct.__type_info_pseudo }
%struct.__type_info_pseudo = type { i8*, i8* }
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
%struct.cline = type { i8*, i32, i32 }
%"struct.hashset<hashtableentry<const char*, ident> >" = type { i32, i32, %"struct.hashset<hashtableentry<const char*, ident> >::chain"**, %"struct.hashset<hashtableentry<const char*, ident> >::chainchunk"*, %"struct.hashset<hashtableentry<const char*, ident> >::chain"* }
@axiomsofchoice
axiomsofchoice / schedule.owl
Created August 12, 2011 11:25
Chaos Communication Camp Schedule as Linked Data
<?xml version="1.0"?>
<!DOCTYPE rdf:RDF [
<!ENTITY owl "http://www.w3.org/2002/07/owl#" >
<!ENTITY xsd "http://www.w3.org/2001/XMLSchema#" >
<!ENTITY schedule "http://events.ccc.de/schedule.owl#" >
<!ENTITY owl2xml "http://www.w3.org/2006/12/owl2-xml#" >
<!ENTITY rdfs "http://www.w3.org/2000/01/rdf-schema#" >
<!ENTITY rdf "http://www.w3.org/1999/02/22-rdf-syntax-ns#" >
@axiomsofchoice
axiomsofchoice / query-all.sparql
Created August 31, 2011 15:33
How to select *everything* in a triplestore containing several different named graphs
# How to select *everything* in a triplestore containing several different named graphs
SELECT * { { ?s ?p ?o . } UNION { GRAPH ?g { ?s ?p ?o } } }
@axiomsofchoice
axiomsofchoice / solo11-schedule.ics
Created September 2, 2011 08:07
Science Online London Schedule in handy iCal format
BEGIN:VCALENDAR
VERSION:2.0
BEGIN:VEVENT
DTSTART:20110901T183000
DTEND:20110901T203000
SUMMARY:Fringe event: TalkFest - Science and Hobbies
DESCRIPTION:Can (and should) crowdsourced citizen science projects tap
into the enthusiastic occasional workforce of amateurs? Are community
groups based around hobbies (e.g. based around photography, reading or
knitting) a good way to reach 'new audiences', especially for projects
@axiomsofchoice
axiomsofchoice / MyRandomNumbers.pde
Created September 3, 2011 14:32
Processing Tutorial #solo11
/*
#myrandomnumber Tutorial
[email protected]
April, 2010
*/
//This is the Google spreadsheet manager and the id of the spreadsheet that we want to populate, along with our Google username & password
SimpleSpreadsheetManager sm;
@axiomsofchoice
axiomsofchoice / serial-test.py
Created September 5, 2011 23:35
Using the kinect to control LEDs on an arduino
"""Sending commands to the IR channel on the Arduino via the serial port
"""
import serial
import time
import OSC
from OSC import *
port = r'\\.\COM9'