Skip to content

Instantly share code, notes, and snippets.


Clarence "Sparr" Risher sparr

View GitHub Profile
sparr / T-Slot
Created Nov 28, 2011
Parametric Printable T-Slot Nut
View T-Slot
from __future__ import division # allows floating point division from integers
from FreeCAD import Base
import sys
import math
path = App.ConfigGet('UserHomePath') + '/FreeCad/Mod'
i = sys.path.index(path)
sparr /
Created Nov 30, 2011
freecad mirror rotate bug test case
from FreeCAD import Base
box1 = Part.makeBox(1,4,9)
box2 = Part.makeBox(1,4,9)
box2.rotate(Base.Vector(0,0,0),Base.Vector(0,0,1),60) # this line changes the behavior of the mirror
box2 = box2.mirror(Base.Vector(2,4,9),Base.Vector(1,0,0)) # this mirror doesn't work correctly after the part has been rotated
sparr /
Created Mar 15, 2012
reddit api, post with retries and rate limit
def persistent_post_comment(parent,comment,retries=3,debug=False):
result = None
while retries >= 0:
if debug:
print "debug: comment: " + comment
print "comment: " + comment
result = post_comment(parent,comment)
except reddit.errors.RateLimitExceeded as e:
sparr /
Created Mar 18, 2012
get list of subreddits we are banned from
# fetch our inbox, find subreddits we are banned from in advance
my_inbox = None
my_inbox = r.user.get_inbox()
#TODO: handle some exceptions here!
if (my_inbox):
for m in my_inbox:
s = re.match("you have been banned from posting to \[.*\]\(/r/(.*)/\)\.",m.body)
sparr / bash.sublime-build
Created Aug 3, 2012
SublimeText Build System for BASH scripts
View bash.sublime-build
"cmd": ["bash", "$file"],
"file_regex": "^(.*): line ([0-9]*)",
"selector": "source.bash"
sparr / gist:5265567
Created Mar 28, 2013
ohai output on OSX 10.7, lightly censored
View gist:5265567
"counters": {
"network": {
"interfaces": {
"en1": {
"rx": {
"bytes": "19949649885",
"packets": "19418063",
"overrun": 0,
"multicast": 0,
View nperry_resume.html
<!DOCTYPE html>
<html lang="en">
One Page HTML/CSS resume design, copyright 2013 Nicholas Perry.
Structure and design of HTML and CSS released under Creative Commons Attribution-ShareAlike 3.0 Unported License
Personal Content is used as exmaple, but is not licensed for re-use, please update all content (including meta tags) before republish/reuse.
For inquerys, contact nicholas.t.perry at and refer to this gist:
Please do not remove this copyright notice and include a note on modifications if you choose to use this for your own resume.
sparr / fb_list_edit_profile_links.js
Last active Dec 18, 2015
Add profile links to Facebook friend list management
View fb_list_edit_profile_links.js
sparr / git remote -v
Created Aug 5, 2013
`git remote -v` while troubleshooting ruby instructions
View git remote -v
origin (fetch)
origin (push)
upstream git:// (fetch)
upstream git:// (push)
sparr / cobblerd_set_date.snippet
Created Aug 14, 2013
cobblerd snippet to set the date and time via kickstart %pre
View cobblerd_set_date.snippet
# set the date and time
#import time
#set $timestamp = $time.strftime("%m%d%H%M%Y.%S",$time.gmtime());
date -u $timestamp
hwclock -w -u
You can’t perform that action at this time.