This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
var ticketLink = 'http://tickets.kpop.sg'; | |
$( function () { | |
$('a[href*="' + ticketLink + '"]').click ( function () { | |
_gat._getTrackerByName()._trackEvent('Outbound links', ticketLink); | |
setTimeout(function() { document.location = ticketLink; }, 100); | |
return false; | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from M2Crypto import EVP, RSA, X509 | |
import binascii | |
class C(object): | |
def __init__(self): | |
pass | |
def sign(self, message_to_encrypt): | |
key = EVP.load_key("mycert-private.pem") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
list of currencies currently in circulation | |
taken from http://www.currency-iso.org/iso_index/iso_tables/iso_tables_a1.htm | |
http://www.iso.org/iso/currency_codes_list-1.html | |
2011-08-11 | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for transaction in NewsletterTransaction.objects.filter(sent=None): | |
... | |
# to | |
while NewsletterTransaction.objects.filter(sent=None).count(): | |
for transaction in NewletterTransaction.objects.filter(sent=None).limit(10): | |
... | |
# taking 10 at a time and then doing a new query. this way you're |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
for f in crystal knox pound poundpay-python poundweb precog sterling | |
do | |
ln -s ~/code/poundpay/pre-commit $f/.git/hooks/pre-commit | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@event.listens_for(Debit, 'before_insert') | |
def increment_balance(mapper, connection, debit): | |
eid = generate_eid('D') | |
result = 1 | |
while result: | |
result = Debit.query.filter( | |
Debit.marketplace == debit.marketplace, | |
Debit.eid == eid |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/python | |
""" | |
A simple directory watching script that will compute the checksum for all files | |
within a path and execute a change when the sum changes. | |
This will not work well with large files as it reads the entire file into | |
memory. | |
""" | |
import argparse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" type="text/css"> | |
<style type="text/css"> | |
code { display: block; } | |
pre { color: green; } | |
</style> | |
</head> | |
<body> | |
<h1>Balanced Sample - Collect Bank Account Information</h1> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import balanced | |
from django.conf import settings | |
class BalancedMiddleware(object): | |
def process_request(*_): | |
balanced.configure(settings.BALANCED['secret']) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import balanced | |
api_key = balanced.APIKey().save() | |
balanced.configure(api_key.secret) | |
marketplace = balanced.Marketplace().save() | |
bank_account = balanced.BankAccount( | |
account_number="1234567890", | |
bank_code="12", |
OlderNewer