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 / e-m-forster-the-machine-stops.txt
Created November 3, 2022 15:33
The Machine Stops (1909) by E. M. Forster
---
TITL: The Machine Stops
AUTH: E. M. Forster
DESC: In a distant future humans live in single cells underground, connected via a communications network which, despite being first published in 1909, strikingly predicts social networking, video and conference calls, and the reduction of human interaction to screens and immobility.
GNRE: Science Fiction
LANG: en
---
THE MACHINE STOPS
The Machine Stops
by E. M. Forster
@joeycastillo
joeycastillo / bluemarble.py
Created September 29, 2022 02:48
Python script to convert GOES-East imagery to 7-color e-paper bitmap
# Based on Waveshare's epd5in65f.py demo. Copyright notice at end.
import sys
import os
libdir = os.path.join(os.path.dirname(os.path.dirname(os.path.realpath(__file__))), 'lib')
if os.path.exists(libdir):
sys.path.append(libdir)
import logging
@joeycastillo
joeycastillo / main.c
Created September 19, 2022 03:24
Low power test for Feather M0
// MIT license, Joey Castillo 2022
// works with Alex Taradov's bare metal SAM D21 project:
// https://github.com/ataradov/mcu-starter-projects
//-----------------------------------------------------------------------------
#include <stdlib.h>
#include <stdint.h>
#include <stdbool.h>
#include <string.h>
#include "samd21.h"

Sensor Watch: Quick Start Guide

The Sensor Watch circuit board is designed to fit in a Casio F-91W or A158 wristwatch. Note that it will not work with counterfeits! You need a genuine Casio F-91W wristwatch to serve as the donor watch for this board swap.

Tools

At a minimum, you will need a small Phillips screwdriver to perform this board swap. Tweezers can also help. Optionally, you may use a soldering iron to remove a small metal tab from the original F-91W circuit board, and solder it to the Sensor Watch board. This modification is necessary to get the buzzer to beep. Note that if you don’t do this swap, Sensor Watch will still work the same, with the exception that the buzzer will not sound.

You can view a video of the full board swap procedure here:

Sensor Watch: Kurzanleitung

Die Platine «Sensor Watch» ist so konzipiert, dass sie in eine Casio F-91W oder A158 Armbanduhr passt. Beachten Sie, dass es nicht mit Fälschungen funktioniert! Sie benötigen eine echte Casio F-91W Armbanduhr als Spenderuhr für diesen Platinentausch.

Werkzeug

Sie benötigen mindestens einen kleinen Kreuzschlitzschraubendreher, um diesen Platinentausch durchzuführen. Pinzette hilft auch.

Optional können Sie mit einem Lötkolben eine kleine Metalllasche von der Originalplatine des F-91W entfernen und auf die Platine «Sensor Watch» löten. Diese Änderung ist notwendig, damit der Summer piept. Beachten Sie, dass «Sensor Watch» mit Ausnahme des Summers auch ohne diese Änderung funktioniert.

@joeycastillo
joeycastillo / Focus.cpp
Created June 20, 2022 22:37
A simple Focus-based app for tracking progress on projects
#include "Focus.h"
#include "Arduino.h"
#include <algorithm>
Task::Task() {
}
View::View(Rect rect) {
this->frame = rect;
this->window.reset();
@joeycastillo
joeycastillo / gatsby.txt
Created June 15, 2022 16:24
The Great Gatsby, plain text with ASCII control characters
---
TITL: The Great Gatsby
AUTH: F. Scott Fitzgerald
DESC: The decadent and mysterious Jay Gatsby pursues the American Dream in Jazz Age New York.
GNRE: Traffic accidents--Fiction
LANG: en
---
Dedication
Once again
to
@joeycastillo
joeycastillo / convert.py
Created June 15, 2022 16:16
Convert Standard Ebooks EPUBs to plain text with front matter
import io
import sys
from epub2txt import epub2txt
# Designed for use with Standard Ebooks EPUB files.
# May work with others, but their structure is excellent.
try:
filepath = sys.argv[1]
except:
print('usage: python3 convert.py book_to_convert.epub')
@joeycastillo
joeycastillo / code.py
Created May 22, 2022 19:43
LCD clock with ambient conditions on ESP32-S2 Feather
import board
import rtc
import time
import alarm
from adafruit_bme280 import basic as adafruit_bme280
from adafruit_lc709203f import LC709203F, PackSize
from oso_lcd.lcdwing_lite import LCDWingLite, Indicator
display = LCDWingLite(board.I2C())
display.clear_indicator(Indicator.MOON)
@joeycastillo
joeycastillo / segments.py
Created March 25, 2022 18:17
Ancient script to generate Sensor Watch segment map
rev_01_map = [[(1, 18), (2, 19), (0, 19), (1, 18), (0, 18), (2, 18), (1, 19), None],
[(2, 20), (2, 21), (1, 21), (0, 21), (0, 20), (1, 17), (1, 20), None],
[(0, 22), (2, 23), (0, 23), (0, 22), (1, 22), (2, 22), (1, 23), None],
[(2, 1), (2, 10), (0, 1), (0, 0), (1, 0), (2, 0), (1, 1), None],
[(2, 2), (2, 3), (0, 4), (0, 3), (0, 2), (1, 2), (1, 3), None],
[(2, 4), (2, 5), (1, 6), (0, 6), (0, 5), (1, 4), (1, 5), None],
[(1, 9), (0, 9), (2, 9), (1, 9), (0, 10), None , (1, 9), None],
[(0, 7), (1, 7), (2, 7), (2, 6), (2, 8), (0, 8), (1, 8), None],
[(0, 13), (1, 13), (2, 13), (2, 15), (2, 14), (0, 14), (1, 15), (1, 14)],
[(0, 11), (1, 11), (1, 11), (2, 11), (1, 12), (1, 12), (2, 12), (0, 12)],