Skip to content

Instantly share code, notes, and snippets.

View chesterbr's full-sized avatar
👾

Carlos Duarte Do Nascimento (Chester) chesterbr

👾
View GitHub Profile
@chesterbr
chesterbr / import_disqus.mjs
Created February 14, 2024 00:55
A script that imports Disqus posts into a format usable by Staticman
// import_disqus.mjs
// =================
//
// Converts Disqus XML export to a format compatible with Staticman (https://staticman.net/)
//
// Requires Node.js and the following packages:
//
// npm install xml2js crypto-js strip-indent
//
// (c) 2024 Carlos Duarte Do Nascimento (https://chester.me)
@chesterbr
chesterbr / hello.asm
Last active August 10, 2023 07:57
An Atari 2600 "Hello, World!" program(it indeed prints "HELLO WORLD" vertically, twice)
;
; hello.asm
;
; A "Hello, World!" which illustrates an Atari 2600 programming
; introduction talk (slides at http://slideshare.net/chesterbr).
;
; This is free software (see license below). Build it with DASM
; (http://dasm-dillon.sourceforge.net/), by running:
;
; dasm hello.asm -ohello.bin -f3
@chesterbr
chesterbr / compress_words.rb
Created February 1, 2022 05:58
First attempt to fit the Wordle word list in an Atari VCS non-bankswitched ROM
#!/bin/ruby
# I'm trying to figure out whether we could fit the Wordle dictionary in a 4K ROM with enough space
# to squeeze an non-bankswitched Atari 2600 game port.
#
# As a first study, this Ruby script compresses a list of word in a way that a simple CPU (6507)
# could decompress on-the-fly, even after some Huffman coding is applied. Not worried with the
# Huffman coding itself; just checking https://resources.nerdfirst.net/huffman.html; previous art of
# Huffman decompression (if we use it) - can be found at http://forum.6502.org/viewtopic.php?t=4642.
#
@chesterbr
chesterbr / dump.txt
Created June 26, 2021 03:19
Formatted dump of breadboard Atari VCS CPU + cart + TIA running Hello World
00 00 00 F0 F0 F0
A9 A9 02 A9 02 02
85 85 85 00 00 00
40 02 02
85 85 85 02 02 02
42 02 02
85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85
85 85 85 02 02 02
42 02 02
85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85 85
@chesterbr
chesterbr / test.txt
Last active March 11, 2021 23:39
test
CHANGED
@chesterbr
chesterbr / gist:756abf7388a29530a365
Last active May 27, 2020 18:52
Cheryl's Birthday (aka Birthday problem)
https://en.wikipedia.org/wiki/Cheryl%27s_Birthday
A knows the month
B knows the day
The candidates are:
may 15 16 19
june 17 18
july 14 16
@chesterbr
chesterbr / brasileiros_toronto.md
Last active October 28, 2019 16:51
Sugestões para Brasileiros visitando Toronto

Sempre que alguém visita Toronto (em particular vindo do Brasil) a gente fica em dúvida sobre onde levar/recomendar.

O @djlebersilvestre compartilhou comigo uma lista de sugestões. Eu fiz alguns adendos e publiquei aqui. Sugestões são bem-vindas!

Locais / passeios

  • CN Tower (A visita vale a pena. O restaurante é um pouco caro - pelo preço tem opções melhores, mas é giratório)
  • Ripley's Aquarium
  • Real Sports Bar
  • Distillery District (falam que o restaurante Clooney é muito bom)
@chesterbr
chesterbr / washing_machine_alarm.ino
Created December 23, 2017 02:42
Washing Machine Alarm with Arduino and ADXL-345 acceleration sensor
// washing_machine_alarm.ino
//
// Copyright by Carlos Duarte Do Nascimento, 2017
// Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
// More info: https://chester.me/archives/2017/12/motion-sensing-arduino-based-washing-machine-alarm/
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_ADXL345_U.h>
#include <LowPower.h>
@chesterbr
chesterbr / Insignia_RMC-SB314.lircd.conf
Created December 12, 2017 23:47
Insignia RMB-SB314 remote control codes for LIRC (for Insignia NS-SB314 Sound Bar System)
# Please take the time to finish this file as described in
# https://sourceforge.net/p/lirc-remotes/wiki/Checklist/
# and make it available to others by sending it to
# <lirc@bartelmus.de>
#
# This config file was automatically generated
# using lirc-0.9.4c(default) on Thu Dec 7 01:07:17 2017
# Command line used: --disable-namespace -f -d /dev/lirc0 /home/chester/lircd.conf
# Kernel version (uname -r): 4.9.59+
#
@chesterbr
chesterbr / Sharp_LCDTV-845-039-40B0.lircd.conf
Created December 12, 2017 23:45
Sharp LCDTV 845-039-40B0 TV Remote Control codes for LIRC (for Sharp LC-40LE431U TV)
# Please take the time to finish this file as described in
# https://sourceforge.net/p/lirc-remotes/wiki/Checklist/
# and make it available to others by sending it to
# <lirc@bartelmus.de>
#
# This config file was automatically generated
# using lirc-0.9.4c(default) on Thu Dec 7 01:17:39 2017
# Command line used: --disable-namespace -d /dev/lirc0 /home/chester/lircd.conf
# Kernel version (uname -r): 4.9.59+
#