Skip to content

Instantly share code, notes, and snippets.

View stuaxo's full-sized avatar
💭
 

Stuart Axon stuaxo

💭
 
View GitHub Profile
@stuaxo
stuaxo / horizontal_checkboxes.py
Created February 27, 2014 17:05
attempt to make django checkboxes horizontal
class SomeModelForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
super(MessageModelForm, self).__init__(*args, **kwargs)
for f in self.fields.values():
if isinstance(f.widget, widgets.CheckboxInput):
f.widget.attrs.update({'class': "checkbox inline"})
# Superceded by this: https://gist.github.com/stuaxo/9308767
import Queue
import sys
import time
import select
import tty
import termios
from threading import Thread
@stuaxo
stuaxo / nodebox_color_test.py
Last active August 29, 2015 13:58
Shoebot/Nodebox color test
import random
random.seed(1)
size(550,450)
background(1,1,1)
colors=ximport("colors")
clr3 = colors.named_color("#DD7100")
clr4 = colors.named_color("yellowy")
@stuaxo
stuaxo / ipython_cairo.ipynb
Last active August 29, 2015 14:02
Display Hooks for pycairo, cairocffi Surfaces and Contexts.\n
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@stuaxo
stuaxo / rec_to_mp3.cmd
Created November 15, 2014 23:48
VLC - transcode .rec to mp3.
vlc -I dummy -vvv %1 --sout=#transcode{acodec="mp3",ab="512","channels=2"}:standard{access="file",mux="raw",dst="%~n1.mp3"} vlc://quit
@stuaxo
stuaxo / vext_test.py
Created February 13, 2015 15:07
Testing vext
if __name__ == '__main__':
try:
for name in ['cairo', 'gtk', 'pygtk', 'hello']:
try:
m = __import__(name)
print '%s: %s' % (name, m)
except Exception as e:
print '%s: %s' % (e.__class__.__name__, str(e))
print ''
@stuaxo
stuaxo / setup.py
Last active August 29, 2015 14:16
Install file to site_packages root on windows as well as linux
"""
Install a file into the root of sitepackages on windows as well as linux.
Under normal operation on win32 path_to_site_packages
gets changed to '' which installs inside the .egg instead.
"""
import os
from distutils import sysconfig
@stuaxo
stuaxo / field_linux64_bork.txt
Last active August 29, 2015 14:17
Field64 bork.txt
./field_linux64_mozilla.sh
/home/stu/projects/external/Field/Contents/linux/..
rm: cannot remove ‘../core/classes/org/eclipse/swt’: No such file or directory
Listening for transport dt_socket at address: 5555
hello
## trampoline <class field.bytecode.protect.StandardTrampoline:sun.misc.Launcher$AppClassLoader@6f171e30>
warning: wildcard path </home/marc/fieldwork/personal/classpath/**> is not a directory or does not exist
warning, path </home/stu/projects/external/Field/Contents/linux/../extensions/../extras/syphon/bin>added to classpath through Field-RedirectionPath inside extension /home/stu/projects/external/Field/Contents/linux/../extensions/syphon.mf doesn't exist
warning, path </home/stu/projects/external/Field/Contents/linux/../extensions/../extras/gstreamer/bin>added to classpath through Field-RedirectionPath inside extension /home/stu/projects/external/Field/Contents/linux/../extensions/gstreamer.mf doesn't exist
warning, path </home/stu/projects/external/Field/Contents/linux/../extensions/..
@stuaxo
stuaxo / no_draw_if_gi_is_symlink.py
Created April 20, 2015 15:59
Draw events do not happen if 'gi' is a symlink
@stuaxo
stuaxo / create_toolchain.sh
Last active August 29, 2015 14:23
Create android standalone toolchains
#!/bin/bash
# Either pass in the dest directory, or will install to current dir
# from
# https://gist.github.com/bongole/304a006a5386220246aa
for arch in armv7-a x86 x86_64; do
echo "Create standalone for $arch"
case $arch in
arm*)