Skip to content

Instantly share code, notes, and snippets.

View trobrock's full-sized avatar

Trae Robrock trobrock

View GitHub Profile
@trobrock
trobrock / mootools-crossfade.js
Created March 15, 2011 22:04
A simple mootools image crossfader
var Crossfade = new Class({
Implements: [Options, Chain],
options: {
duration: 1000
},
initialize: function(element, options) {
this.setOptions(options);
this.element = element;
this.currentIndex = 0;
location / {
if (-f $document_root/system/maintenance.html) {
return 503;
}
try_files $uri $uri/index.html @proxy;
}
error_page 503 @503;
Showing app/views/shared/_search_user_form.html.haml where line #1 raised:
negative argument
Extracted source (around line #1):
1: - form_tag(users_path, :method => 'get') do
2: %div
3: -# Email: #{text_field_tag "email"}
4: %div
@trobrock
trobrock / glitchy.rb
Created June 21, 2011 04:25
Glitchy gem initializer configuration
GlitchyGem.configure do |config|
config.api_key = "YOUR_API_KEY"
end
@trobrock
trobrock / async-thrift-dojo.js
Created July 11, 2011 22:48
Async thrift with dojo
var url = "/txn_store_api";
var t = new Thrift.Transport();
var p = new Thrift.Protocol(t);
var client = new TxnStore.TxnStoreClient(p);
var d = dojo.xhrPost({
url: url,
handleAs: "json",
postData: client.send_getTxns("110237153", []),
load: function(res){
@trobrock
trobrock / gist:1077018
Created July 11, 2011 23:12
Groovy script for running commands
def proc = ["which", "git"].execute()
proc.waitFor()
println "stdout: ${proc.in.text}"
@trobrock
trobrock / gist:1085567
Created July 15, 2011 21:19
gerrit config
Reference:
refs/heads/*
Owner
Administrators
Anonymous Users
Create Reference
Administrators
Anonymous Users
Push
Administrators
#!/bin/bash
exec god -D
@trobrock
trobrock / error
Created August 22, 2011 20:08
Rvm failure with iconv
~/Sites/outright.github.com[master]% gem list
*** LOCAL GEMS ***
rake (0.9.2 ruby)
rubygems-update (1.8.8)
~/Sites/outright.github.com[master]% gem install jekyll
Fetching: liquid-2.2.2.gem (100%)
Fetching: fast-stemmer-1.0.0.gem (100%)
Building native extensions. This could take a while...
def create
@glitch = current_user.glitches.new(params[:glitch])
respond_to do |format|
if @glitch.save
UserMailer.glitch(@glitch).deliver
format.xml { render :xml => @glitch, :status => :created, :location => @glitch }
format.json { render :json => @glitch }
else
format.xml { render :xml => @glitch.errors, :status => :unprocessable_entity }