Skip to content

Instantly share code, notes, and snippets.

View mchail's full-sized avatar

Steve McHail mchail

View GitHub Profile
@mchail
mchail / turntablr.js
Created January 19, 2012 22:27
turntable autobopper
javascript:(function(){
if(typeof turntablr !== 'undefined'){alert('already turntablin')}
else{
turntablr = true;
$($($('.roomView > div > a')[2]).data('events').click).each(function(k,h){
a = h.handler.toString().match(/[a-zA-z]+\.callback\(.upvote.\)/)[0]
});
setInterval(function(){eval(a)},10000);
tt = $('<div style=\'display:none;color:red;position:fixed;left:10px;top:10px;padding:10px;border:1px solid red;background:#ddd;-moz-border-radius:10px;-webkit-border-radius:10px\'>turntablin</div>');
$('body').append(tt);
@mchail
mchail / extEventLogger.js
Created February 21, 2012 03:10
Log all Ext events
javascript:(
function() {
var o = Ext.util.Observable.prototype;
o.fireEvent = o.fireEvent.createInterceptor(function(evt) {
var a = arguments;
console.log(this, ' fired event ', evt, ' with args ', Array.prototype.slice.call(a,1,a.length));
});
}
)();
@mchail
mchail / clever_solver.rb
Created August 18, 2012 00:20
getclever.com puzzle solution
class CleverSolver
require 'rest-client'
require 'json'
def initialize
@root = "https://DEMO_KEY:@api.getclever.com"
@next_url = "/v1.1/students"
@vcount = 0
end
@mchail
mchail / nexusplz.rb
Created November 13, 2012 19:32
Check google's nexus page until I can buy one
#!/usr/bin/ruby
require 'rest-client'
counter = 0
can_has_phone = false
while !can_has_phone
puts "checking... (#{counter})"
src = RestClient.get("https://play.google.com/store/devices/details?id=nexus_4_16gb")
@mchail
mchail / Gemfile
Last active October 13, 2015 02:37
Zapier Webhooks in Rails with Resque
gem "resque", :require => 'resque/server'
gem 'resque-history'
// http://localhost:26843/client_is_running.js
function client_is_running() { return 1; }
#!/usr/bin/env ruby
require 'optparse'
require 'uri'
options = {
db: 0,
varname: "REDIS_URL",
host: "proxy1.openredis.com"
}
@mchail
mchail / hipchat.py
Last active December 31, 2015 19:29 — forked from wsorenson/hipchat.py
Calculate hipchat comments/day. Forked from @wsorenson.
#!/usr/bin/env python
# encoding: utf-8
import sys
import os
import requests
import re
# log in on the browser and supply the full cookie sent to HipChat as well as the company domain.
COOKIE = ''
@mchail
mchail / dogebomb.sh
Created February 6, 2014 22:51
dogebomb
#!/bin/bash
say "dogebomb"
for i in $(seq 10)
do
curl -sL 'http://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag=doge' | grep -o 'http[^"]*gif' | head -n 1 | sed 's/\\//g' | xargs open
done
@mchail
mchail / drakebomb.sh
Created February 6, 2014 23:01
drakebomb
#!/bin/bash
say "drake bomb"
for i in $(seq 10)
do
curl -sL 'http://api.giphy.com/v1/gifs/random?api_key=dc6zaTOxFJmzC&tag=drake' | grep -o 'http[^"]*gif' | head -n 1 | sed 's/\\//g' | xargs open
done