Skip to content

Instantly share code, notes, and snippets.

View pepasflo's full-sized avatar

Jason Pepas (FloSports.tv) pepasflo

View GitHub Profile

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 / 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"]
@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 / README.md
Last active February 27, 2019 18:21
A 'pod' script which called 'bundle exec pod' if a Gemfile exists, otherwise uses the system 'pod'

A pod wrapper script which calls bundle exec pod if a Gemfile is found

When working with a team of iOS developers, it can be useful to keep all team members on the same version of the pod command (different versions of pod can result in wildly different Xcode project files, resulting in a lot of noise in pull-requests).

One way to do this is to include a Gemfile in your github repo, which specifies a specific version of Cocoapods:

$ cat Gemfile
source 'https://rubygems.org'
gem 'fastlane'
@pepasflo
pepasflo / README.md
Last active February 26, 2019 19:45
Notes on creating a disk backup of a Mac using dd

Note: this is just a draft -- the last time I followed this process was a few years ago, so don't use this guide until I actually give it a test run.

Create a "disaster recovery" backup of your Mac by making an exact copy of the disk

In addition to using something like Time Machine to backup your Mac, I also recommend creating a "disaster recovery" backup by making an exact byte-for-byte copy of the hard drive itself. This is a universal method which can be used with any kind of computer (not just Macs).

If the hard drive contents are changing while backup is in-progress, this can result in a corrupted backup. This means you can't be booted from the hard drive which you are trying to backup. In the old days, this was easy: simply remove the hard drive from the machine, plug it into another machine, and image the drive.

@pepasflo
pepasflo / palin.py
Created February 21, 2019 21:06
Is any permutation of a string a palindrome?
#!/usr/bin/env python
import sys
def is_odd(x):
return x % 2 == 1
# is any permutation of a string a palindrome?
def anypalin(string):
charcounts = {}