Skip to content

Instantly share code, notes, and snippets.

#Here's the command line to build a papervision3d (papervision 3d) swc file
#using only the flex 3 sdk. Saved here for posterity and google's benefit.
#run this command from the trunk/src directory:
compc -source-path=. -include-sources=. -output papervision3d-test.swc
function my_input($data)
{
$CI =& get_instance();
$val = $CI->db_session->flashdata($data['name']);
//print_r($CI->db_session->userdata());
if ($val) $data['value'] = $val;
return form_input($data);
}
@llimllib
llimllib / as3_unused_imports.py
Created February 25, 2009 17:44
run with "python as3_unused_imports.py <directory to search recursively>"
#!/usr/bin/python
import sys, re
from os import walk
from os.path import join as pathjoin
from pprint import pprint as pp
def parsef(f):
imports = []
notimports = []
for line in file(f):
//imagine you meant to type this:
var x:Array = [[],[]];
//But you typed this instead. These are compile-time syntax errors:
var x:Array = [[][]];
var x:Array = [["a"][]];
//But these are run-time errors:
var x:Array = [[]["b"]];
var x:Array = [["a"]["b"]];
from __future__ import with_statement
from functools import partial
import inspect
def accepts_block(f):
class _accepts_block(object):
#use something like this to handle calls without a with()?
def __call__(self, *args):
self.thefunction = partial(f, *args)
return self
These warehouse wages
Kill the ends introduction
man I should have schooled it up
When I was younger should have stuck to plan
Always had the dreams of being more self assertive
And my kids a teenager now he needs the health insurance
So break my body
Break break my soul down
Just another zombie walking blindly through your ghost town
Pull up to the bar to politic and tap the power
function title {
echo -ne "\033]0;$1\007"
}
#put this in your .bashrc, then just type <title my_tab_name> to set the tab title
#demonstrate nested list comprehensions as cartesian set
deck_of_cards = [(suit, rank) for suit in ("hearts", "diamonds", "spades", "clubs")
for rank in range(13)]
#######################################
#demonstrate functions as first-class values
def double_str(x):
return str(x) + str(x)
def parse_name(name):
#delete (nicknames)
name = re.sub("\(.*?\)", "", name)
names = name.split(" ")
first_name = names[0]
if len(names) > 2:
middle_names = [names[1]]
for i, n in enumerate(names[2:]):
gzip: stdin: unexpected end of file
Pinax-0.7.1-bundle/requirements/0.7.1/Markdown-2.0.1.tar.gz
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now