Skip to content

Instantly share code, notes, and snippets.

@NotSqrt
NotSqrt / settings_test_snippet.py
Last active May 1, 2022 01:34 — forked from nealtodd/settings_test_snippet.py
Another shot at this problem ..
class DisableMigrations(object):
def __contains__(self, item):
return True
def __getitem__(self, item):
return "notmigrations"
MIGRATION_MODULES = DisableMigrations()
@jjmalina
jjmalina / pre-commit
Last active October 1, 2015 11:17
Git pre-commit hook stolen from Yipit's blog
#!/usr/bin/env python
import os
import re
import subprocess
import sys
modified = re.compile('^(?:M|A)(\s+)(?P<name>.*)')
CHECKS = [
@pamelafox
pamelafox / base_tests.py
Created January 17, 2012 02:29
Python Selenium Base TestCase
import unittest
import datetime
from sys import *
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
import login_dom
class BaseTests(unittest.TestCase):
@lsemel
lsemel / capture_extension.py
Created May 22, 2011 20:26
Jinja2 capture extension, inspired by Rails content_for blocks
from jinja2 import nodes
from jinja2.ext import Extension
class CaptureExtension(Extension):
"""
Generic HTML capture, inspired by Rails' capture helper
In any template, you can capture an area of content and store it in a global
variable:
@guenter
guenter / move_to_rds.rb
Created November 11, 2010 02:14
A quick and dirty script to move a database into Amazon RDS (or any other database). Can transfer part of the data beforehand.
require 'fileutils'
start_time = Time.now
SOURCE_DB = {
:name => 'db_name',
:user => 'db_user',
:password => 'db_pass',
:host => 'localhost'