Skip to content

Instantly share code, notes, and snippets.

View huberf's full-sized avatar

Noah Huber-Feely huberf

View GitHub Profile
@huberf
huberf / README.md
Last active February 10, 2021 17:15
Dot Paper (Letter, 5mm)

Good dot paper is an immensely valuable tool for notetaking, but finding dot paper with the right spacing and margins is a significant challenge.

http://paperkit.net/dottedpaper provides a very customizable way to generate it, but unfortunately the dot paper generator is broken and further, has a large watermark at the bottom. To get around this simply navigate to that page, put in the configuration you want, and then instead of clicking Download PDF. Paste the following into your console. Note: You may need to click enable pop-ups and then re-run the code again for it to work.

var doc = new jsPDF('p','mm',format);
@huberf
huberf / garmin_save.py
Last active January 16, 2021 15:07
Automated Garmin Step Streak Saving
import datetime
import requests as r
USERNAME = '<PLACEHOLDER>'
TIMEZONE = -5 # EST timezone offset
IFTTT_MAKER_KEY = '<PLACEHOLDER>'
GOAL = 10000
tz = datetime.timezone(datetime.timedelta(hours=TIMEZONE))
date = str(datetime.datetime.now(tz))[:10] # gets current date of format '2021-01-14'
@huberf
huberf / instructions.md
Created March 23, 2018 21:20
Change time zone on Ubuntu server

Sometimes changing the time zone on a server to ones own can simplify product prototyping. Luckily this is a painless process.

The below is for Eastern time, but one must merely look around in the /usr/share/zoneinfo directory to find the proper file for your setup. When found simply run ln -sf /usr/share/zoneinfo/US/Eastern /etc/localtime replacing /US/Eastern with the appropriate file.

@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
@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 / 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 / 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 / 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 / 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 / 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.