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
from weakref import WeakKeyDictionary | |
class TupleProperty: | |
def __init__(self, *default_value): | |
self.values = WeakKeyDictionary() | |
self.length = len(default_value) | |
self.default_value = default_value | |
def __get__(self, obj, cls=None): | |
if 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
(function () { | |
try { | |
if (!google.doodle) google.doodle = {}; | |
var a = 200, | |
g = -200, | |
j = -200, | |
k, l, m, n = 0, | |
o = 0, | |
p = 0, | |
q = 35, |
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
if(!jQuery('<input PLACEHOLDER="1" />')[0].placeholder){ //Uppercase attr for IE | |
jQuery(':input[placeholder]').each(function(){ | |
var $this = $(this); | |
if(!$this.val()){ | |
$this.val($this.attr('placeholder')); | |
$this.addClass('input-placeholder'); | |
} | |
}).live('focus', function(e){ | |
var $this = $(this); | |
if($this.hasClass('input-placeholder')){ |
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
var child_process = require('child_process'), | |
sys = require('sys'), | |
http = require('http'), | |
parse = require('url').parse, | |
fs = require('fs'); | |
var spawn = child_process.spawn; | |
var exec = child_process.exec; | |
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
# Add to ~/.bash_profile | |
function chrome() { | |
open $@ --args --allow-file-access-from-files | |
} | |
# Usage - chrome index.html | |
# now you don't have to worry about those pesky local XHR issues in Chrome. |
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
<!doctype html> | |
<title>client-side script.js node example</title> | |
<script src="script.js"></script> | |
<p>This is a little html page</p> |
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
The "WTH" Public License | |
Copyright (C) 2012 Paul Isaac | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
#. You can do whatever-the-heck you like with this code. |
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
" this is the configuration file for linux and mac systems | |
" symlink this to your home folder as .vimrc | |
" It loads pathogen and loads all modules from ~/.vim/bundles. | |
" It then loads ~/.vimrc_main which has the main | |
" configuration that works across all systems. | |
call pathogen#runtime_prepend_subdirectories(expand('~/.vim/bundles')) | |
call pathogen#helptags() | |
source ~/.vimrc_main |
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
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
OlderNewer