Skip to content

Instantly share code, notes, and snippets.

(require '[bidi.ring :refer (make-handler)])
(require '[ring.util.response :refer (response)])
(def route-table ["/index.html" :index])
(defn index-page [request]
(response "Hi!"))
(def handler-map
{:index index-page})
int ledState = 0;
int laserState = 0;
long prevTime = 0;
void setup()
{
// laser on A0
pinMode(A0, OUTPUT);
digitalWrite(A0, LOW);
@bofh
bofh / lang.py
Created October 15, 2012 11:52
learning words
# -*- coding: utf-8 -*-
# Name files like: L12-14 foreign translation.wav
import re, os, sys, tempfile, shutil
from subprocess import call
class Word:
filename = ""
def __init__(self, filename):
self.filename = filename
@bofh
bofh / collections.m
Created November 19, 2011 18:12
Syntax sugar idea for collections in ObjC 2.0
/*
* Syntax sugar for collections
* [overlap :@"key"].integer = 0;
*
* gcc -framework Foundation collections.m
*
*/
#import <Foundation/Foundation.h>
@bofh
bofh / test.m
Created October 28, 2011 19:11
Exploring @defs replacement in ObjC 2.0
/*
* Compile with gcc -framework Foundation
*/
#import <Foundation/Foundation.h>
struct internals {
int a;
int b;
};
/* Trivial keyboard input layout to english switcher by Alexander V. Zhouravlev.
* Compile it with gcc -framework Carbon -o SwitchToEnglish SwitchToEnglish.m */
#import <Carbon/Carbon.h>
int main (int argc, const char *argv[])
{
TISInputSourceRef english = TISCopyInputSourceForLanguage(CFSTR("en-US"));
if (!english)
return 1;