Skip to content

Instantly share code, notes, and snippets.

@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:

<!--[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 / 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;
}
[[ -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 / 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)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@r4vi
r4vi / chkadm.py
Created April 12, 2011 11:10
checks if the current logged in user is removed from the local administrators group and re-adds. (windows)
import ctypes
import win32net, win32api
import time
current_user = win32api.GetUserNameEx(2)
data = [{"domainandname": current_user}]
def get_members(group_name):
members = win32net.NetLocalGroupGetMembers(None, group_name, 3)[0]
print members
@r4vi
r4vi / gist:1977971
Created March 5, 2012 11:45
eval in lisp
(defun eval. (e a)
(cond
((atom e) (assoc. e a))
((atom (car e))
(cond
((eq (car e) 'quote) (cadr e))
((eq (car e) 'atom) (atom (eval. (cadr e) a)))
((eq (car e) 'eq) (eq (eval. (cadr e) a)
(eval. (caddr e) a)))
((eq (car e) 'car) (car (eval. (cadr e) a)))
/* ShowOff JS Logic */
var ShowOff = {};
var preso_started = false
var slidenum = 0
var slideTotal = 0
var slides
var currentSlide
var totalslides = 0
@r4vi
r4vi / bubbles.clj
Created July 22, 2012 01:02
Quill Examples
(ns quil-ravi.core
(:use quil.core))
(defn setup []
(smooth) ;;Turn on anti-aliasing
(frame-rate 65) ;;Set framerate to 1 FPS
(background 200)) ;;Set the background colour to
;; a nice shade of grey.
(defn savef []