Get it from the App Store.
In XCode's Preferences > Downloads you can install command line tools.
"""Utilities for managing database sessions.""" | |
from __future__ import with_statement | |
import contextlib | |
import functools | |
@contextlib.contextmanager | |
def temp_session(session_cls, **kwargs): | |
"""Quick and dirty context manager that provides a temporary Session object | |
to the nested block. The session is always closed at the end of the block. |
<?php | |
/** | |
* UUID class | |
* | |
* The following class generates VALID RFC 4122 COMPLIANT | |
* Universally Unique IDentifiers (UUID) version 3, 4 and 5. | |
* | |
* UUIDs generated validates using OSSP UUID Tool, and output | |
* for named-based UUIDs are exactly the same. This is a pure | |
* PHP implementation. |
" Author: Bernardo Fontes <[email protected]> | |
" Website: http://www.bernardofontes.net | |
" This code is based on this one: http://www.cmdln.org/wp-content/uploads/2008/10/python_ipdb.vim | |
" I worked with refactoring and it simplifies a lot the remove breakpoint feature. | |
" To use this feature, you just need to copy and paste the content of this file at your .vimrc file! Enjoy! | |
python << EOF | |
import vim | |
import re | |
ipdb_breakpoint = 'import ipdb; ipdb.set_trace()' |
function F(){} | |
Object.defineProperty(F.prototype, 'foo', { | |
get: function(){ return F._foo; }, | |
set: function(value){ F._foo = value; } | |
}); | |
var obj = new F(); | |
obj.foo; // undefined | |
obj.foo = 1; |
function! Jump2PrevDiffText() | |
let line=line(".") | |
let idx=col(".")-1 | |
if synIDattr(diff_hlID(line, idx), "name")=="DiffChange" || synIDattr(diff_hlID(line, idx), "name")=="DiffText" | |
while idx>0 | |
if synIDattr(diff_hlID(line, idx), "name")=="DiffText" && synIDattr(diff_hlID(line, idx-1), "name")!="DiffText" | |
call setpos(".", [0,line,idx]) | |
break | |
elseif idx==1 | |
let line=line(".") |
#!/bin/bash | |
VENV=$1 | |
if [ -z $VENV ]; then | |
echo "usage: runinenv [virtualenv_path] CMDS" | |
exit 1 | |
fi | |
. ${VENV}/bin/activate | |
shift 1 | |
echo "Executing $@ in ${VENV}" | |
exec "$@" |
// ============================================================ | |
// Objects vs Primitives | |
// To make a long story short, use primitives wherever you can. | |
// ============================================================ | |
// Primitive types: Null, Undefined, Number, Boolean, String. | |
var num1 = 9000, | |
num2 = new Number( 9000 ), | |
str1 = "hello world", |
/** | |
* Provides requestAnimationFrame in a cross browser way. | |
* @author paulirish / http://paulirish.com/ | |
*/ | |
if ( !window.requestAnimationFrame ) { | |
window.requestAnimationFrame = ( function() { | |
return window.webkitRequestAnimationFrame || |
--- pytc.c.orig 2011-12-01 02:31:54.000000000 +0400 | |
+++ pytc.c 2011-12-01 02:32:21.000000000 +0400 | |
@@ -1555,14 +1555,15 @@ | |
int max; | |
TCLIST *list; | |
char *prefix; | |
+ int prefix_len; | |
static char *kwlist[] = {"prefix", "max", NULL}; | |
- if (!PyArg_ParseTupleAndKeywords(args, keywds, "si:rangefwm", kwlist, |