Skip to content

Instantly share code, notes, and snippets.

View albohlabs's full-sized avatar

Daniel Pfefferkorn albohlabs

View GitHub Profile
@encukou
encukou / unpacking_property.py
Last active August 29, 2015 13:57
Unpacking property example
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:
(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,
@albohlabs
albohlabs / gist:1118627
Created August 1, 2011 17:49 — forked from westonruter/gist:311373
JavaScript: jQuery fallback implementation of HTML5 placeholder attribute
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')){
anonymous
anonymous / video.js
Created October 21, 2011 18:57
Node js on the fly video conversion
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;
@JeffreyWay
JeffreyWay / gist:1544440
Created December 31, 2011 16:06
Local XHR in Chrome
# 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.
@derek
derek / gist:1599415
Created January 12, 2012 08:28
YUI Open Hours - Jan 12th, 2012

YUI Open Hours for Jan 12th, 2012

Buttonpalooza!

stupid lolcat .
.
.
.
.
.

<!doctype html>
<title>client-side script.js node example</title>
<script src="script.js"></script>
<p>This is a little html page</p>
@iznax
iznax / License.txt
Created March 4, 2012 00:29
Mini Invaders
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.
@cloud8421
cloud8421 / .vimrc
Created March 7, 2012 08:26 — forked from napcs/.vimrc
Set up Vim on Mac or Linux. curl https://raw.github.com/gist/532968/vim.sh | sh
" 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
@albohlabs
albohlabs / hack.sh
Created March 31, 2012 13:10 — forked from erikh/hack.sh
OSX For Hackers
#!/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
#