Skip to content

Instantly share code, notes, and snippets.

View strathmeyer's full-sized avatar

Eric Strathmeyer strathmeyer

View GitHub Profile
@strathmeyer
strathmeyer / gist:4990173
Created February 19, 2013 21:31
Improve OSX Bluetooth quality
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Max (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" 48
defaults write com.apple.BluetoothAudioAgent "Apple Initial Bitpool (editable)" 40
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool" 48
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Max" 53
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Min" 48
defaults write com.apple.BluetoothAudioAgent "Stream - Flush Ring on Packet Drop (editable)" 30
defaults write com.apple.BluetoothAudioAgent "Stream - Max Outstanding Packets (editable)" 15
defaults write com.apple.BluetoothAudioAgent "Stream Resume Delay" "0.75"
@strathmeyer
strathmeyer / handlebars.object_helpers.js
Created November 16, 2011 21:57
Handlebars.js helpers to iterate over objects
// HELPER: #key_value
//
// Usage: {{#key_value obj}} Key: {{key}} // Value: {{value}} {{/key_value}}
//
// Iterate over an object, setting 'key' and 'value' for each property in
// the object.
Handlebars.registerHelper("key_value", function(obj, fn) {
var buffer = "",
key;
@strathmeyer
strathmeyer / gist:3329859
Created August 12, 2012 04:59 — forked from hdznrrd/gist:656996
HSV to RGB (Arduino)
void HSV_to_RGB(float h, float s, float v, byte &r, byte &g, byte &b)
{
int i;
float f,p,q,t;
h = constrain(h, 0.0, 360.0);
s = constrain(s, 0.0, 100.0);
v = constrain(v, 0.0, 100.0);
s /= 100;
@strathmeyer
strathmeyer / prod.sh
Created September 14, 2017 06:02
Blames TODOs in Python files
GIT_GREP="$(git grep -i -n -E '#[ ]*TODO' -- '*.py')"
IFS=$'\n' read -rd '' -a LINES <<<"$GIT_GREP"
for LINE in "${LINES[@]}"
do
IFS=: read FILE LINE MATCH <<<"$LINE"
echo "$FILE:$LINE"
git blame $FILE -L $LINE,+1
echo
done
@strathmeyer
strathmeyer / Gruntfile.js
Last active February 25, 2016 19:14
A simple Gruntfile
module.exports = function(grunt) {
grunt.initConfig({
concat: {
js: {
src: ['js/jquery-2.0.3.min.js',
'js/plugins/*.js',
'js/site.js'],
dest: 'build.js',
options: {
separator: ';'
require 'date'
def parse_whackness(date_string)
year = parse_year(date_string)
month, day = guess_day_month(date_string[0..-5])
Date.new(year.to_i, month.to_i, day.to_i)
end
@strathmeyer
strathmeyer / gist:5230028
Created March 24, 2013 01:22
Using the sitemap in Middleman
<% if current_page.parent %>
<h2>Parent</h2>
<ul>
<li><%= link_to current_page.parent.data.title, current_page.parent %></li>
</ul>
<% end %>
<h2>Children</h2>
<ul>
<% current_page.children.select { |p| p.ext == ".html" && p.data.title }.each do |resource| %>
@strathmeyer
strathmeyer / gist:4433071
Last active December 10, 2015 12:18
Books I read in 2012
1. Poke the Box
2. Anything You Want
3. Snuff (Pratchett)
4. Republic, Lost
5. Guards! Guards!
6. Men At Arms
7. Buddy Does Seattle
8. Buddy Does Jersey
9. Feet of Clay
10. Jingo
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
The quick brown fox jumps over the lazy dog.
@strathmeyer
strathmeyer / gist:3720224
Created September 14, 2012 06:37
'bower update' with a component.json
~/Development/footest ls
component.json
~/Development/footest cat component.json
{
"name": "footest",
"version": "0.0.1",
"main": [],
"dependencies": {
"jquery": "~1",
"underscore": "~1.3.3",