Skip to content

Instantly share code, notes, and snippets.

@bananastalktome
bananastalktome / Arduino Hamster Wheel
Created February 21, 2011 00:42
The code, still rough though.
const int inPin = 7; // pushbutton connected to digital pin 7
//const int cmPerClick = 51; // cm
const float inchesPerClick = 20.1; // inches
int val = 0; // variable to store the read value
float totalDistance = 0; // total distance in inches
int lastTime = 0;
float difference = 0;
if Rails.version == '2.3.8' && Gem.available?('mongrel', Gem::Requirement.new('~>1.1.5')) && self.class.const_defined?(:Mongrel)
# Pulled right from latest rack. Old looked like this in 1.1.0 version.
#
# def [](k)
# super(@names[k] ||= @names[k.downcase])
# end
#
module Rack
Recognized HTTParty parameters:
Class Foo
include HTTParty
http_proxy '<URL>', <PORT> # Allows setting http proxy information to be used
base_uri '<URL>' # Allows setting a base uri to be used for each request. Will normalize uri to include http, etc.
basic_auth '<USERNAME>', '<PASS>' # Allows setting basic authentication username and password.
digest_auth '<USERNAME>', '<PASS>' # Allows setting digest authentication username and password.
default_params <Default_Param_Hash> # Allows setting default parameters to be appended to each request. Great for api keys and such.