Skip to content

Instantly share code, notes, and snippets.

View waynerobinson's full-sized avatar

Wayne Robinson waynerobinson

View GitHub Profile
<html>
<head>
<style>
.setdown-address-block {
background-color: #eeeeee;
width: 100%;
display: table;
}
.setdown-buttons, .address-input, .validation-icon {
@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>
<body>
<div>
<img style="width:30px;height:60px;vertical-align:middle;border:1px solid blue;">
<span style="">Works.</span>
</div>
</body>
</html>
<html>
<head>
<title>Slide Example</title>
<style>
.viewport {
position: relative;
overflow: hidden;
width: 150px;
height: 200px;
border: 1px solid maroon;
require 'rubygems'
require 'eventmachine'
require 'amqp'
class QueueDaemon
class << self
def exchange
@exchange
@waynerobinson
waynerobinson / gist:1182761
Created August 31, 2011 03:33
In Rails app
class QueueDaemon
class << self
def start!
Thread.new do
EventMachine.run do
puts "Asimov: Attempting Connection"
AMQP.connect(
:on_possible_authentication_failure => Proc.new {puts("Asimov: Possible Authentication Failure")},
@waynerobinson
waynerobinson / gist:1182760
Created August 31, 2011 03:33
Standalone daemon
class QueueDaemon
class << self
def start!
Thread.new do
EventMachine.run do
puts "Asimov: Attempting Connection"
AMQP.connect(
:on_possible_authentication_failure => Proc.new {puts("Asimov: Possible Authentication Failure")},
# activerecord logging methods
# very useful for digging into
# queries
require 'logger'
require 'activerecord' if rails?(2)
def enable_logger
log_to(Logger.new(STDOUT))
end
require 'rubygems'
require 'irb/completion'
require 'irb/ext/save-history'
# inspired by https://gist.github.com/794915
# I've changed it a bit, it works fine for me now
# but i'm still searching for a better solution
def require_without_bundler(*gems)
unless defined?(::Bundler)
gems.each { |g| require g }
- form_for :branch, @branch, :url => {:action => :create, :id => @branch.id} do |f|
= render :partial => 'form', :locals => {:f => f, :submit_button_caption => "Create Branch"}