Skip to content

Instantly share code, notes, and snippets.

View fish2000's full-sized avatar
👉
My Python work is on the Mars helicopter, and ubiquitous on earth, and more!!!!

Alexander Böhn fish2000

👉
My Python work is on the Mars helicopter, and ubiquitous on earth, and more!!!!
  • Objects in Space and Time, LLC
  • Baltimore, MD
  • 05:03 (UTC -04:00)
  • X @fish2000
View GitHub Profile
@fish2000
fish2000 / more-gifsicle-treats.txt
Created February 22, 2012 06:06
More Gifsicle Treats (1.64)
ASIO-OTUS:tmp$ brew edit gifsicle
ASIO-OTUS:tmp$ brew -v upgrade gifsicle
Homebrew 0.8.1
==> Upgrading gifsicle
==> Downloading http://www.lcdf.org/gifsicle/gifsicle-1.64.tar.gz
/usr/bin/curl -qf#LA Homebrew 0.8.1 (Ruby 1.8.7-249; Mac OS X 10.7.3) http://www.lcdf.org/gifsicle/gifsicle-1.64.tar.gz -o /Users/fish/Library/Caches/Homebrew/gifsicle-1.64.tar.gz
######################################################################## 100.0%
/usr/bin/tar xf /Users/fish/Library/Caches/Homebrew/gifsicle-1.64.tar.gz
==> ./configure --disable-dependency-tracking --prefix=/usr/local/Cellar/gifsicle/1.64 --enable-all
./configure --disable-dependency-tracking --prefix=/usr/local/Cellar/gifsicle/1.64 --enable-all
@fish2000
fish2000 / schrodingers-django-settings-env-setting.py
Created July 13, 2012 21:38
Use either the DJANGO_SETTINGS_MODULE if it's defined but fall back to a default if it's not
os.environ['DJANGO_SETTINGS_MODULE'] = os.environ.get(
'DJANGO_SETTINGS_MODULE',
'distributors.settings') or 'distributors.settings'
@fish2000
fish2000 / DefineSpecsAsModules.coffee
Created July 14, 2012 19:31
Mixing Require.js, Jasmine, Sinon.js and Backbone.
## ItemView.coffee in the specs/coffee folder ##
define ["ItemView"], (ItemView) ->
###
Specs for ItemView
###
describe "Item View", ->
###
Common setup and teardown
@fish2000
fish2000 / incoherent-comments-blather.py
Created July 14, 2012 19:33
Rather incoherent comments/notes/blather and snippets from the coffee script distutils thing
# `catty_files` contain
# They are a simple intermediate used by `uglify` -- at this point in the program,
# this list contains non-existant filenames constructed from the original CoffeeScript
# source filenames.
self.catty_files = [basename(cs_file).replace('.coffee', '.libs.js') for cs_file in self.distribution.cs_files]
# They are a simple intermediate used by `uglify` -- at this point in the program,
# this list contains non-existant filenames constructed from the original CoffeeScript
@fish2000
fish2000 / viron-test-text.txt.py
Created July 14, 2012 21:19
Block of text from testing Viron
DEBUG = True
TM_SELECTED_FILE = $TM_SELECTED_FILE
COMMAND_MODE = $COMMAND_MODE
TM_PROJECT_FILEPATH = $TM_PROJECT_FILEPATH
DJANGO_SETTINGS_MODULE = $DJANGO_SETTINGS_MODULE
$
@fish2000
fish2000 / pybindgen-example.py
Created July 14, 2012 21:21
Bare-bones PyBindGen example cobbled together from several peoples' incoherent blog entries
import sys
import os
import pybindgen
from pybindgen import FileCodeSink
from pybindgen.gccxmlparser import ModuleParser
module_parser = ModuleParser('CImg', 'cimg_library')
module = module_parser.parse(['/Users/fish/Dropbox/cython-imaging/CIL/ext/include/CImg.h'])
module.add_include('<CImg.h>')
module.generate(FileCodeSink(sys.stdout))
@fish2000
fish2000 / code-reload-kill-gunicorn.sh
Created July 14, 2012 21:24
Code-reloading snippet (for development work) using python-watchdog to kill GUnicorn with HUPs when files change
ASIO-OTUS:ost2[ost5-writers-block •]$ ost
+ Switching to /Users/fish/Dropbox/ost2
ASIO-OTUS:ost2[ost5-writers-block •]$ cd /tmp
ASIO-OTUS:tmp$ /usr/local/share/python/watchmedo shell-command --patterns="*.py;*.txt;*.html;*.css;*.js" --recursive --command='kill -HUP $(cat /usr/local/gunicorn/gunicorn.pid)' /Users/fish/Dropbox/ost2/ost2/
^C^C
ASIO-OTUS:tmp$ /usr/local/share/python/watchmedo shell-command --patterns="*.py;*.txt;*.html;*.css;*.js" --recursive --command='echo ${watch_src_path}' /Users/fish/Dropbox/ost2/ost2/
@fish2000
fish2000 / dajaxice-client-js-template-possibly-outdated.js
Created July 14, 2012 21:26
Client JS template used by Dajaxice (possibly outdated)
var Dajaxice = {
{% for module in dajaxice_js_functions %}
{% include "dajaxice/dajaxice_core_loop.js" %}
{% endfor %}{% ifnotequal dajaxice_js_functions|length 0 %},{% endifnotequal %}
get_cookie: function(name)
{
var cookieValue = null;
if (document.cookie && document.cookie != '') {
@fish2000
fish2000 / forsale-urlconf-update-regexp.txt
Created July 14, 2012 21:28
Not sure why I bothered to keep this file around
^ url\(r'\^(\w+)\/(.+)', '(.+)'\)\,
url(r'$1/$2',
'$3', name='$1'),
@fish2000
fish2000 / GIST.c
Created July 14, 2012 21:31
C implementation of GIST (as in image-feature detection, rather than snippets of code) using FFTW, by a chap named Lear
/* Lear's GIST implementation, version 1.0, (c) INRIA 2009, Licence: GPL */
/*--------------------------------------------------------------------------*/
#ifdef USE_GIST
/*--------------------------------------------------------------------------*/
#include <math.h>
#include <stdio.h>
#include <string.h>