Skip to content

Instantly share code, notes, and snippets.

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++) {
@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://#')
@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
#!/bin/bash
DB_USER="root"
DB_PASS="…"
BACKUP_DIR="/srv/backups/mysql"
TODAY=$( date +%d)
DATABASES=$(mysql -u ${DB_USER} -p"${DB_PASS}" -N -B -e 'SHOW DATABASES')
for DATABASE in $DATABASES
do
@stepahn
stepahn / gist:1099278
Created July 22, 2011 11:27
growl iChat
-- growl notifications for ichat, based on
-- http://scriptingosx.com/2010/11/ichat-notification-with-growl/
property growlAppName : "Growl iChat"
property notificationNames : {"Buddy Became Available", ¬
"Buddy Became Unavailable", ¬
"Message Received", ¬
"Completed File Transfer"}
property defaultNotificationNames : {"Buddy Became Available", ¬
@stepahn
stepahn / gist:3620893
Created September 4, 2012 12:50 — forked from anonymous/gist:3620872
pypy cross translation

Cross-translating for ARM

Here we describe the required setup and necessary steps to translate an interpreter with the RPython translator to target ARM using a cross compilation toolchain.

While it is possible to translate an RPython program for ARM directly on an ARM device following the normal translation steps it is not really feasible on most ARM machines. The alternative is to cross-translate using a cross-compilation toolchain.

@stepahn
stepahn / time.py
Created January 29, 2013 16:12 — forked from timfel/time.py
import time
import os
from pypy.rpython.tool import rffi_platform
from pypy.rpython.lltypesystem import rffi, lltype
from pypy.translator.tool.cbuild import ExternalCompilationInfo
from rupypy.module import ClassDef
from rupypy.objects.objectobject import W_Object
from rupypy.objects.exceptionobject import W_ArgumentError
Pod::Spec.new do |s|
s.name = "NHCalendarActivity"
s.version = "0.0.1"
s.summary = "NHCalendar is a custom UIActivity that adds events and alarms to the Calendar."
s.homepage = "https://github.com/otaviocc/NHCalendarActivity"
s.author = "Otavio Cordeiro"
s.source = { :git => "https://github.com/otaviocc/NHCalendarActivity.git", :commit => '9ff91edd' }
s.platform = :ios
s.ios.deployment_target = '6.0'
Pod::Spec.new do |s|
s.name = "Cordova"
s.version = "2.8.0"
s.summary = "Apache Cordova is a platform for building native mobile applications using HTML, CSS and JavaScript."
s.homepage = "http://cordova.apache.org/"
s.author = "Original developed by Nitobi (acquire by Adobe) and all other PhoneGap and Cordova Contributors"
s.license = 'Apache License, Version 2.0'
s.source = { :git => "https://github.com/apache/cordova-ios.git", :tag => "2.8.0" }
Pod::Spec.new do |s|
s.name = 'AdMob'
s.version = '6.4.2'
s.summary = 'Google AdMob Ads SDK.'
s.description = 'The Google AdMob Ads SDK allows developers to easily incorporate mobile-friendly text and image banners as well as rich, full-screen web apps known as interstitials.'
s.homepage = 'https://developers.google.com/mobile-ads-sdk/docs/'
s.license = {
:type => 'Copyright',
:text => <<-LICENSE
Copyright 2009 - 2013 Google, Inc. All rights reserved.