Skip to content

Instantly share code, notes, and snippets.

/*
* LedBrightness sketch
* controls the brightness of LEDs on "analog" (PWM) output ports.
*/
class rgb_color {
private:
int my_r;
int my_g;
@deplorableword
deplorableword / index.html
Created February 14, 2013 13:23
shake it to make it
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>real time feed of the bestest harlem shakes</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<style>
body,a {
font-family: sans-serif;
<?php include('/Applications/MAMP/cashmusic/framework/cashmusic.php'); // CASH Music ?>
<?php CASHSystem::embedElement(1); // (Testing) ?>
@deplorableword
deplorableword / deploy.rb
Created October 6, 2011 08:36
deploy via copy
require "bundler/capistrano"
set :application, "ivy"
default_run_options[:pty] = true
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`
set :user, "username"
server "domain.com", :app, :web, :db, :primary => true
set :scm, :none
@deplorableword
deplorableword / gist:1149081
Created August 16, 2011 13:36
datamapper-associations.rb
require 'rubygems'
require 'sinatra'
require 'dm-core'
require 'dm-migrations'
require 'dm-sqlite-adapter'
DataMapper::setup(:default, "sqlite3://#{Dir.pwd}/todo.db")
class Tag
include DataMapper::Resource
@deplorableword
deplorableword / app.rb
Created June 24, 2011 10:51 — forked from mrsteveheyes/gist:1044564
Datamapper problem
require 'rubygems'
require 'sinatra'
require 'datamapper'
get '/' do
'Hello World'
end
@deplorableword
deplorableword / gist:917326
Created April 13, 2011 10:26
Listen to your PHP errors on Mac
tail -f /Applications/MAMP/logs/php_error.log | while read line ; do echo $line | say ; done
<?php
if (is_page('blah') {
echo str_replace('"','\"', get_the_content();
} else {
the_content();
}
@deplorableword
deplorableword / ukstrtotime.php
Created February 2, 2011 12:30
strtotime uk date format
<?php
$parsed_end_date = str_replace('/', '-', $wgt_end_date);
$end_date = date('Y-m-d H:i', strtotime($parsed_end_date));
@deplorableword
deplorableword / export-csv.rb
Created February 1, 2011 10:43
sudo gem install ticketmaster, sudo gem install ticketmaster-lighthouse. usage: ruby lighthoust-export.rb accoutname username password projectid
require 'rubygems'
require 'ticketmaster'
require 'ticketmaster-lighthouse'
Lighthouse.account = ARGV[0]
Lighthouse.authenticate(ARGV[1],ARGV[2])
all_tickets = Lighthouse::Ticket.find(:all, :params => { :project_id => ARGV[3] })
begin
File.delete("export.csv")