Skip to content

Instantly share code, notes, and snippets.

View davedash's full-sized avatar
🏠
Working from home

Dave Dash davedash

🏠
Working from home
View GitHub Profile
from django.conf import settings
from django.core.cache import parse_backend_uri
try:
import redis as redislib
except:
redislib = None
connections = {}
@davedash
davedash / vimrc
Created January 12, 2011 21:13
Statusline and keybindings for sp/vsp
set statusline= " my status line contains:
set statusline+=%n: " - buffer number, followed by a colon
set statusline+=%<%f " - relative filename, truncated from the left
set statusline+=\ " - a space
set statusline+=%h " - [Help] if this is a help buffer
set statusline+=%m " - [+] if modified, [-] if not modifiable
set statusline+=%r " - [RO] if readonly
set statusline+=%2*%{HasLocalDir()}%* " [lcd] if :lcd has been used
set statusline+=\ " - a space
set statusline+=%1*%{TagInStatusLine()}%* " [current class/function]
@davedash
davedash / gist:867094
Created March 12, 2011 06:43
Faceted queries
s = query.Search(query.StringQuery('jetpack'))
s.facet.add_term_facet('_type')
r = es.search(s, 'flightdeck')
○ cat ~/.virtualenvs/postmkvirtualenv
proj_name=$(echo $VIRTUAL_ENV|awk -F'/' '{print $NF}')
mkdir $HOME/Projects/$proj_name
add2virtualenv $HOME/Projects/$proj_name
cd $HOME/Projects/$proj_name
easy_install readline ipython
pip install -e git://github.com/jbalogh/check.git#egg=check Jinja2==2.3.1 \
MySQL-python==1.2.3c1 lxml==2.2.6 PIL
__
.' .7 .-._._
." ." _._' ." ".
( { _." "` ,-. '
`. `"" 6' .' ' &
"._ .'___..--..._ _.-"
"-..._ """ ""-.--"
; ,__, `.
j (oo)____ ;
.' (__) )\ j
@davedash
davedash / github.com.css
Created September 16, 2011 21:27
[dotjs] Show what items are closed in github
span.closed {
background: red;
padding: 5px;
border-radius: 15px;
}
@davedash
davedash / linkedin.com.js
Created November 21, 2011 19:59
Uncheck Share details with InMail notifications on LinkedIn?
// uncheck share details
var checkbox = $('input[name=provideContact]');
if (checkbox) {
checkbox.attr('checked', false);
checkbox.change();
}
@davedash
davedash / prefs.json
Created January 18, 2012 21:33
subl2 prefs
{
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"ensure_newline_at_eof_on_save": true,
"font_size": 13.0,
"rulers":
[
79
],
"translate_tabs_to_spaces": true,
"trim_trailing_white_space_on_save": true,
@davedash
davedash / hover.com.js
Created February 6, 2012 17:55
Add Danica Patrick to Hover.com so you don't miss anything from GoDaddy.
var img = "http://i2.cdn.turner.com/si/2009/writers/bruce_martin/05/08/Danica/danica-patrick-milk.jpg"
$('a.videoClip').css('background', 'url("'+img+'") no-repeat scroll left -40px transparent').css('background-size', '105%');
curl http://10.8.81.212:9200/input/_search\?pretty=true -d '
{
"query" : {
"matchAll" : {}
}
}'