Skip to content

Instantly share code, notes, and snippets.

View danasf's full-sized avatar

Dana Sniezko danasf

  • Bay Area ↔️ NYC
View GitHub Profile
@danasf
danasf / readme.md
Last active April 23, 2023 06:38
ESP32 Receipt Printer Storybot

Storybot

What is it?

A receipt printer connected to GPT-3 backend.

BOM

Building this device is fairly simple. You need:

@danasf
danasf / control_panel.svg
Last active June 11, 2023 16:54
Making Things From Scraps - Kids Control Panel
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@danasf
danasf / mobilenet-detect-example.ipynb
Last active May 1, 2020 22:07
Jetson Nano - Object Detection (headless, from a Jupyter Notebook)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@danasf
danasf / sensor_data.py
Created November 21, 2018 15:58
laser dust sensor - pm 2.5 plotter
import serial
import time
import struct
import datetime
import matplotlib.pyplot as plt
# for use with sds021 sensor or similar
# https://www.aliexpress.com/item/NOVA-PM2-5-Air-particle-dust-sensor-SDS021-laser-inside-digital-output-SDS021-Laser-PM2-5/32638192686.html
# replace with your serial port
@danasf
danasf / convert_ballots.py
Last active June 8, 2018 03:44
ballot images to CSV
# converts ballot images from sf elections into a csv you can easily import into your database/spreadsheet
# this is released into the public domain. dana sniezko, 2018
# download the text file from https://sfelections.sfgov.org/june-5-2018-election-results-detailed-reports
ballot_image_file = "20180606_ballotimage.txt"
# what you want to name your output csv
output_file_name = "parsed_ballots.csv"
# from http://www.sfelections.org/results/20180605/data/20180605_4/20180605_4_masterlookup.txt
# dictionary of to precincts
@danasf
danasf / total_votes.py
Last active June 8, 2018 02:55
RCV fun time scripts
# pre-coffee code in the public domain
# this shows total 1,2,3 votes for a given candidate, it's not running RCV rounds
# for that you want https://sfelections.sfgov.org/june-5-2018-election-results-summary
total = {"001":0,"002":0,"003":0} # total by rank
# http://www.sfelections.org/results/20180605/data/20180605_4/20180605_4_masterlookup.txt
target = "0000184" # amy here!
# ballot images from https://sfelections.sfgov.org/june-5-2018-election-results-detailed-reports
@danasf
danasf / index.html
Last active September 28, 2016 06:02
LED patterns with Edison
{
"name": "LEDPatternTest",
"description": "Testing WS2801 LED Strip on Intel Edison",
"version": "0.0.0",
"main": "main.js",
"engines": {
"node": ">=0.10.0"
},
"dependencies": { "mqtt": "^0.3.11" }
}
@danasf
danasf / index.html
Last active August 29, 2015 14:06
ledbot simulator
<!doctype html>
<head>
<title>LEDBOT SIMULATOR</title>
<style type="text/css">
body { background:#333; color:#fff; }
#leds { margin:20px; }
</style>
</head>
<body>
<canvas width="1200" height="600" id="leds"></canvas>
<html>
<head>
<title>Get some RGBA data from canvas!</title>
</head>
<body>
<h1>Get RGBs from canvas</h1>
<canvas id="acanvas" width="300" height="300"></canvas>
</body>
<script type="text/javascript">
;(function() {
@danasf
danasf / gpio.py
Created August 5, 2014 21:28
flask io
from flask import Flask
import RPi.GPIO as gpio
gpio.setmode(gpio.BCM)
led_pin = 16
gpio.setup(led_pin,gpio.OUT)
gpio.output(led_pin,False)