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
#!/usr/bin/env python | |
import urllib2 | |
import zipfile | |
import MySQLdb | |
class AlexaUpdater(): | |
def __init__(self, user, password, db_name, table_name, host='localhost', | |
charset='utf8'): | |
self.host = host |
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
// compile using valac app.vala -o app --pkg gtk+-2.0 | |
using Gtk; | |
namespace MyApp | |
{ | |
class MyApp: Gtk.Window | |
{ | |
public MyApp() | |
{ |
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
#!/usr/bin/env python | |
import bottle | |
from bottle import route | |
def websafe(func): | |
""" | |
A decorator function for preventing cross-site scriting attacks | |
""" | |
def wrapper(*args, **kwargs): |
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
#!/usr/bin/env python | |
import signal | |
import logging | |
import base64 | |
import routes | |
import routes.middleware | |
import webob |
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 | |
COMMON_DIRS=(bin doc etc tests) | |
COMMON_FILES=(README ABOUT INSTALL TODO NEWS CHANGELOG LICENSE Makefile) | |
BASE_PATH=$PROJECT_PATH/$PROJECT_NAME | |
function create_directories { | |
mkdir -p $BASE_PATH/$PROJECT_NAME |
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
PACKAGE=mypackage | |
MIN_COVERAGE=90 | |
# NOTE: Be careful, rm -rf will be called on this! | |
COVERAGE_HTML_DIR=coverage/ | |
VERBOSITY=2 | |
.PHONY: all dev install test coverage clean | |
all: test |
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
{ | |
"color_scheme": "Packages/User/Tomorrow-Night (SL).tmTheme", | |
"draw_white_space": "all", | |
"ensure_newline_at_eof_on_save": true, | |
"find_selected_text": true, | |
"fold_buttons": false, | |
"folder_exclude_patterns": | |
[ | |
".svn", | |
".git", |
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 os | |
from django.dispatch import receiver | |
from rosetta.signals import post_save | |
@receiver(post_save) | |
def restart_server(sender, **kwargs): | |
os.system('supervisorctl pid <gunicorn process> | xargs kill -HUP') |
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 os | |
from django.dispatch import receiver | |
from rosetta.signals import post_save | |
@receiver(post_save) | |
def restart_server(sender, **kwargs): | |
os.system('initctl reload <myapp>') |
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
Show hidden characters
{ | |
"auto_complete_triggers": | |
[ | |
{ | |
"characters": ".", | |
"selector": "source.python" | |
} | |
], | |
"close_windows_when_empty": false, | |
"color_scheme": "Packages/User/Tomorrow-Night (SL).tmTheme", |
OlderNewer