Skip to content

Instantly share code, notes, and snippets.

View How To Build a Papervision3d swc from the command line
#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
View gist:21206
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 Feb 25, 2009
run with "python as3_unused_imports.py <directory to search recursively>"
View as3_unused_imports.py
#!/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):
View gist:78675
//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"]];
View bmap.py
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
View gist:206944
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
View title function
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
View gist:247442
#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)
View gist:255011
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:]):
View gist:267167
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
You can’t perform that action at this time.