Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@r4vi
r4vi / testrunner.py
Created July 21, 2015 08:44
no db test runner
from django.test.runner import DiscoverRunner
from django.conf import settings
class NoDbTestRunner(DiscoverRunner):
""" A test runner to test without database creation """
def __init__(self, *args, **kwargs):
kwargs['top_level'] = settings.APPS_ROOT
super(NoDbTestRunner, self).__init__(*args, **kwargs)
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
export GITAWAREPROMPT=~/opt/git-aware-prompt
source $GITAWAREPROMPT/main.sh
export PS1="\u@\h \w \[$txtcyn\]\$git_branch\[$txtred\]\$git_dirty\[$txtrst\]\$ "
export SUDO_PS1="\[$bakred\]\u@\h\[$txtrst\] \w\$ "
export EDITOR='emacsclient -t'
@r4vi
r4vi / ga.css
Created January 19, 2015 23:13
stylebot rule for google analytics
a.maia-button.maia-button-secondary.ga-product-cta {
font-size: 12rem;
}
div.ga-hero img {
display: none;
}
<!--[if lte IE 9]>
<div class="legacy-browser">
<h1>:(</h1>
<p>This service is <strong>not</strong> designed to support your browser.</p>
<p>Please <a href="http://browsehappy.com/">upgrade</a> to the latest version of Chrome, Firefox, Safari or Internet Explorer 11 and above.</p>
</div>
<![endif]-->
@r4vi
r4vi / keybase.md
Created September 19, 2014 13:19
keybase.md

Keybase proof

I hereby claim:

  • I am r4vi on github.
  • I am r4vi (https://keybase.io/r4vi) on keybase.
  • I have a public key whose fingerprint is F8E4 91B4 4765 9C8C A11C 09A8 A48B 120F E8C8 1295

To claim this, I am signing this object:

@r4vi
r4vi / gist:8008148
Created December 17, 2013 16:48
python threading
#!/usr/bin/python
import threading
import time
class Sleepy(threading.Thread):
def run(self):
time.sleep(5)
@r4vi
r4vi / optimize.sh
Last active December 15, 2015 02:29 — forked from ryansully/optimize.sh
handles files with spaces in the name and keeps EXIF in jpeg
#!/bin/sh
# script for optimizing images in a directory (recursive)
# pngcrush & jpegtran settings from:
# http://developer.yahoo.com/performance/rules.html#opt_images
# pngcrush
find $1 -iname "*.png" | while read png
do
echo "crushing $png ..."
@r4vi
r4vi / index.html
Created December 1, 2012 22:55 — forked from mbostock/.block
World Countries
<!DOCTYPE html>
<meta charset="utf-8">
<style>
.country {
fill: #b8b8b8;
stroke: #fff;
stroke-width: .5px;
stroke-linejoin: round;
}