Now that Hurl is open source I thought I'd talk a bit about one of my favorite open source projects: Redis.
In Hurl we keep track of all the hurls you make, then show them to you on the "your hurls" page:
*image*
// pattern: *play.google.com/music* | |
setTimeout(removeTopBar, 100); | |
setTimeout(removeUser, 100); | |
var $ = function () { | |
return document.getElementById.apply(document, arguments); | |
} | |
function removeTopBar() { |
(function(){ | |
_textarea=document.createElement('TEXTAREA'); | |
_textarea.setAttribute('class', 'crashtest'); | |
document.getElementsByTagName('body')[0].appendChild(_textarea); | |
_textarea.focus(); | |
_evt = document.createEvent("TextEvent"); | |
_evt.initTextEvent("textInput", true, true, window, 'file:///'); | |
_textarea.dispatchEvent(_evt); | |
} | |
)() |
# dynamically injecting into the multiple inheritance chain, like ruby's modules. | |
# can we stop fighting already? | |
class Foo(object): | |
pass | |
class Bar(Foo): | |
pass | |
class Baz(object): |
# ...8<... | |
Rails.boot! | |
# default to Thin | |
if $0 == "script/server" | |
# commands/server.rb (#45) is not cooperative, so we patch Rack itself | |
require 'rack' | |
module Rack::Handler | |
puts "Patching Rack for Thin as default" |
# ...8<... | |
Rails.boot! | |
# see http://gembundler.com/rails23.html to make Bundler work with Rails 2.x (tested with 2.1, 2.2 and 2.3) | |
# bundler with rails 2.x prevents finding mongrel_rails in PATH | |
if $0 == "script/server" | |
# ensure active_support is loaded | |
require 'active_support' |
class FooController | |
respond_to :csv | |
def index | |
@foos = Foo.scoped | |
if stale?(:last_modified => Foo.something) | |
respond_with @gta do |format| | |
format.csv { stream_csv @foo } | |
end | |
end |
#!/usr/bin/env python | |
from __future__ import print_function | |
from __future__ import division | |
from subprocess import Popen, PIPE | |
def ioreg_battery_info(): | |
output = Popen(["ioreg", "-r", "-k", "LegacyBatteryInfo", "-w", "0"], stdout=PIPE).communicate()[0] | |
try: #python3 |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from __future__ import print_function, division | |
import os | |
import sys | |
import re | |
from glob import iglob as glob | |
import time | |
from datetime import datetime, timedelta |