Skip to content

Instantly share code, notes, and snippets.

View pepasflo's full-sized avatar

Jason Pepas (FloSports.tv) pepasflo

View GitHub Profile
@pepasflo
pepasflo / .gitignore
Last active October 22, 2023 12:06
Scripts for encrypting / decrypting secrets (to prevent them from being accidentally checked into git)
secrets/
@pepasflo
pepasflo / README.md
Last active October 2, 2023 16:23
Notes on using graphviz to visualize abstract syntax trees (ASTs)

Using graphviz to visualize abstract syntax trees

screen shot 2019-02-15 at 5 52 08 pm

  • After you've written your first lexer and parser, write a function which walks the AST and "compiles" it into graphviz notation like the above
@pepasflo
pepasflo / lexer.js
Last active July 30, 2023 09:03
A regex-based javascript lexer / scanner / tokenizer
#!/usr/bin/env node
var assert = require('assert');
// Each lexed token is a array of three integers:
// 1. the "token type": an index into the list of token patterns.
// 2. the index into the input string marking the start of this token.
// 3. the length of the token.
// The list of "token types" which our lexer understands:

Robot arduino sketch

Some motor-control code for our robot kit.

Writing eval() for simple math expressions

Rather than starting with lexing and parsing, this week we just assume we have those bits already working, so that we can jump straight to eval().

video:

recording of the meeting

diagrams:

Stacked-PR workflow

Some notes about how I work with stacked branches (a.k.a. dependent PR's).

Kindof a pain but it works. This could probably be automated with some clever scripting against github's API.

Creating the first PR

Create your first PR as per normal:

Navigating Youbora v5 / v6 confusion (iOS)

Youbora went through a significant refactor as they transitioned from v5 to v6 of their iOS video playback metrics collecting plugins.

While this change has improved some shortcomings in the v5 design, it has unfortunately been the source of some confusion, as their dev infra and resources seem to have bifurcated across this change:

@pepasflo
pepasflo / README.md
Last active April 17, 2019 23:36
mathterp: A series of problems for the puzzles guild around implementing a simple math interpreter compiler

mathterp

This is a series of problems / challenges around evaluating simple math expressions.

Problem A

Write a program which can evaluate infix addition operations of non-negative integers.

Example inputs:

@pepasflo
pepasflo / BetaFlags.swift
Last active April 12, 2019 21:29
BetaFlags: FeatureFlags which are automatically false for AppStore builds.
import UIKit
import PlaygroundSupport
// FeatureFlags vs. "BetaFlags". BetaFlags are automatically false for AppStore builds, which provides
// an extra level of safety against accidentally shipping a build which has beta features enabled.
struct FeatureFlags {
// Set to false to disable support for fancy doors.
@pepasflo
pepasflo / network.json
Last active March 27, 2019 17:31
A solution to the Interview Cake "MeshMessaging" problem (https://www.interviewcake.com/question/python/mesh-message)
{
"Min" : ["William", "Jayden", "Omar"],
"William" : ["Min", "Noam"],
"Jayden" : ["Min", "Amelia", "Ren", "Noam"],
"Ren" : ["Jayden", "Omar"],
"Amelia" : ["Jayden", "Adam", "Miguel"],
"Adam" : ["Amelia", "Miguel"],
"Miguel" : ["Amelia", "Adam"],
"Noam" : ["Jayden", "William"],
"Omar" : ["Ren", "Min"]