Skip to content

Instantly share code, notes, and snippets.

View don-smith's full-sized avatar
🧘

Don Smith don-smith

🧘
  • HYPR
  • Tākaka, NZ
View GitHub Profile

Code review feedback

  • Rename firebaseInit.js to api/index.js or something similar that is not tied to a technology.

    • This will let you export each function from its own file (imported into index.js)
    • Import library code (firebase, ramda) before your code (dbInit)
    • Remove commented out code
  • If we're not using Firebase UI, we should remove the config in dbInit.

@don-smith
don-smith / hippy.zsh-theme
Last active August 29, 2016 08:44
A thoughtful ZSH theme
# ZSH Theme inspired by the bira theme
local return_code="%(?..%{$fg[red]%}%? ↵%{$reset_color%})"
if [[ $UID -eq 0 ]]; then
local user_host='☮ %{$terminfo[bold]$fg[red]%}%n@%m%{$reset_color%}'
else
local user_host='☯'
fi
@don-smith
don-smith / mac-setup.md
Created May 12, 2016 22:35
How I treat each new Mac I appropriate

My OS X Setup Guide

Config

  • Adjust trackpad settings to my liking (Preferences > Trackpad)
  • Remap caps-lock to control (Preferences > Keyboard > Modifier Keys... button)

Install

Keybase proof

I hereby claim:

  • I am don-smith on github.
  • I am dons (https://keybase.io/dons) on keybase.
  • I have a public key ASBbQQXmwXqah0-QLLYij98BHENiGa4jSp5R3RTR11eKPAo

To claim this, I am signing this object:

@don-smith
don-smith / generators.md
Created October 24, 2015 20:14 — forked from learncodeacademy/generators.md
What are Javascript Generators?

##what are generators##

  • They're pausable functions, pausable iterable functions, to be more precise
  • They're defined with the *
  • every time you yield a value, the function pauses until .next(modifiedYieldValue) is called
var myGen = function*() {
  var one = yield 1;
  var two = yield 2;
  var three = yield 3;
 console.log(one, two, three);
@don-smith
don-smith / bar.js
Last active October 17, 2015 05:50
A few examples of exporting and importing ES6 modules
export function gar() {
console.log('bar.gar');
}
export function zar() {
console.log('bar.zar');
}
function hidden() {
console.log('no see me');
! ~/.Xmodmap
! Activate with xmodmap ~/.Xmodmap
!
! Enable natural scrolling (horizonal and vertical)
!
pointer = 1 2 3 5 4 7 6 9 8 10 11 12
!
! Swap Caps_Lock and Control_L
@don-smith
don-smith / synaptics.conf
Last active October 14, 2015 01:43
My trackpad settings in Debian 8 on my ASUS ZenBook (UX303LA)
# /etc/X11/xorg.conf.d/synaptics.conf
# More info: http://www.x.org/archive/X11R7.5/doc/man/man4/synaptics.4.html
Section "InputClass"
Identifier "Touchpad catchall"
Driver "synaptics"
MatchIsTouchpad "on"
MatchDevicePath "/dev/input/event*"
Option "TapButton1" "1" # left click
Option "TapButton2" "3" # right click
Option "TapButton3" "2" # middle click
/**
* Originally created in JS Bin: http://jsbin.com/yetubi/edit?js,console
* Dependencies: lodash
*
* This script finds 4 whole number values that have a specific relationship.
* Specifically, the sum of the squares of 3 numbers when they equal the
* square root of the 4th number. In linear algebra terms, this calculates
* the absolute value of a vector [x, y, z] when all values and the result
* are whole numbers. This formula is also known to calculate the distance
* of a 3D point from zero: d = sqrt(x*x + y*y + z*z)
@don-smith
don-smith / neurons.r
Created April 1, 2015 09:59
Perceptron and Sigmoid neuron behaviour
library(ggplot2)
# calculates the output of a sigmoid neuron
# given the denormalized result of a perceptron
sigmoidize <- function(z) {
1 / (1+exp(-z))
}
# normalizes the value of a perceptron
normalize <- function(input) {