Skip to content

Instantly share code, notes, and snippets.

View richstoner's full-sized avatar
💭
🚀

Rich Stoner richstoner

💭
🚀
View GitHub Profile
@richstoner
richstoner / gist:44da29e73cd5988d48e9
Last active August 29, 2015 14:10
How I configure my mac

Get dotfiles

cd; curl -#L https://github.com/mathiasbynens/dotfiles/tarball/master | tar -xzv --strip-components 1 --exclude={README.md,bootstrap.sh,LICENSE-MIT.txt}

Install homebrew

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Run defaults

@richstoner
richstoner / magic_cell.py
Created August 24, 2014 06:00
custom ipython magic that hooks into girder + celery functionality.
%%girder
def getUser(login):
from girder.utility.model_importer import ModelImporter
m = ModelImporter()
user_query = m.model('user').find({'login' : login})
user = None
if user_query.count() == 1:
user = user_query[0]
[program:celery]
directory=##SAFAPPS##/proletariat
;user=##SAFUSER##
command=/home/##SAFUSER##/miniconda/bin/celery worker -A tasks -l info
stdout_logfile=/tmp/proletariat-celeryd-stdout.log
stderr_logfile=/tmp/proletariat-celeryd-stderr.log
autostart=true
autorestart=true
startsecs=4
stopwaitsecs=30
@richstoner
richstoner / rest.py.edit
Created July 29, 2014 20:27
file_generator for l120 of rest.py
elif isinstance(val, cherrypy.lib.file_generator):
# if endpoint returned a file generator, return it directly
#
# Example
#
# > from cherrypy.lib import file_generator
# > cherrypy.response.headers['Content-Type'] = "image/png"
# > png_handle = open(file_path, 'rb')
# > return file_generator(png_handle)
#
import cherrypy
import os
class GalleryClass(object):
exposed = True
def __init__(self):
pass
# this line will map the first argument after / to the 'id' parameter
# for example, a GET request to the url:
description "Tomcat Server"
start on runlevel [2345]
stop on runlevel [!2345]
respawn
respawn limit 10 5
# run as non privileged user
# add user with this command:
## adduser --system --ingroup www-data --home /opt/apache-tomcat apache-tomcat
@richstoner
richstoner / CursorImage.cs
Created January 23, 2014 22:19
EyeTribe Beta SDK & Unity3d (win7 only)
using UnityEngine;
using System.Collections;
public class CursorImage : MonoBehaviour {
public Texture currentEyePosition;
// Use this for initialization
void Start () {
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
<name>Tijuana 22000.kmz</name>
<StyleMap id="m_ylw-pushpin">
<Pair>
<key>normal</key>
<styleUrl>#s_ylw-pushpin</styleUrl>
</Pair>
<Pair>
@richstoner
richstoner / ocp-test.ipynb
Created December 2, 2013 03:12
ocp testing nb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@richstoner
richstoner / armarker_detector.py
Created November 20, 2013 21:11
ar_detector.py
import cv2
import numpy as np
from gl_utils import draw_gl_polyline,adjust_gl_view,clear_gl_screen,draw_gl_point
from methods import normalize
import atb
import audio
from ctypes import c_int,c_bool
import OpenGL.GL as gl
from OpenGL.GLU import gluOrtho2D