Skip to content

Instantly share code, notes, and snippets.

@twolfson
twolfson / README.md
Created July 31, 2019 20:11
Proof of concept for reading serial output from Arduino directly

gist-arduino-serial

Proof of concept for reading serial output from Arduino directly

Getting started

  • Clone the repo
  • Upload .ino file to Arduino (e.g. via IDE)
  • Verify output is being seen via Serial Monitor in Arduino IDE
  • Open terminal, listen to same port that Arduino writes to
    • tail -f /dev/ttyACM0 on Linux
  • May require more setup on other platforms
@twolfson
twolfson / README.md
Last active July 31, 2019 09:35
Proof of concept (potentially final) files for ConeDown sensors

gist-conedown-sensor

Proof of concept (potentially final) files for ConeDown sensors

We're using force-sensitive resistors (FSRs) as sensors to detect presence on our dancefloor tiles. This is an integration between those sensors, an Arduino, and our computer

Getting started

Sensor testing with Arduino

@twolfson
twolfson / .gitignore
Created June 10, 2019 18:25
Exploration of SF's Assessor-Recorder tax roll
*.csv
@twolfson
twolfson / keybase.md
Created January 7, 2019 23:14
keybase.md

Keybase proof

I hereby claim:

  • I am twolfson on github.
  • I am twolfson (https://keybase.io/twolfson) on keybase.
  • I have a public key ASB3gghMv9nXHX0Rd0KcEHTWc7bhofYUMS6CRaU517DVqwo

To claim this, I am signing this object:

@twolfson
twolfson / .gitignore
Created December 20, 2018 04:38 — forked from tmcw/foursquare_to_geojson.py
Turn your Foursquare Data Archive into a GeoJSON file
checkins/
checkins.geojson
@twolfson
twolfson / README.md
Created December 19, 2018 13:24
Foursquare backup notes

This is a personal log of getting a Foursquare backup/export setup. It's intended to be a bit of a resource for those who are bridging between technical and non-technical

It's not super explanatory either though. If you do have issues, feel free to email me and I'll update it in fuller detail =)


We want to export our Foursquare data and make the switch to Yelp in 2019 We have lost faith in Foursquare being maintained on Android and thus discovery can only be done on Yelp As a result, we might as well consolidate the data

@twolfson
twolfson / .gitignore
Created December 19, 2018 12:34 — forked from tmcw/foursquare_archive.py
Simple Foursquare Checkins Archive of one User
checkins/
venuehistory/
venuelikes/
@twolfson
twolfson / README.md
Created June 12, 2018 02:35
Rails generator locations

lib/templates

We've had trouble finding our paths for templates before. Here's a good StackOverflow on the topic:

https://stackoverflow.com/a/37701125

To use this in practice, edit vendor/bundle/ruby/2.4.0/gems/thor-0.20.0/lib/thor/actions.rb to dump source_paths and file:

Example for table migration:

@twolfson
twolfson / concerns-keyed_model.rb
Created June 12, 2018 02:34
Rails acts-as-keyed updated/simplified
# Largely based on `acts-as-keyed` but with less magic (namely make `to_param` consistent, don't overwrite `find`)
# https://github.com/jhubert/acts-as-keyed
# http://vaidehijoshi.github.io/blog/2015/10/13/stop-worrying-and-start-being-concerned-activesupport-concerns/
module KeyedModel
extend ActiveSupport::Concern
KEY_CREATION_RETRIES = 100
KEY_LENGTH = 8
included do
@twolfson
twolfson / main.sh
Created April 14, 2018 19:33
Unnest folders into 1 flat folder of symlinks
#!/usr/bin/env bash
# Do you have a bunch of nested folders of images that you want to scroll through easily?
# Well this script is for you, it will take nested folders and symlink their files so they're easily scrollable
# It retains the full path so files which should be next to each other still are :+1:
# Exit under sane conditions
set -euo pipefail
# Allow spaces in path names
# https://stackoverflow.com/a/7039579