Skip to content

Instantly share code, notes, and snippets.

View cellularmitosis's full-sized avatar

Jason Pepas cellularmitosis

View GitHub Profile
@cellularmitosis
cellularmitosis / Optiboot.Makefile
Created March 3, 2018 17:57
Various optiboot makefiles and diffs amongst them
# Makefile for ATmegaBOOT
# E.Lins, 18.7.2005
# $Id$
#
# Instructions
#
# To make bootloader .hex file:
# make diecimila
# make lilypad
# make ng
@cellularmitosis
cellularmitosis / AnyWire.cpp
Created May 2, 2018 06:10
A thermometer Arduino shield (Si7021 + HD44780 LCD)
#include "AnyWire.h"
#include <Arduino.h>
#include <Wire.h>
#include "SoftwareWire.h"
//
// Constructors
//
AnyWire::AnyWire() {
_softwareWire = NULL;
@cellularmitosis
cellularmitosis / README.md
Last active July 23, 2022 23:29
flisp.py: a simple predicate evaluator
@cellularmitosis
cellularmitosis / EmojiPointersDemo.swift
Created August 15, 2018 18:11
Representing pointer values as emoji can be useful for "visually" debugging certain issues, like cell reuse, etc.
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
let window = UIWindow(frame: UIScreen.main.bounds)
@cellularmitosis
cellularmitosis / Makefile
Last active April 22, 2020 15:39
Fooling around with recursive descent in C!
test: parse
./parse
parse: parse.c
gcc -Wall -Werror -o parse parse.c
clean:
rm -f parse
.PHONY: clean
@cellularmitosis
cellularmitosis / output.txt
Created November 11, 2018 07:35
A user-space batching malloc wrapper.
All tests passed.
benchmarking...
naive malloc: elapsed: 59.271ms, rate: 16,871,657m/s, n: 1,000,000 (1)
pp_malloc: elapsed: 28.880ms, rate: 34,626,039m/s, n: 1,000,000
@cellularmitosis
cellularmitosis / config.h
Created December 21, 2018 00:36
A ring buffer / linked list for buffering ambiguous keys in QMK's config.h
// a linked list of pending key events (press or release) which we haven't processed yet.
typedef struct _pending_key_t {
uint16_t keycode;
keyrecord_t record;
struct _pending_key_t *next;
} pending_key_t;
// worst case is 10 down strokes and 1 up stroke before we can start disambiguating.
#define RINGSIZE 11
@cellularmitosis
cellularmitosis / junk.h
Created December 21, 2018 18:32
some important QMK types
/* key matrix position */
typedef struct {
uint8_t col;
uint8_t row;
} keypos_t;
/* key event */
typedef struct {
keypos_t key;
bool pressed;
@cellularmitosis
cellularmitosis / log-temp.py
Created December 27, 2018 02:15
A script to log data to a CSV file from the usa cal club's temperature / humidity logger.
#!/usr/bin/env python
import sys
import serial
import time
import os
if __name__ == "__main__":
if len(sys.argv) < 2:
@cellularmitosis
cellularmitosis / solutions-by-language.md
Last active May 25, 2021 21:20
Index of Exercism.io solutions, grouped by language

Blog 2019/1/25

<- previous | index | next ->

Index of solutions to Exercism.io problems (grouped by language)

Browsing solutions is a great way to quickly familiarize yourself with a new language!