Skip to content

Instantly share code, notes, and snippets.

@stepahn
stepahn / gist:730449
Created December 6, 2010 15:40
one-line heroku backups
heroku pgbackups:capture --expire && wget -O $(date +%F).pgdump $(heroku pgbackups:url | sed 's#^http://#https://#')
function externalLinks() {
if (!document.getElementsByTagName) return;
var anchors = document.getElementsByTagName("a");
for (var i=0; i<anchors.length; i++) {
var anchor = anchors[i];
if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external")
anchor.target = "_blank";
}
anchors = document.getElementsByTagName("form");
for (var i=0; i<anchors.length; i++) {
class Foo(object):
def f(self, x=None):
print 'hello'
print x
return None
class Bar(Foo):
pass
class W_SimpleObject(object):
def getvalue(self, key = None):
for parent in self.get_mro():
try:
return parent.getval(key)
except KeyError:
pass
return None
-----> Heroku receiving push
-----> Rails app detected
-----> Gemfile detected, running Bundler version 1.0.0.rc.5
Unresolved dependencies detected; Installing...
Could not find rake-0.8.7 in any of the sources
FAILED: Have you updated to use a 0.9 Gemfile?
http://docs.heroku.com/gems#gem-bundler
error: hooks/pre-receive exited with error code 1
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
Locking environment
Your bundle is already locked, relocking.
/usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:49:in `initialize': not in gzip format (Zlib::GzipFile::Error)
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:49:in `new'
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:49:in `initialize'
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb:63:in `each'
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb:54:in `loop'
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb:54:in `each'
from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:32:in `initialize'
fib = Hash.new {|hash, key| hash[key-1] + hash[key-2]}
fib[0],fib[1] = 0, 1
$(document).ready(function() {
$("a[rel='external']").attr('target', '_blank');
});
header, footer, section, aside, nav, article {
display: block;
}
document.createElement('header');
document.createElement('footer');
document.createElement('section');
document.createElement('aside');
document.createElement('nav');
document.createElement('article');