Skip to content

Instantly share code, notes, and snippets.

View zfogg's full-sized avatar
🔐
897607FA43DC66F612710AF97FE90A79F2E80ED3

Zachary Fogg zfogg

🔐
897607FA43DC66F612710AF97FE90A79F2E80ED3
View GitHub Profile
@zfogg
zfogg / blockstack-verification.txt
Created April 9, 2018 11:07
Blockstack verification
Verifying my Blockstack ID is secured with the address 12Y9URumipMVGdnwTf6G2pVC2ZAaXRtcsH https://explorer.blockstack.org/address/12Y9URumipMVGdnwTf6G2pVC2ZAaXRtcsH
@zfogg
zfogg / gist:38defa71b98a242b51bd74941f5e78d6
Created December 8, 2017 05:02 — forked from strathmeyer/gist:4990173
Improve OSX Bluetooth quality
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Max (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" 48
defaults write com.apple.BluetoothAudioAgent "Apple Initial Bitpool (editable)" 40
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool" 48
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Max" 53
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Min" 48
defaults write com.apple.BluetoothAudioAgent "Stream - Flush Ring on Packet Drop (editable)" 30
defaults write com.apple.BluetoothAudioAgent "Stream - Max Outstanding Packets (editable)" 15
defaults write com.apple.BluetoothAudioAgent "Stream Resume Delay" "0.75"
@zfogg
zfogg / dotfiles.dotvim.tree.zsh
Created June 9, 2017 01:47
/Users/zfogg/.vim/
18:44:18 [:~] %
> cd .vim
18:44:21 [:~/.vim] master(+291/-219)+* ±
> pwd
/Users/zfogg/.vim
18:44:24 [:~/.vim] master(+291/-219)+* ±
> tree
.
├── [5.8k] after
│   ├── [1.1k] autoload
@zfogg
zfogg / base16.py
Created December 30, 2016 10:00
Base16 default theme for ipython + pygments + prompt toolkit closely matching vim base16 theme.
# -*- coding: utf-8 -*-
"""
Base16 Default Dark by Chris Kempson (http://chriskempson.com).
IPython Template by Carlos Pita ([email protected]).
Created with Base16 Builder by Chris Kempson.
"""
from prompt_toolkit.terminal.vt100_output import _256_colors
@zfogg
zfogg / uninstall_xquartz.sh
Created December 3, 2016 04:22 — forked from bustbr/uninstall_xquartz.sh
Uninstall XQuartz.app from OSX Yosemite/El Capitan/Sierra
#!/bin/sh
set -e
launchctl unload /Library/LaunchAgents/org.macosforge.xquartz.startx.plist
sudo launchctl unload /Library/LaunchDaemons/org.macosforge.xquartz.privileged_startx.plist
sudo rm -rf /opt/X11* /Library/Launch*/org.macosforge.xquartz.* /Applications/Utilities/XQuartz.app /etc/*paths.d/*XQuartz
sudo pkgutil --forget org.macosforge.xquartz.pkg
rm -rf ~/.serverauth* ~/.Xauthorit* ~/.cache ~/.rnd ~/Library/Caches/org.macosforge.xquartz.X11 ~/Library/Logs/X11
@zfogg
zfogg / .cvimrc.vim
Created September 5, 2016 10:36
chromium-vim (cVim) - custom config
let mapleader = ","
map ; :
unmap :
@zfogg
zfogg / flux-async-actions.md
Last active August 21, 2018 15:32
Flux - brainstorming patterns for async actions

Flux - all about async actions

So, let's say you have a basic Flux action that fetches remote data asynchronously, and then dispatches that data to its store. The dispatch is called after the async fetch completes, using a promise or callback. Nothing out of the ordinary here! Just your standard async control flow patterns.

Next, let's say we take this action, tie it to a button's onClick, and then we click it. If the async call takes a bit of time to complete (as they tend to do), that click would feel like it either didn't go through or threw an error, because any components listening to the store would do absolutely nothing until the callback completes or the promise resolves (which is when the dispatch will occur).

UI interactions should always give feedback immediately.

If they don't, interactions feel unresponsive, and the app will feel 'broken' in many situations. It will be frustrating to use at the very least!


@zfogg
zfogg / .eslintrc
Last active October 7, 2015 00:05
Awesome default eslint config (won't work as .js; use the JSON)
{
"parser": "babel-eslint",
"plugins": [
"react",
"babel"
],
"env": {
"browser": true,
@zfogg
zfogg / CSVsToWorksheets.py
Created December 16, 2014 03:59
Convert a folder of CSVs into an Excel workbook, one worksheet per file.
#!/usr/bin/python
"""CSVsToWorksheets.py: takes a folder of CSVs and puts them into a single Excel workbook, one worksheet per file."""
__author__ = "Zach Fogg"
__email__ = "[email protected]"
import xlwt, csv, os
@zfogg
zfogg / fizzbuzz.hs
Last active September 20, 2025 05:56
overly-complex fizzbuzz
import Data.List (transpose)
-- These are infinite lists with a cycle of a "string" followed by N "" empty strings,
-- ["string", "", "", "string", "", "", ...]
fizzs = concat $ repeat $ "Fizz" : replicate 2 ""
buzzs = concat $ repeat $ "Buzz" : replicate 4 ""
fizzBuzzs = concat $ repeat $ "FizzBuzz" : replicate 14 ""
-- All the non-negative integers as strings
-- ["0", "1", "2", ...]