Skip to content

Instantly share code, notes, and snippets.

Avatar

Jason Pepas (FloSports.tv) pepasflo

View GitHub Profile
View README.md

Robot arduino sketch

Some motor-control code for our robot kit.

View README.md

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:

View README.md

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:

View README.md

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 Apr 17, 2019
mathterp: A series of problems for the puzzles guild around implementing a simple math interpreter compiler
View README.md

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 Mar 27, 2019
A solution to the Interview Cake "MeshMessaging" problem (https://www.interviewcake.com/question/python/mesh-message)
View network.json
{
"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 Apr 12, 2019
BetaFlags: FeatureFlags which are automatically false for AppStore builds.
View BetaFlags.swift
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 Feb 27, 2019
A 'pod' script which called 'bundle exec pod' if a Gemfile exists, otherwise uses the system 'pod'
View README.md

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 Feb 26, 2019
Notes on creating a disk backup of a Mac using dd
View README.md

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 Feb 21, 2019
Is any permutation of a string a palindrome?
View palin.py
#!/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 = {}
You can’t perform that action at this time.