Skip to content

Instantly share code, notes, and snippets.

View joeycastillo's full-sized avatar

Jose Castillo joeycastillo

  • New York, NY
View GitHub Profile
@joeycastillo
joeycastillo / apinotes.markdown
Last active December 12, 2015 06:19
Notes on the ArtsFest API, which will power Bushwick Open Studios 2013.

#ArtsFest API documentation

ArtsFest is an open source framework for publishing information about multi-day arts festivals, conferences, panels and basically anything else involving events happening over time. The API allows users to consume resources at the following five endpoints:

  • /events — For an arts festival this might represent an open studio or a special event. For a music festival, this might be an showcase at a venue.
  • /venues — Each event is associated with one venue; for an arts festival this might be a gallery space or an artist's studio. For a music festival, it might be a bar or club. While an event only has one venue, a venue can be associated with multiple events.
  • /artists — Each event has zero or more artists; self-explanatory for an arts festival. For a music festival this could be the bands playing at the showcase. Note that artists can be involved with multiple events (i.e. a photographer with work in multiple exhibitions, or a band playing multiple showcases).
"""
A quick and dirty script to show some flair statistics.
Currently it only shows how many users have flair, and how many use
each css class.
Usage:
1) run flair-stats.py
2) enter username and password when asked
3) enter subreddit name (eg: starcraft)
#!/path/to/venv/bin/python3
from google.transit import gtfs_realtime_pb2
import requests
import time
import os
import json
from dotenv import load_dotenv, find_dotenv
from protobuf_to_dict import protobuf_to_dict
// Hiking Log
//
// The main LED is used to communicate status. Under normal operation, when board is reset, the following sequence of blinks will indicate normal operation:
// 1. Three 0.5 second pulses indicate that a card is present.
// 2. A single one-second pulse indicates that commands have been sent to the GPS module.
// 3. The LED will turn off. No more pulses will be emitted unless there is an error condition.
//
// During normal operation, the device appends a single line to the LOG.CSV file every minute, on the minute.
// You may safely remove the SD card anytime other than the one-minute mark, as that's the only time the file is open.
//
@joeycastillo
joeycastillo / book.h
Created October 14, 2019 23:31
Very simple demo for ebook wing
const char * book001 [] =
{"They were raised on small, poor",
"ranches in opposite corners of the",
"state, Jack Twist in Lightning Flat,",
"up on the Montana border, Ennis del",
"Mar from around Sage, near the Utah",
"line, both high-school drop-out",
"country boys with no prospects,",
"brought up to hard work and",
"privation, both rough-mannered,",
@joeycastillo
joeycastillo / departures.ino
Created November 4, 2019 03:31
e-ink departures board for NYC subway
#include <SPI.h>
#include <WiFiNINA.h>
#include <RTClib.h>
#include <ArduinoJson.h>
#define ENABLE_GxEPD2_GFX 0
#include <GxEPD2_BW.h>
#include "BabelSPIFlash.h"
#include "BabelTypesetterGFX.h"
/**************************************************************************/
/*!
@brief Custom lookup tables for full screen updates. Public domain (?) from Waveshare.
@note Video explainer: https://www.youtube.com/watch?v=MsbiO8EAsGw and more info:
https://benkrasnow.blogspot.com/2017/10/fast-partial-refresh-on-42-e-paper.html
@warning YOU CAN PERMANENELY DAMAGE YOUR DISPLAY BY ABUSING THESE LOOKUP TABLES!
Seriously, the controller is incredibly programmable and you can force all
kinds of voltages and timings onto the screen that it wasn't meant to deal
with. TWEAK AT YOUR OWN RISK!
*/
#include "Adafruit_Arcada.h"
Adafruit_Arcada arcada;
const int16_t pixelWidth = ARCADA_TFT_WIDTH;
const int16_t pixelHeight = ARCADA_TFT_HEIGHT;
void setup(void) {
Serial.begin(115200);
// Start TFT
@joeycastillo
joeycastillo / main.py
Created January 17, 2020 00:18
Fetch a weather forecast for the New York area with CircuitPython!
import board
import busio
from digitalio import DigitalInOut
import adafruit_esp32spi.adafruit_esp32spi_socket as socket
from adafruit_esp32spi import adafruit_esp32spi
import adafruit_requests as requests
esp32_cs = DigitalInOut(board.D13)
esp32_reset = DigitalInOut(board.D12)
esp32_ready = DigitalInOut(board.D11)
@joeycastillo
joeycastillo / grayscale.ino
Created January 21, 2020 15:51
Display grayscale images on a GDEW042T2 e-paper display
// library here: https://github.com/joeycastillo/The-Open-Book/tree/master/src
// convert images with this tool: https://littlevgl.com/image-to-c-array
// options: Indexed 4 colors, output format binary. Do the dithering on your own,
// and make sure your four colors include pure white and pure black.
#include <OpenBook.h>
#include <SD.h>
OpenBook *book;
// or for using your own 4.2" B&W display (substitute your pin assignments):