Skip to content

Instantly share code, notes, and snippets.

# Changelog
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
{{#each releases}}
{{#if href}}
## [{{title}}]({{href}}){{#if tag}} - {{isoDate}}{{/if}}
{{else}}
## {{title}}{{#if tag}} - {{isoDate}}{{/if}}

Keybase proof

I hereby claim:

  • I am gretzky on github.
  • I am gretzky (https://keybase.io/gretzky) on keybase.
  • I have a public key ASDBpSQKeWMHD9XO46fAYuwKJX69tPeki4hnPOhOiWD1kAo

To claim this, I am signing this object:

@gretzky
gretzky / Environment setup for React Native
Created March 22, 2021 17:06
This script will setup your environment for developing React Native applications
#!/bin/bash
## NOTE: be sure to replace the following instances in this script before running
# - replace APP_NAME with the name of your application (as a single word, PascalCase. ex. "MyApp")
# - replace 'zshrc' with your preferred shell config. if you don't know what this is (or you prefer zsh) you can leave this as is
# install xcode command line tools if not already installed
if ! xcode-select --print-path &> /dev/null; then
xcode-select --install &> /dev/null
@gretzky
gretzky / machine.js
Created February 16, 2021 16:41
Generated by XState Viz: https://xstate.js.org/viz
const createDialMachine = Machine({
id: "createDialMachine",
initial: "init",
context: {
createDial: null,
error: false,
errorMsg: '',
retries: 0
},
states: {
@gretzky
gretzky / machine.js
Last active February 16, 2021 16:42
Generated by XState Viz: https://xstate.js.org/viz
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
@gretzky
gretzky / machine.js
Created February 16, 2021 16:15
Generated by XState Viz: https://xstate.js.org/viz
const createDialMachine = Machine({
id: "createDialMachine",
initial: "init",
context: {
createDial: null,
error: false,
errorMsg: '',
retries: 0
},
states: {
for macOS Catalina, YMMV on other OS flavors
1. Open Automator
2. Select 'New document'
3. Select 'Quick Action'
4. Change 'workflow receives current' to 'image files'
5. In the far left pane, select 'Photos'
6. In the pane to the right of that, drag 'Change Type of Images' to the right
7. You'll see a pop-up. Select "don't add"
8. In the workflow, change the 'to type' to JPG (or your desired format)
@gretzky
gretzky / android-without-studio.md
Last active January 7, 2021 03:55
Android development without Android studio (macOS)

Android Development without Android Studio

Note, most of my Android development is React Native based, so YMMV.

Prerequisites

  • Homebrew
  • Xcode (installed from App store)
  • Xcode command line tools (xcode-select --install)
// this method executes a reducer function on each element of the array
// in this case, if the current value (b) is an array, we recurse through
// and concatenate the nested element to a new, empty array (regardless of how deeply nested it is)
// if the element isn't nested, we simply just add it to the new array
// this approach avoids mutation of the original array
//
// more on .reduce - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/reduce
// more on recursion/functional patterns - https://medium.com/dailyjs/functional-js-with-es6-recursive-patterns-b7d0813ef9e3
// even more on recursion - https://marmelab.com/blog/2018/02/12/understanding-recursion.html
const flattenArr = (arr) => arr.reduce(
@gretzky
gretzky / jupyter-venv.md
Created November 9, 2019 15:54
Set up a virtualenv for Jupyter Notebook with ML tools

Install conda

conda create -n venv python=3.7
conda activate venv
conda install nb_conda pandas matplotlib numpy scikit-learn 
conda install -c conda-forge keras tensorflow
python -m ipykernel install --user name venv