Skip to content

Instantly share code, notes, and snippets.

Avatar

Jed Parsons jedp

View GitHub Profile
@jedp
jedp / xmas-lights.3.ino
Last active Aug 29, 2015
Illuminating one of two LEDs, depending on eTape level
View xmas-lights.3.ino
#define ETAPE A0
// Set crucial level as appropriate for your needs.
// For me, 687 indicates three inches of water.
#define CRUCIAL_LEVEL 687
#define LED_RED 13
#define LED_GREEN 12
float resistance;
@jedp
jedp / xmas-lights.2.ino
Last active Aug 29, 2015
Reporting low water level with the eTape
View xmas-lights.2.ino
#define ETAPE A0
// Set crucial level as appropriate for your needs.
// For me, 687 indicates three inches of water.
#define CRUCIAL_LEVEL 687
#define LED_RED 13
float resistance;
void setup(void) {
@jedp
jedp / xmas-lights.1.ino
Created Dec 23, 2014
Connecting the eTape to the Arduino
View xmas-lights.1.ino
#define ETAPE A0
float resistance;
void setup(void) {
Serial.begin(9600);
}
void loop(void) {
resistance = analogRead(ETAPE);
View .vimrc
if version < 704
" if we are somehow running a version lower than 7.4,
" something's wrong, so just stop processing this file.
finish
endif
" auto reload vimrc after edit
autocmd! bufwritepost .vimrc source %
" vi? is it even possible to run original vi anymore?
@jedp
jedp / about_proxy_object_project.rb
Last active Aug 29, 2015
Create a proxy object class
View about_proxy_object_project.rb
# Answer to a ruby koan:
# http://koans.heroku.com/en/about_proxy_object_project
# Project: Create a Proxy Class
#
# In this assignment, create a proxy class (one is started for you
# below). You should be able to initialize the proxy object with any
# object. Any messages sent to the proxy object should be forwarded
# to the target object. As each message is sent, the proxy should
# record the name of the method send.
@jedp
jedp / about_triangle_project_2.rb
Created Aug 9, 2014
Heroku koans: syntax error in triangle project 2?
View about_triangle_project_2.rb
# http://koans.heroku.com/en/about_triangle_project_2
#
# XXX why does the second TriangleError.new cause a syntax error
# in the heroku web app, but not in my irb repl!?
class TriangleError < Exception
end
def triangle(a, b, c)
sides = [a, b, c]
View .mozconfig
. $topsrcdir/browser/config/mozconfig
# Define where build files should go. This places them in the directory
# "obj-ff-dbg" under the current source directory
mk_add_options MOZ_OBJDIR=../build_mc
# -s makes builds quieter by default
# -j4 allows 4 tasks to run in parallel. Set the number to be the amount of
# cores in your machine. 4 is a good number.
mk_add_options MOZ_MAKE_FLAGS="-s -j6"
View hgrc
[ui]
username = Jed Parsons <jedp@mozilla.com>
[diff]
# git diff is required so binary files don't break
git = 1
showfunc = True
unified = 8
[defaults]
View zshrc
#!/usr/bin/env zsh
# Completions and autoload {{{
# note - you can get a clean config using compinstall and zsh-newuser-install
zstyle ':completion:*' completer _expand _complete _correct
zstyle ':completion:*' completions 4
zstyle ':completion:*' glob 1
zstyle ':completion:*' group-name ''
zstyle ':completion:*' ignore-parents parent pwd
@jedp
jedp / B2G-Flame.md
Last active Aug 29, 2015
Setting up the B2G project for Flame
View B2G-Flame.md
You can’t perform that action at this time.