Skip to content

Instantly share code, notes, and snippets.

@stepahn
stepahn / gist:886775
Created March 25, 2011 12:33
numbers and stuff
07 08 09 010 0b10 0×10 0d10
ruby 7 SyntaxError SyntaxError 8 2 16 10
python 7 SyntaxError SyntaxError 8 2 16 SyntaxError
javascript 7 8 9 8 SyntaxError: Unexpected token ILLEGAL 16 SyntaxError: Unexpected token ILLEGAL
php 7 0 0 8 SyntaxError 16 SyntaxError
scala 7 SyntaxError SyntaxError 8 SyntaxError 16 SyntaxError
groovy 7 SyntaxError SyntaxError 8 SyntaxError 16 SyntaxError
c 7 invalid digit in octal constant invalid digit in octal constant 8 invalid suffix on integer constan 16 invalid suffix on integer constan
java 7 number to large number to large 8 illegal start of expression 16 illegal start of expression
clang 7 invalid digit in octal constant invalid digit in octal constant 8 2 16 invalid digit in octal constant
@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;
}