Skip to content

Instantly share code, notes, and snippets.

@brousch
brousch / install_pygame.sh
Last active August 19, 2018 14:39
A script to install Pygame 1.9.1 into a Python2.7 virtualenv on Ubuntu 12.04. Make sure you have activated the virtualenv before running this script or it will install Pygame system-wide.
#!/bin/sh
BASE_PATH=`pwd`
sudo apt-get build-dep python-pygame
sudo apt-get install python-dev libsdl-image1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libsdl1.2-dev libsmpeg-dev python-numpy subversion libportmidi-dev ffmpeg libswscale-dev libavformat-dev libavcodec-dev libv4l-dev
cd /usr/include/linux
sudo ln -s ../libv4l1-videodev.h videodev.h
cd $BASE_PATH
wget http://www.pygame.org/ftp/pygame-1.9.1release.tar.gz
tar -xzf pygame-1.9.1release.tar.gz
cd pygame-1.9.1release
@brousch
brousch / main.py
Created October 18, 2013 20:55 — forked from tshirtman/main.py
class MediaPlayer(object):
'''
MediaPlayer object is used to avoid keeping multiple sound files in memory
'''
def __init__(self):
self._media_player = None
def play_sound(self, soundfile, volume):
if not soundfile.startswith('/'):
soundfile = join(getcwd(), 'sounds', soundfile)
@brousch
brousch / main.py
Last active August 29, 2015 13:56
size_hint bug demo
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout
kv = """
<Test>:
orientation: 'horizontal' if root.width > root.height else 'vertical'
Button:
text: "Button1\\n{}x{}".format(self.width, self.height)
@brousch
brousch / main.py
Created March 7, 2014 18:47
Kivy bug with original transparent image remaining in the background after it has been resized. There should be only a large red circle, the small one should be gone.
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.image import Image
kv = '''
<FullImage>:
canvas:
Rectangle:
texture: self.texture

BarCamp is a technology & design unconference where the attendees determine what's on the schedule. This ad-hoc conference is an intense event with discussions, demos, and a lively hallway track that attracts some of Grand Rapids' best and brightest. Sponsors have their brand associated with one of Grand Rapids' most unique events and have access to an engaged, enthusiastic audience. Attendees know that these companies are as forward-thinking and tech-savvy as they are.

@brousch
brousch / make.bat
Last active May 27, 2024 01:08
A Windows batch file to install GNU Make into the current dir and/or run Make once it's installed
IF EXIST %~dp0\make\bin\make.exe (GOTO makeinstalled) ELSE (GOTO installmake)
:installmake
bitsadmin.exe /transfer GetGNUMakeBinaries http://downloads.sourceforge.net/project/gnuwin32/make/3.81/make-3.81-bin.zip %~dp0\makebins.zip
unzip makebins.zip -d make
del makebins.zip
bitsadmin.exe /transfer GetGNUMakeDependencies http://downloads.sourceforge.net/project/gnuwin32/make/3.81/make-3.81-dep.zip %~dp0\makedeps.zip
unzip makedeps.zip -d make
del makedeps.zip