Skip to content

Instantly share code, notes, and snippets.

@bkerley
bkerley / 1.txt
Created February 21, 2012 02:34 — forked from anonymous/1.txt
title New Browser Setup
User->Phone: identifying info
Phone->idjump: identifying info
idjump->Phone: encrypted blob
User->Phone: decrypting info
Phone->local storage: decrypted blob
require 'pp'
class PatternObject
def initialize
@patterns = Hash.new
end
def method_missing(name, *args)
candidates = @patterns[name]
winner = candidates.detect do |c|
c.match args
end
  1. start with a queue Q1 of all the live cells followed by a "end of live" tombstone

  2. before tombstone reached:

  3. pull cell C from queue

  4. add C's dead non-queued neighbors to queue

  5. add C to queue Q2 if it shall live

  6. repeat

  7. after "end of live" tombstone reached:

  8. put "end of dead" tombstone on Q1

irb(main):019:0> q = Qria.new
=> #<Qria:0x007fbec8c873f8 @thunks=[]>
irb(main):020:0> q.where{|x| x > 5 }
=> [#<Thunk:0x007fbec8c74d70 @name=:>, @args=[5]>]
irb(main):021:0> q.where{|x| x.match '/^text/'}
=> [#<Thunk:0x007fbec8c74d70 @name=:>, @args=[5]>, #<Thunk:0x007fbec8c67698 @name=:match, @args=["/^text/"]>]
irb(main):022:0> puts q.to_js
function(t) {
var i = Riak.mapValuesJson(t)[0];
var c = true;
Application = Rack::Builder.new do
use NewRelic::Rack::DeveloperMode
map '/cans' do
run Cans::Application.new
end
map '/' do
run Sinatra::Application
end
end
/*This code for a PIC12F615 compiles in mikroC for PIC http://www.mikroe.com
It takes an analog value from a dash-mounted potentiometer and drives a MOSFET proportional to the input. The MOSFET pulses the low-side of a blower motor in
a 1997 Mitsubishi Mirage, providing 128 speeds*/
void main() {
int anin=0, ramped=255;
unsigned long temp = 0;
require 'capybara/dsl'
include Capybara::DSL
Capybara.current_driver = :selenium
Capybara.app_host = 'https://ssl.bing.com'
# do log in stuff here
def slumlord(thing)
click_on thing
@bkerley
bkerley / gist:1163607
Created August 22, 2011 21:15 — forked from voodootikigod/gist:1155790
PyCodeConf Ticket Give-away
Day job:
Rails developer
Favorite Python project:
NodeBox
Favorite Conference:
Scottish Ruby Conference
Python Experience Level:
#include "symbol.h"
#include "init.h"
void JJ()
{
long a,b,r;
a = (long)stack_pop(); // (long)stack_pop() turns into this
b = (long)stack_pop();
r = a + b;
stack_push((stack_entry)r); // stack_push((stack_entry)r) turns into this
@bkerley
bkerley / notes.md
Created July 14, 2011 01:00
design miami git notes

Original

On server:

  1. install wordpress
  2. install plugins, frameworks, themes
  3. use FTP to edit files, add images

Bryce-style