Skip to content

Instantly share code, notes, and snippets.

View makokal's full-sized avatar
🤖

Billy makokal

🤖
View GitHub Profile
@makokal
makokal / circle_random.py
Created October 8, 2013 12:19
Generate random points in a circle
# generate random points in a circle
import numpy as np
import pylab as plt
num_samples = 1000
# make a simple unit circle
theta = np.linspace(0, 2*np.pi, num_samples)
@makokal
makokal / pygame_install.sh
Created October 2, 2013 10:18
Install pygame ubuntu
# tested on ubuntu 12.04
# dependencies
sudo apt-get install libsdl1.2-dev libsdl-image1.2-dev libsdl-ttf2.0-dev libsdl-mixer1.2-dev libsmpeg-dev libportmidi-dev
# pygame
sudo pip install hg+http://bitbucket.org/pygame/pygame
@makokal
makokal / dot_latexmkrc
Created September 19, 2013 17:19
Set evince as default viewer in ubuntu when using latemk
$pdf_previewer = "start evince";
$pdf_update_method = 0;
@makokal
makokal / stage_install_mac.sh
Created August 19, 2013 19:03
Installing stage 2D robot simulator on a mac (with homebrew already setup)
#install dependencies
brew install fltk cmake git pkg-config
# setup an install location e.g in home
mkdir $HOME/stg
# clone and compile stage
mkdir stage && cd stage
git clone git://github.com/rtv/Stage.git
export STG=$HOME/stg
#!/usr/bin/perl -w
use strict;
my @rmdirs = ('.svn');
my @rmfiles = ();
sub filelist
{
my ($dir, $regex) = @_;
opendir(DIR, $dir) || return ();
@makokal
makokal / count_svn
Created May 15, 2013 16:48
count svn commits per user
svn log -v --xml | grep '<author.*/author>' | sort $* | uniq -c | sort -rn
@makokal
makokal / gist:4635535
Created January 25, 2013 16:00
Make a video from images using mencoder
mencoder "mf://*.png" -mf fps=20 -o video_name.avi -ovc lavc -lavcopts vcodec=msmpeg4v2:vbitrate=800
@makokal
makokal / gist:4635508
Created January 25, 2013 15:57
Batch rename a number of files appending 0s before extension to preserve alphabetical ordering e.g. after collecting images from camera to make a video with mencoder
# EXT is the extension of the files
rename 's/(\d+)\.EXT/sprintf("%03d.EXT", $1)/e' *.EXT
@makokal
makokal / zip_changed.sh
Created September 16, 2012 19:33
Zip all local modification in a svn repo
#!/bin/sh -e
if [ $# -ne 2 ]; then
echo usage: $0 working_copy_path zip_file_path
exit 1
fi
cd $1 && svn status | grep ^[AM] | awk '{print $2}' | zip $2 -@
echo "Done"
@makokal
makokal / januspimp.sh
Created August 8, 2012 21:31
additional vim plugins on top of janus setup
!#/bin/sh
mkdir ~/.janus
cd ~/.janus
git clone https://github.com/jimenezrick/vimerl.git
git clone https://github.com/Lokaltog/vim-powerline.git
git clone https://github.com/myusuf3/numbers.vim.git
git clone git://github.com/altercation/vim-colors-solarized.git
git clone https://github.com/tomasr/molokai.git