Skip to content

Instantly share code, notes, and snippets.

View huberf's full-sized avatar

Noah Huber-Feely huberf

View GitHub Profile
@huberf
huberf / min-char-rnn.py
Created August 25, 2016 00:19 — forked from karpathy/min-char-rnn.py
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@huberf
huberf / description.md
Created March 19, 2017 12:36
Garmin Fitness Watch for Nomie Tracking
  • First one must install an Connect IQ app onto the Garmin watch called Maker
  • To setup the app, one needs a IFTTT account.
  • Create an IFTTT flow, that is triggered by a maker request, and is actuated by sending a request to https://api.nomie.io/v2/push/[myKey]/action=track/label=yourTracker
  • Now, add the trigger word to the Maker app in the Garmin Connect app, and you are good to go!
#!/usr/bin/perl
use strict; use warnings;
open(DNA_FILE, "<hu19_3UTR_test1.txt") or die "Couldn't open file file.txt, $!";
my $dna = "";
while(<DNA_FILE>){
$dna .= $_;
}
close(DNA_FILE);
@huberf
huberf / setup.md
Created May 18, 2017 15:47
Google Assistant Nomie Tracker

This setup uses the Nomie Pro API and IFTTT.

Steps

  1. First you will need to setup the Nomie Proxy service, located at https://github.com/huberf/nomieproxy. This is required because when asking Google 'log that I am angry', you will need to modify the keyword angry to equal the tracker, 'Angry' in my case.
  2. Next, go to IFTTT and create a new applet at the applet creation page.
  3. For the This field, select Google Assistant, and select the trigger Say a phrase with a text ingredient. Now create several phrases. I recommend *log that I just $` as one. Use the $ figure where you want to tracker name to be stated.
  4. After this, for the Then field, select Maker Webhook. Now you just need to put the following format in the URL field: https://YOUR_SERVER.herokuapp.com/PROXY_PASS/{{TextField}}. Replace, YOUR_SERVER and PROXY_PASS with the corresponding values.
  5. Now you just need to press Create and start logging via the Google Assistant.
@huberf
huberf / clear.py
Last active June 2, 2017 22:35
Nomie Backup Duplicate Clearing
# Clear duplicates from Dropbox backup
import json
file = open('Android-Nexus 5X-559865688.nomie.json')
dataRaw = file.read()
data = json.loads(dataRaw)
events = data['events']
cleanedEvents = []
lastId = ''
@huberf
huberf / main.md
Last active July 7, 2018 20:41
Quantified Self Trackers and Utilities

Quantified Self Trackers and Utilities I Use

This is divided into three sections based upon the role they play in my life.

Trackers (items that provide data)

• Garmin Connect
• WakaTime
• RescueTime
• Moves
• Arc
• Last.fm
@huberf
huberf / events.txt
Created June 13, 2017 20:08
Bulk Import of Events to Nomie via API
06-12-2017
#1-10:00
Coffee-10:15-1
#1-10:40
Soylent-15:00
Eat-15:00
#2-16:20
Water-16:25-1
#1-17:50
Water-18:29-1
@huberf
huberf / floormate.py
Last active June 30, 2017 19:33
Python Calculation for Floormate Likelihood
# General likelhod calculation function
def calc(floorSize, classSize):
# Calculate likelihood of person A being on any given floor
chanceOnCertainFloor = floorSize/classSize
# Chance of person B being in any room on any given floor
chanceFloorMate = (classSize/floorSize) / classSize
# Return chance of person A and person B being on the same random floor
return chanceOnCertainFloor * chanceFloorMate
# Function to prettify the results
@huberf
huberf / instructions.md
Created July 11, 2017 01:42
Setup Reverse Proxy Server w/ Nginx

Now that your application is running, and listening on a private IP address, you need to set up a way for your users to access it. We will set up an Nginx web server as a reverse proxy for this purpose. This tutorial will set up an Nginx server from scratch. If you already have an Nginx server setup, you can just copy the location block into the server block of your choice (make sure the location does not conflict with any of your web server's existing content).

On the web server, let's update the apt-get package lists with this command:

sudo apt-get update

Then install Nginx using apt-get:

sudo apt-get install nginx
@huberf
huberf / instructions.md
Created July 11, 2017 12:40
Start SSH Identities

If you are running OSX 10.6.8 or later you can skip this step. The OSX 10.6.8 system asks for your connection parameters the first time you try to establish a SSH connection. Then, it automatically starts the ssh-agent for you. If you don't have OSX 10.6.8 or are running another Linux operating system, do the following: Open a terminal window and enter the ps -e | grep [s]sh-agent command to see if the agent is running.

$ ps -e | grep [s]sh-agent 
 9060 ?? 0:00.28 /usr/bin/ssh-agent -l

If the agent isn't running, start it manually with the following command:

$ ssh-agent /bin/bash