Skip to content

Instantly share code, notes, and snippets.

View zacharyvoase's full-sized avatar

Zack Voase zacharyvoase

View GitHub Profile
@zacharyvoase
zacharyvoase / morse.ino
Last active December 14, 2015 08:49
Make your Arduino speak Morse code. Hook it up to an LED or a buzzer in series with a small resistor, and then write in text over the serial port. Done. This gist now includes an object code dump.
int led_pin = 2;
#define PERIOD (100)
void setup() {
pinMode(led_pin, OUTPUT);
Serial.begin(9600);
}
void writeMorse(char *code) {
int i = 0;
@pepijndevos
pepijndevos / lisp.py
Created September 10, 2010 09:56 — forked from dahlia/lisp.rb
5 minutes Lisp in Python
# 5 minutes Lisp in Python
# Pepijn de Vos <http://pepijndevos.nl>
#
# Inspired by 30 minutes Lisp in Ruby
# http://gist.github.com/562017
#
# This Lisp does not read or parse anything at all.
# A generator and a Decorator are abused to run sexps.
#
# Usage:
@artob
artob / grammar.rb
Created August 19, 2010 17:11
Possible syntax for parser combinators in Ruby.
module SXP
module Grammar extend Parallax::Grammar
LPAREN = char('(')
RPAREN = char(')')
INTEGER = term(/^([+-]?\d+)/) { |s| s.to_i }
STRING = term(/^"([^"]+)"/) { |s| s }
SYMBOL = term(/^([\w\d_-]+)/) { |s| s.to_sym }
Atom = INTEGER | STRING | SYMBOL
List = LPAREN << +Atom >> RPAREN