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
/* | |
Add a bookmark to this | |
javascript:(function(){var c=document.getElementsByTagName("link");for(var d=0;d<c.length;d++){var a=c[d];if(a.rel=='stylesheet'||a.type=="text/css"){var e="css_buster_"+Math.floor(Math.random()*1000000000);var g=a.href.split("?",2);var f;if(g.length>1){var b=g[1].indexOf("&")==-1;if(b){f=e}else{f=g[1]+"&"+e}}else{f=e}a.href=g[0]+"?"+f}}})(); | |
*/ | |
(function() { | |
var links = document.getElementsByTagName('link'); | |
for (var i = 0; i < links.length; i++) { | |
var l = links[i]; | |
if (l.rel == 'stylesheet' || l.type == 'text/css') { |
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
- (void)webViewDidFinishLoad:(UIWebView *)webView | |
{ | |
if (webView.subviews.count > 0) | |
{ | |
id aView = [webView.subviews objectAtIndex:0]; | |
if ([aView respondsToSelector:@selector(setScrollEnabled:)]) | |
{ | |
((UIScrollView*)aView).scrollEnabled = NO; | |
} |
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 csv | |
import simplegeo | |
OAUTH_TOKEN = '[insert_oauth_token_here]' | |
OAUTH_SECRET = '[insert_oauth_secret_here]' | |
CSV_FILE = '[insert_csv_file_here]' | |
LAYER = '[insert_layer_name_here]' | |
client = simplegeo.Client(OAUTH_TOKEN, OAUTH_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
from django.conf import settings | |
from django.conf.urls.defaults import include, patterns | |
from django.http import HttpResponse | |
from django.utils.encoding import smart_unicode | |
if 'debug_toolbar' not in settings.INSTALLED_APPS: | |
class DebugMiddleware(object): | |
pass | |
else: | |
import debug_toolbar.urls |
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
""" | |
Patches the database wrapper and template engine to throw an exception if a query is executed inside of a template. | |
In your urls.py, enable it like so: | |
>>> import monkey | |
>>> monkey.patch_templates() | |
""" | |
import logging |
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: Brian Akins < brian@akins.org> | |
To: chef < chef@lists.opscode.com> | |
Subject: [chef] Data bag implementation for chef-solo | |
Date: Tue, 1 Feb 2011 10:42:05 -0500 | |
We often use chef-solo for quick testing, etc. This is our extremely simple implementation of data bags for chef-solo. Add "data_bag_path /some/dir/data_bags" to your solo.rb and add this into your libraries: | |
if Chef::Config[:solo] | |
class Chef | |
module Mixin | |
module Language |
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 Crypto.Cipher import AES | |
import binascii | |
import re | |
ssn_re = re.compile(r"^\d{3}[-\ ]?\d{2}[-\ ]?\d{4}$") | |
class EncryptedSSNField(models.CharField): | |
description = _('Adds transparent encryption/decryption (AES256 using pyCrypto) for US Social Security Numbers in the database.') | |
__metaclass__ = models.SubfieldBase |
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
virtualenv --no-site-packages . | |
source bin/activate | |
bin/pip install Django psycopg2 django-sentry | |
bin/pip freeze > requirements.txt | |
bin/django-admin.py startproject mysite | |
cat >.gitignore <<EOF | |
bin/ | |
include/ | |
lib/ | |
EOF |
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 re | |
import simplejson | |
from django.http import HttpResponse | |
from django.conf import settings | |
class JSONResponse(HttpResponse): | |
def __init__(self, request, data): | |
indent = 2 if settings.DEBUG else None |
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
// | |
// NSURLConnection+Blocks.h | |
// SteveHolt | |
// | |
// Created by Eric Florenzano on 10/19/11. | |
// Copyright (c) 2011 Boilerplate Inc. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
OlderNewer