Skip to content

Instantly share code, notes, and snippets.

View mchail's full-sized avatar

Steve McHail mchail

View GitHub Profile
@mchail
mchail / math_eval_with_ooo.rb
Created October 3, 2014 23:35
evaluate expression from string (and follow order of operations)
require 'json'
class StringCalc
def initialize(str)
@tokens = str.split('')
# puts @tokens.to_json
end
def run
@mchail
mchail / hubot_deliboard.coffee
Created April 15, 2014 07:29
Hubot Deliboard plugin
# Description:
# Prints today's deliboard menu
#
# Dependencies:
# "cheerio" : "https://github.com/cheeriojs/cheerio",
#
# Commands:
# deliboard menu
#
# Notes:
@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
@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 / 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 = ''
#!/usr/bin/env ruby
require 'optparse'
require 'uri'
options = {
db: 0,
varname: "REDIS_URL",
host: "proxy1.openredis.com"
}
// http://localhost:26843/client_is_running.js
function client_is_running() { return 1; }
@mchail
mchail / Gemfile
Last active October 13, 2015 02:37
Zapier Webhooks in Rails with Resque
gem "resque", :require => 'resque/server'
gem 'resque-history'
@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")