Skip to content

Instantly share code, notes, and snippets.

View wolever's full-sized avatar

David Wolever wolever

View GitHub Profile
class Boomstick(Achievement):
name = "This is my Boomstick"
description = "checking in code which uses every single function " +
"in itertools"
def __init__(self):
import itertools
self.needed = set(export for export in dir(itertools)
if not export.startswith("_"))
package utils.testlisteners {
import flash.external.ExternalInterface;
import mx.events.DynamicEvent;
/**
* Reports the results of a TextTestListener into the browser, using HTML
* instad of Flash.
*/
See: http://bitbucket.org/wolever/hg-setpath
package utils {
import org.flexunit.internals.runners.statements.IAsyncStatement;
import org.flexunit.internals.runners.statements.MethodRuleBase;
import org.flexunit.rules.IMethodRule;
import org.flexunit.runners.model.FrameworkMethod;
import org.flexunit.token.AsyncTestToken;
import org.flexunit.token.ChildResult;
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" xmlns:text="flash.text.*">
<mx:Script><![CDATA[
import flash.utils.setTimeout;
protected function range(n:int):Array {
var result:Array = [];
while (n-- > 0)
result.push(n);
return result;
}
#!/bin/bash
set -e
if [[ `whoami` != "root" ]]
then
echo "Gotta be root..."
exit $?
fi
#!/usr/bin/env python
"""
Usage: fixpackages SRC_DIR [SRC_DIR ...]
Fix actionscript packages by updating the 'package <name>' statement in
applicable files and updating any import statements which reference the
old package.
To use:
- Move files to their new locations (eg, src/old/Foo.as to src/new/Foo.as)
package serialization {
import flash.utils.ByteArray;
import utils.logger.Log;
/**
* Serializes 'obj'. If serialization fails, tries really hard to figure
* out what caused it to fail.
*/
#!/usr/bin/env python
"""
Exports a list of all image files in a Lightroom catalog.
Known issues:
- Doesn't understand virtual copies (the original filename will be listed once
for each virtual copy)
- Hard-coded to sort by capture time (see "ORDER BY" clause in
'list_collection')
"""
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.