Skip to content

Instantly share code, notes, and snippets.

View zfogg's full-sized avatar
🔐
24BD65F25E5D7311F5FFB2D3EDDAE1DA7360D7F4

Zachary Fogg zfogg

🔐
24BD65F25E5D7311F5FFB2D3EDDAE1DA7360D7F4
View GitHub Profile
@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 — forked from memeplex/base16.py
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 (carlosjosepita@gmail.com).
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__ = "zach@wearableintelligence.com"
import xlwt, csv, os
@zfogg
zfogg / fizzbuzz.hs
Last active August 29, 2015 14:08
overly-complex fizzbuzz
mergeWords = zipWith (\x -> (++) x . (++) " ")
fizzs = tail . repeat $ "Fizz" : replicate 4 ""
buzzs = tail . repeat $ "Buzz" : replicate 2 ""
fizzBuzzs = tail . repeat $ "FizzBuzz" : replicate 14 ""
numbers = map ((:[]) . show) [0..]
main = mapM_ putStrLn $ tail $
map (last . words) . foldl1 mergeWords $
@zfogg
zfogg / myweechat
Last active August 29, 2015 14:04 — forked from pascalpoitras/config.md
# Encrypted password in sec.conf
/secure passphrase <pass>
/secure set bncpass <pass>
# Default setting for all network

Keybase proof

I hereby claim:

  • I am zfogg on github.
  • I am zfogg (https://keybase.io/zfogg) on keybase.
  • I have a public key whose fingerprint is 20A5 A16B AFEA E60B C906 2612 EC96 825B 93D7 D925

To claim this, I am signing this object: