Skip to content

Instantly share code, notes, and snippets.

View adamlwgriffiths's full-sized avatar
💭
Working in a silo

Adam Griffiths adamlwgriffiths

💭
Working in a silo
  • Twisted Pair Development
  • Melbourne, Australia
View GitHub Profile
@adamlwgriffiths
adamlwgriffiths / pythonbrew command
Created January 16, 2012 00:38
pythonbrew install 2.7.2 on Mac OS-X 10.7 2012/01/16
Vibur:~ adamgriffiths$ pythonbrew install 2.7.2
Use the previously fetched /Users/adamgriffiths/.pythonbrew/dists/Python-2.7.2.tgz
Extracting Python-2.7.2.tgz into /Users/adamgriffiths/.pythonbrew/build/Python-2.7.2
This could take a while. You can run the following command on another shell to track the status:
tail -f /Users/adamgriffiths/.pythonbrew/log/build.log
Patching Python-2.7.2
Installing Python-2.7.2 into /Users/adamgriffiths/.pythonbrew/pythons/Python-2.7.2
ERROR: Failed to install Python-2.7.2. See /Users/adamgriffiths/.pythonbrew/log/build.log to see why.
@adamlwgriffiths
adamlwgriffiths / Versions
Created January 16, 2012 03:12
Kivy Mac OS-X issues
$ python -V
Python 2.7.2
$ cython -V
Cython version 0.15.1
@adamlwgriffiths
adamlwgriffiths / ssh terminal
Created January 17, 2012 07:41
optware installation on dlink 323
root@DLink-323:/# /ffp/start/transmission.sh stop
Stopping transmission-daemon
root@DLink-323:/# ps aux
PID USER COMMAND
1 root init
2 root [ksoftirqd/0]
3 root [events/0]
4 root [khelper]
5 root [kthread]
11 root [kblockd/0]
@adamlwgriffiths
adamlwgriffiths / AppDelegate.m
Created March 30, 2012 11:38
Hacks to get CocosBuilder working with Cocos1.x
<snip>
#import "Cocos+DefaultInits.h"
-(void) tryToRunFirstScene
{
CCDirector* director = [CCDirector sharedDirector];
// swizzle in our CCMenu fix for CCBuilder
{
MethodSwizzle( [CCLabelTTF class], @selector(init), @selector(initWithoutParams) );
@adamlwgriffiths
adamlwgriffiths / pip freeze
Created March 31, 2012 15:59
Pyglet environment information
(pygly)Vibur:src adamgriffiths$ pip freeze
Cython==0.15.1
PIL==1.1.7
cocos2d==0.5.0
numpy==1.6.1
pyglet==1.2dev
pyobjc==2.2
pyobjc-core==2.2
pyobjc-framework-AddressBook==2.2
pyobjc-framework-AppleScriptKit==2.2
@adamlwgriffiths
adamlwgriffiths / fix_codecs.py
Created April 26, 2012 04:23
Fix Pyglet textures loading as greyscale in OS-X due to issues in the Quartz loader
import sys
import pyglet
# on OS-X 10.7 (lion)
# the Quartz codec is buggered in Pyglet
if sys.platform == 'darwin':
# clear the existing codecs
pyglet.image.codecs._decoders = []
pyglet.image.codecs._decoder_extensions = {}
@adamlwgriffiths
adamlwgriffiths / test_glfw.py
Created February 13, 2013 11:59
Example of creating an OpenGL core profile (3.2) in pyGLFW. This uses patches from my fork (https://github.com/adamlwgriffiths/pyglfw) which will hopefully be integrated soon.
import glfw
from OpenGL.GL import *
glfw.Init()
glfw.OpenWindowHint( glfw.OPENGL_VERSION_MAJOR, 3);
glfw.OpenWindowHint( glfw.OPENGL_VERSION_MINOR, 2)
glfw.OpenWindowHint( glfw.OPENGL_FORWARD_COMPAT, GL_TRUE)
glfw.OpenWindowHint( glfw.OPENGL_PROFILE, glfw.OPENGL_CORE_PROFILE)
class VertexBuffer:
def __init__( self, data = None, nbytes = None, handle = None ):
self.handle = handle
if not self.handle:
self.handle = glGenBuffers( 1 )
if data:
nbytes = data.nbytes
@adamlwgriffiths
adamlwgriffiths / test_flask_security.py
Created May 7, 2014 03:23
Testing flask security auth issues
from flask import Flask, Blueprint, Response, request, request_finished, request_started
from flask.views import MethodView
from flask.ext.security import Security, MongoEngineUserDatastore, UserMixin, RoleMixin, current_user, auth_required, login_required
from flask.ext.security.utils import login_user, verify_password, encrypt_password
from flask.ext.security.decorators import _check_token
import mongoengine
from mongoengine import StringField, BooleanField, DateTimeField, ListField, ReferenceField, LongField, ObjectIdField
from flask.ext.mongoengine import MongoEngine, Document
import json
Process: python2.7 [557]
Path: /Users/USER/*/python
Identifier: python2.7
Version: ???
Code Type: X86-64 (Native)
Parent Process: bash [443]
Responsible: iTerm [427]
User ID: 501
Date/Time: 2014-06-13 03:16:45.990 +1000