Skip to content

Instantly share code, notes, and snippets.

View waynerobinson's full-sized avatar

Wayne Robinson waynerobinson

View GitHub Profile
@waynerobinson
waynerobinson / LICENSE.txt
Created November 29, 2011 10:41 — forked from LeverOne/LICENSE.txt
generate random v4 UUIDs (107 bytes)
DO WTF YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 Alexey Silin <[email protected]>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WTF YOU WANT TO PUBLIC LICENSE
<html>
<head>
<style>
.setdown-address-block {
background-color: #eeeeee;
width: 100%;
display: table;
}
.setdown-buttons, .address-input, .validation-icon {
@waynerobinson
waynerobinson / request.xml
Created April 17, 2012 01:22
New Manual Journal URL Field Not Working
<ManualJournal>
<Date>2011-12-31</Date>
<Status>DRAFT</Status>
<LineAmountTypes>Exclusive</LineAmountTypes>
<UpdatedDateUTC>2008-09-12T05:04:00</UpdatedDateUTC>
<ManualJournalID>f00a355b-7374-445c-886b-0437bea4095c</ManualJournalID>
<Narration>Computer expenses incorrectly coded</Narration>
<JournalLines>
<JournalLine>
<Description>Laptop to wrong expense account</Description>
@waynerobinson
waynerobinson / juggernaut.rb
Created June 26, 2012 03:00 — forked from maccman/juggernaut.rb
Juggernaut - simple design
# Usage: redis-cli publish message hello
require 'sinatra'
require 'redis'
conns = []
get '/' do
erb :index
end
@waynerobinson
waynerobinson / limitandoffset.sql
Created July 20, 2012 05:16
Oracle - SELECT ordered with LIMIT and OFFSET
-- SELECT with LIMIT and OFFSET in MySQL
SELECT id, name FROM table ORDER BY name LIMIT 100 OFFSET 50;
-- SELECT with LIMIT and OFFSET in Oracle
SELECT a.id, a.name
FROM (SELECT b.id, b.name,
@waynerobinson
waynerobinson / index.html
Created August 15, 2012 09:16
MacBook Pro Icon in CSS3 Only
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<!-- IF PEN IS PRIVATE -->
<!-- <meta name="robots" content="noindex"> -->
<!-- END -->
@waynerobinson
waynerobinson / cachable_address.rb
Created September 25, 2012 02:10
Cached Address Proxy
require "dalli"
require "yaml"
module MTDataStone
class CachableAddresses < Addresses
DALLI_HOST = "localhost:11211"
DALLI_OPTIONS = {}
EXPIRY_PERIOD = 60.days
class Autocompleter
def self.parse_street_input(input)
matches = /
(
(?:[Uu](?:nit)?\s*)? #U or Unit, any casing, maybe with following spaces, non-captured
[\d\/\s\\\-,]+ #Unit number (Digits, spaces, dashes, both slashes)
\d?) #Street Number
?\s? #Spacing and Optionality for Numbering
([\w\-\s']+) #Street Name - Match any combination of words and spaces (And apostrophe)
module MTData
class Base < ActiveRecord::Base
# MT_DATA_DATABASE should have a connection string to one of the
# specific databases.
establish_connection MT_DATA_DATABASE
end
class Street < Base
self.table_name = "street"
end
require "jruby"
require "dcell"
DCell.start id: "node1-client", addr: "tcp://127.0.0.1:4001", directory: {id: "node1", addr: "tcp://127.0.0.1:4000"}
loop {
duck = DCell::Global[:duck]
if duck
begin
puts duck.future.quack.value(1.5)