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
String.prototype.trim = function() { | |
return this.replace(/^\s+|\s+$/g,""); | |
} | |
Element.implement({ | |
hide:function() { | |
this.set_disp_val(); | |
this.setStyle('display','none'); | |
return this; | |
}, |
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
set nocompatible | |
source $VIMRUNTIME/mswin.vim | |
behave mswin | |
set diffexpr=MyDiff() | |
function! MyDiff() | |
let opt = '-a --binary ' | |
if &diffopt =~ 'icase' | let opt = opt . '-i ' | endif | |
if &diffopt =~ 'iwhite' | let opt = opt . '-b ' | endif |
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
let SessionLoad = 1 | |
if &cp | set nocp | endif | |
let s:so_save = &so | let s:siso_save = &siso | set so=0 siso=0 | |
let v:this_session=expand("<sfile>:p") | |
silent only | |
if expand('%') == '' && !&modified && line('$') <= 1 && getline(1) == '' | |
let s:wipebuf = bufnr('%') | |
endif | |
set shortmess=aoO | |
badd +1 Z:\project\app\views.py |
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 | |
# | |
# tmux.sh - example for Django/compass/hamlpy tmux dev setup | |
# | |
mydir=/home/dev/movietempest | |
source $mydir/env-django-1.3.2/bin/activate | |
py=$mydir/env-django-1.3.2/bin/python | |
aliaspy=alias py="$py" | |
ses=mt |
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
#SingleInstance force | |
SetTitleMatchMode 2 ; Anywhere in title | |
SetTitleMatchMode Fast | |
SendMode Input | |
#IfWinExist Hype Machine | |
{ | |
^+d:: | |
WinActivate | |
return |
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
get_kiosk_html : function(mode) { | |
mode = mode || 'side'; | |
var ret_html = '', | |
icon_status = (this.avail == 1) ? 'on' : 'off', | |
class_str = this.prov + ' ' + icon_status, | |
el_id = this.prov + '_' + this.prov_index, | |
html_vals = { | |
id: el_id + '__' + mode, | |
ctrls: this.get_controls(), | |
cls: class_str, |
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
// "%s is great".printf('This') | |
// -> This is great | |
// | |
// "{bar} or {foo}".printf({foo:'A',bar,'B'}) | |
// -> B or A | |
// | |
// "{}, {}, {}!".printf([1,2,3]) | |
// -> 1, 2, 3! | |
String.prototype.printf = function (obj) { |
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
//gets the first matching ancestor up the tree, or returns false | |
//cond can be 'tag', '.classname', '#id-name', Element | |
Element.implement({ | |
grabParent: function(cond,include_self) { | |
var parents = this.getParents(), | |
true_cond = '', | |
ret = false, | |
el, | |
i; | |
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
<?php | |
// -------------------------------- | |
// Plain Redis + phpredis | |
// -------------------------------- | |
$redis = new Redis(); | |
$redis->connect('127.0.0.1'); | |
$cache = $redis->get('key'); |
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
<?php | |
// Needs a global $redis_config | |
function get_redis($force=false) { | |
global $redis_config,$redis_instance; | |
if(!is_object($redis_config)) | |
die("Couldn't find \$redis_config or it's not an object!"); | |
// No redis? No problem! |
OlderNewer