Skip to content

Instantly share code, notes, and snippets.

View mrichie's full-sized avatar

Richie Min mrichie

View GitHub Profile
@mrichie
mrichie / resque.rake
Created September 27, 2011 15:54
make Resque scheduler write to PIDFILE
require 'resque/tasks'
require 'resque_scheduler/tasks'
task "resque:setup" => :environment
desc "Start Resque Scheduler"
task 'resque:scheduler' => :scheduler_setup do
require 'resque'
require 'resque_scheduler'
File.open(ENV['PIDFILE'], 'w') { |f| f << Process.pid.to_s } if ENV['PIDFILE']
@mrichie
mrichie / strophe.xdomainrequest.js
Created August 5, 2011 02:42 — forked from iadvize/strophe.xdomainrequest.js
A Strophe plugin by iAdvize that use the XdomainRequest if found (Internet Explorer)
Strophe.addConnectionPlugin("xdomainrequest", {
init: function () {
if (window.XDomainRequest) {
Strophe.debug("using XdomainRequest for IE");
// override thee send method to fire readystate 2
XDomainRequest.prototype.oldsend = XDomainRequest.prototype.send;
XDomainRequest.prototype.send = function() {
XDomainRequest.prototype.oldsend.apply(this, arguments);
this.readyState = 2;