Skip to content

Instantly share code, notes, and snippets.

@chaffeqa
chaffeqa / other_task.rb
Created September 8, 2012 20:04
Griff's eyes only
class OtherTask < Task
def complete?
...
end
end
@chaffeqa
chaffeqa / check.rb
Created September 8, 2012 20:24
Griff's eyes only
class Check
initialize()
# do stuff
return "completed"
end
def completed?
...
end
end
@chaffeqa
chaffeqa / blah.rb
Created September 8, 2012 21:34
mind blown much?
require 'eventmachine'
class Check
include EM::Deferrable
attr_accessor :name
def initialize(name)
@name = name
puts "Starting #{name}"
EM.add_timer(1) do
@chaffeqa
chaffeqa / original.rb
Created October 5, 2012 17:37
Request Specific Params Issue
resource :entries do
params do
requires :limit, type: Integer
end
get "/" do
# Code
end
params do
require 'rubygems'
require 'benchmark/ips'
class ExampleClass
def foo; 42; end
end
module ExampleMixin
def foo; 43; end
end
@chaffeqa
chaffeqa / chaining.js
Created May 15, 2013 19:37
simple module for chaining something
function test_this( blah ){
var deferred = jQuery.Deferred();
function build(){
var d = jQuery.Deferred();
console.log("build",blah)
setTimeout(function(){ d.resolve(); },1000)
return d.promise();
}
#!/bin/sh
# hosts-to-vm.sh
# Drew Reece - September 2011
#
# Made for use alongside the excellent ievms - https://github.com/xdissent/ievms
#
# Will export the local hosts (from /etc/hosts)
# to a batch file & add that batch file to a Windows VM
# The batch script will be executed to import the hosts onto the VM
#
# Compiled source #
###################
*.class
*.dll
*.exe
*.o
*.so
# Packages #
############
[user]
name = Your Name
email = youremail@u.com
[alias]
co = checkout
[color]
diff = auto
status = auto
branch = auto
[core]
@chaffeqa
chaffeqa / process_feed.rb
Created January 11, 2016 19:13
Feed changes
# peter tyrrell - 1/2016
################################################################
# ProcessFeed
#
# .parse
# ---------------------------------------------------------------
# This routine can accept four OPTIONAL parameters
# example calls:
# ProcessFeed.parse(sim_online_state:ProcessFeed::SIM_FORCE, sim_round:400, sim_state:ProcessFeed::SIM_IN_PROGRESS)
# ProcessFeed.parse(feed_uri:'https://feeds.pgatourhq.com/DDManager/DDClient.do?clientFile=SyndFullLeaderboard&action=Request&u=sportstechinc&p=Z17t0vF4!!&T_ID=R2015470&R_NUM=1', sim_online_state:ProcessFeed::SIM_FORCE)