Skip to content

Instantly share code, notes, and snippets.

View nmeans's full-sized avatar

Nickolas Means nmeans

View GitHub Profile
t.prefs_.set('color-palette-overrides',["#002831", "#d11c24", "#738a05", "#a57706", "#2176c7", "#c61c6f", "#259286", "#eae3cb", "#001e27", "#bd3613", "#475b62", "#536870", "#708284", "#5956ba", "#819090", "#fcf4dc"]);
t.prefs_.set('cursor-color', 'rgba(112,130,132,0.5)');
@nmeans
nmeans / resources.md
Last active March 7, 2017 22:41
Leadership Resources

Talks

Books

@nmeans
nmeans / bugreport.md
Created January 26, 2017 23:12
Garmin Bug Report

Hi Garmin,

I'm seeing incorrect calorie publishing from Garmin Connect into Apple HealthKit. For example, I did a run at lunch today. Garmin Connect recorded 453 calories. When I look at the workout in the Activity app, I see 0 calories. When I look at the workout data in the Apple Health app, I see the calorie total reported as 0.45 kcal. I think this is a calorie/kilocalorie reporting issue.

I'm guessing your developers used HKUnit.calorie() to publish the workout to HealthKit when they should've used HKUnit.kilocalorie() when reporting these totals (https://developer.apple.com/reference/healthkit/hkunit/1615359-calorie vs. https://developer.apple.com/reference/healthkit/hkunit/1615576-kilocalorie). Your developers will know what I'm talking about.

I can't be the only person to have run across this problem. Is it a known issue? Any idea when you might have a fix?

Cheers, Nick

def parse_roles(user_hash)
custom_schemas = user_hash.fetch("customSchemas") { return [] }
roles = custom_schemas.fetch("Roles") { return [] }
roles
end
user1 = {
"email": "andrew@muvehealthlabs.com",
"customSchemas": {
"Roles": ["accountant", "admin"]
@nmeans
nmeans / geocodio.txt
Last active August 29, 2015 14:05
Slow Geocodio Response
% time wget -O - "https://api.geocod.io/v1/geocode?q=5119+Burnet+Rd+Austin+TX+78756&api_key=[REDACTED]"
--2014-08-26 11:39:21-- https://api.geocod.io/v1/geocode?q=5119+Burnet+Rd+Austin+TX+78756&api_key=[REDACTED]
Resolving api.geocod.io... 107.170.69.34
Connecting to api.geocod.io|107.170.69.34|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/json]
Saving to: ‘STDOUT’
[<=> ] 0 --.-K/s {"input":{"address_components":{"number":"5119","street":"Burnet","suffix":"Rd","city":"Austin","state":"TX","zip":"78756"},"formatted_address":"5119 Burnet Rd, Austin, TX 78756"},"results":[{"address_components":{"number":"5119","street":"Burnet","suffix":"Rd","city":"Austin","count

Keybase proof

I hereby claim:

  • I am nmeans on github.
  • I am nmeans (https://keybase.io/nmeans) on keybase.
  • I have a public key whose fingerprint is F066 E600 744C BD12 34BE 2DF2 287A 53B5 165F BA0C

To claim this, I am signing this object:

@nmeans
nmeans / console.coffee
Last active December 31, 2015 16:09
console.log shim
# Add a no-op version of the console object so accidental
# calls to console that leak to prod won't raise errors
# in IE < 10.
if typeof(console) == "undefined"
window.console =
log: () ->
debug: () ->
info: () ->
warn: () ->
error: () ->
@nmeans
nmeans / pgr_test.rb
Created September 11, 2013 13:52
A simple test of IE8 behavior re: history and POST -> GET redirect. IE does not write the '/DO_NOT_SHOW_IN_HISTORY' endpoint to history, and reloads '/' from cache when the back button is clicked. This is the desired behavior.
require 'rubygems'
require 'sinatra'
get '/' do
haml :form
end
post '/DO_NOT_SHOW_IN_HISTORY' do
redirect to('/show_in_history'), 302
end
@nmeans
nmeans / .tmux.conf.local
Created September 5, 2013 19:40
Local config files
set -g default-terminal "screen-256color"
set -sg escape-time 0
# scrollback buffer size increase
set -g history-limit 500000
# Use up and down arrows for temporary "maximize"
unbind Up; bind Up resize-pane -Z; unbind Down; bind Down resize-pane -Z
@nmeans
nmeans / fann-test.rb
Created May 7, 2013 15:13
ruby-fann negative/positive demo
input = (-1000...1000).collect{|i| [i]}
output = input.map{|i| i > 0 ? [1,0] : [0,1]}
train = RubyFann::TrainData.new(:inputs => input, :desired_outputs => output)
fann = RubyFann::Standard.new(:num_inputs=>2, :hidden_neurons=>[3,3,3], :num_outputs=>2)
fann.train_on_data(train, 1001, 10, 0.001)
fann.run([-500]) # [0.03544681023290716, 1.0]
fann.run([500]) # [1.0, 0.0]