Skip to content

Instantly share code, notes, and snippets.

@benwilhelm
benwilhelm / firefly.pde
Created December 15, 2014 17:00
Firefly Loop for Arduino
const int numPins = 10 ;
int pins[] = { 2, 3, 4, 5, 6, 7, 8, 9, 10, 11 } ;
int up[numPins] ;
int dur[numPins] ;
int dn[numPins] ;
int cyc[numPins] ;
long prv[numPins] ;
long currentMillis ;
int maxBright = 100 ;
@benwilhelm
benwilhelm / index.php
Created June 21, 2013 17:19
Server-Side example of JSON-P support
<?php
$data = array('content' => 'Domain 2 FTW!') ;
header("Content-Type: application/javascript") ;
$cb = $_GET['callback'] ;
$data_str = json_encode($data) ;
echo "{$cb}({$data_str})" ;
@benwilhelm
benwilhelm / RsvpsControllerTest.rb
Created July 6, 2011 16:04
Functional Test giving NoMethodError
require 'test_helper'
class RsvpsControllerTest < ActionController::TestCase
setup do
@rsvp = rsvps(:one)
end
test "should get index" do
get :index
assert_response :success