Skip to content

Instantly share code, notes, and snippets.

@JamesHagerman
JamesHagerman / HandDebug.cs
Created November 4, 2015 23:26
Leap Motion + Unity 5 + Oculus Hand debugging script
using UnityEngine;
using Leap;
public class HandDebug : MonoBehaviour {
// Attach this script to any game object in your scene. I have an empty GameObject named "GlobalScripts"
// that I attach these kinds of "global" scripts to, but anywhere should work.
//
// Once this script is in your scene, select the game object the script is attached to in Unity's
// Inspector panel (the panel that's usually on the right hand side of Unity's main window). When you
@JamesHagerman
JamesHagerman / gist:4c026ef46db091c5c715
Last active August 26, 2015 07:18
Burning Man 2015 random collection of djs
Disorient 8:00+esp
MONDAY
Douggie Style (10PM)
Whiskey Devil (12AM - 2AM)
TUESDAY
Matthew Doc (2:30PM-4:30PM)
Mattias (9:30PM)
Jake Lama + Crew (11:30PM - 4AM)
@JamesHagerman
JamesHagerman / honda-fit-sport-2013-obd2-notes.md
Last active March 31, 2025 19:18
Sniffing OBDII on 2013 Honda Fit Sport

Honda OBDlink SX notes 2015-08-19

My OBDLink SX data:

>AT I
ELM327 v1.3a
>ST DI (HARDWARE ID STRING)
OBDLink SX r4.2
>ST I (FIRMARE ID STRING)
# Enables color for the prompt:
export TERM="xterm-color"
# Sets up git branch info in term prompt:
source ~/git-completion.bash
parse_git_branch() {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/'
}
export PS1="\[\e[0;33m\]\u\[\e[0m\]@\[\e[0;32m\]\h\[\e[0m\]:\[\e[0;34m\]\w\[\e[0m\]\[\033[32m\]\$(parse_git_branch)\[\033[00m\]\$ "
alias .="open ."
var assert = require ('assert');
var fs = require ('fs');
var swisseph = require('swisseph');
var date = {year: 1985, month: 1, day: 19, hour: 17, minute: 46};
var julday = swisseph.swe_julday(date.year, date.month, date.day, date.hour, swisseph.SE_GREG_CAL);
var geo = {lat: 38.833333, long: -104.816667}
console.log("Day: " + julday);
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AddPerm",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::72-whoswho-production/*"
}
@JamesHagerman
JamesHagerman / gist:3662fa257366f5f4345f
Last active August 29, 2015 14:17
RedCloth + Monkey Patch = Prism working
# RedCloth doesn't work well with the Prism syntax highlighting lirbary due to the way it handles <code> blocks when it comes to newlines using bc..
# But we can add a config/initializers/redcloth.yml file to our Rails app and monkey patch it so it does.
#
# So, this monkey patch is to make RedCloth not split the bc.. code blocks on newlines.
# To actually use it with Prism the syntax should look like this:
# bc(language-ruby).. whatever multi-line code you want to display goes here
module RedCloth::Formatters::HTML
def bc_open(opts)
opts[:block] = true
"<pre#{pba(opts)}><code>"
s3: {
brand1: {
options: {
accessKeyId: "<%= aws.accessKeyId %>",
secretAccessKey: "<%= aws.secretAccessKey %>",
bucket: "brand1-bucket"
},
build: {
cwd: "build2/",
src: "**",
@JamesHagerman
JamesHagerman / pull_git_history.rb
Created September 9, 2014 23:49
This simple Ruby script will find all of the git repo's on your machine and dump all of the git history for you. Exclusions are on line 5. Your Git username is on line 13.
#!/usr/bin/env ruby
require 'shellwords'
puts "Finding all git repos on this machine..."
all_paths = `find ~/ -iname ".git" -not -path "*.rvm*" -not -path "*Circuits*" -not -path "*CLOUDS*" -not -path "*disorient*"`.split("\n")
# puts "Paths: #{all_paths}"
# Actually grab the history of each repo and dump it to the command line:
all_paths.each_with_index do |path,i|
Dir.chdir(path) do
@JamesHagerman
JamesHagerman / gist:726feb2a71ca871fceab
Created August 15, 2014 17:14
hdmi plugged in beaglebone black
[ 944.482554] [drm:output_poll_execute], [CONNECTOR:5:HDMI-A-1] status updated from disconnected to connected
[ 944.482590] [drm:drm_sysfs_hotplug_event], generating hotplug event
[ 944.494368] [drm:drm_fb_helper_hotplug_event],
[ 944.494413] [drm:drm_helper_probe_single_connector_modes], [CONNECTOR:5:HDMI-A-1]
[ 944.577783] [drm:tilcdc_crtc_mode_valid], Processing mode 1280x720@60 with pixel clock 74250
[ 944.577821] [drm:tilcdc_crtc_mode_valid], Processing mode 1280x720@50 with pixel clock 74250
[ 944.577840] [drm:tilcdc_crtc_mode_valid], Processing mode 1280x960@60 with pixel clock 108000
[ 944.577859] [drm:tilcdc_crtc_mode_valid], Processing mode 1280x1024@60 with pixel clock 108000
[ 944.577877] [drm:tilcdc_crtc_mode_valid], Processing mode 800x600@60 with pixel clock 40000
[ 944.577896] [drm:tilcdc_crtc_mode_valid], Processing mode 640x480@60 with pixel clock 25200