Skip to content

Instantly share code, notes, and snippets.

@JamesHagerman
JamesHagerman / gist:5506667
Created May 3, 2013 01:38
This is the --trace output for a stalling rvm info command
[jamis@3centdevices ~]$ rvm --trace info
+ [[ -n '' ]]
+ set -o errtrace
+ export 'PS4=+ $(date "+%s.%N") ${BASH_SOURCE##${rvm_path:-}} : ${FUNCNAME[0]:+${FUNCNAME[0]}()} ${LINENO} > '
+ PS4='+ $(date "+%s.%N") ${BASH_SOURCE##${rvm_path:-}} : ${FUNCNAME[0]:+${FUNCNAME[0]}()} ${LINENO} > '
+ 1367545051.685574111 /scripts/cli : __rvm_parse_args() 709 > [[ -z '' ]]
+ 1367545051.690048124 /scripts/cli : __rvm_parse_args() 709 > [[ -n '' ]]
+ 1367545051.694489724 /scripts/cli : __rvm_parse_args() 712 > [[ error == '' ]]
+ 1367545051.699010123 /scripts/cli : __rvm_parse_args() 712 > [[ 0 -eq 1 ]]
+ 1367545051.703678427 /scripts/cli : __rvm_parse_args() 712 > [[ -n '' ]]
@JamesHagerman
JamesHagerman / add500kbp.diff
Last active August 29, 2015 14:02
add500kbps_to_screen
--- a/src/tty.sh 2014-04-26 09:29:40.000000000 -0700
+++ b/src/tty.sh 2015-08-19 16:49:58.000000000 -0700
@@ -1420,6 +1420,7 @@
IF{B115200} { 17, 115200, B115200 },
IF{B230400} { 18, 230400, B230400 },
IF{B460800} { 19, 460800, B460800 },
+IF{B500000} { 20, 500000, B500000 },
IF{B7200} { 13, 7200, B7200 },
IF{B4800} { 12, 4800, B4800 },
IF{B3600} { 12, 3600, B3600 },
@JamesHagerman
JamesHagerman / starter.js
Last active August 29, 2015 14:03
A basic JS app boilerplate
// A Simple namespace
var App = (function () {
return {
ctx: null,
theTime: null,
init: function () {
console.log("init");
this.setupCanvas();
this.load();
// A Simple namespace
var App = (function () {
return {
ctx: null,
theTime: null,
width: 100,
height: 100,
imageData: null,
init: function () {
console.log("init");
@JamesHagerman
JamesHagerman / pasted
Created August 1, 2014 18:19
Beaglebone Black 3.12 fb dts entry causes kernel dump but not a crash. This is the dump:
[ 5.391437] bone-capemgr bone_capemgr.6: slot #7: dtbo 'BB-BONE-LCD7-01-00A0.dtbo' loaded; converting to live tree
[ 5.416031] bone-capemgr bone_capemgr.6: slot #7: #4 overlays
[ 5.430644] ehrpwm 48302200.ehrpwm: unable to select pin group
[ 5.452281] OF: no ranges; cannot translate
[ 5.460018] OF: no ranges; cannot translate
[ 5.470517] of_get_named_gpio_flags exited with status 60
[ 5.471668] of_get_named_gpio_flags exited with status 60
[ 5.474449] of_get_named_gpio_flags exited with status 3
[ 5.474483] of_get_named_gpio_flags exited with status 112
[ 5.474502] of_get_named_gpio_flags exited with status 51
@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
@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
s3: {
brand1: {
options: {
accessKeyId: "<%= aws.accessKeyId %>",
secretAccessKey: "<%= aws.secretAccessKey %>",
bucket: "brand1-bucket"
},
build: {
cwd: "build2/",
src: "**",
@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>"
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "AddPerm",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::72-whoswho-production/*"
}