Skip to content

Instantly share code, notes, and snippets.

Nic Haynes nicinabox

Block or report user

Report or block nicinabox

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View anduril.md
View terminal notes.md

screen shot 2018-01-26 at 13 59 43

iTerm

I can't remember exactly why I started using this over the built in Terminal, but it's very customizable and feature rich.

zsh

Originally I switched to zsh to try something different from bash. Now I rely on features like hook functions and syntax highlighting.

View auto_workon.sh
function auto_workon() {
CURPWD=`pwd`
if [[ $CURPWD = "$ACTIVE_CURPWD"* ]] && [ -n "${ACTIVE_ENV+1}" ]; then
return
fi
if [[ -f .venv ]]; then
NEXT_ACTIVE_ENV=`cat .venv`
@nicinabox
nicinabox / http.js
Created May 8, 2017
React Native common parts
View http.js
const toJSON = r => r.json()
const checkStatus = (r) => {
if (r.ok) return r
return toJSON(r)
.then((body) => {
let error = new Error(r.statusText)
error.body = body
error.response = r
View rolls.sh
#!/bin/bash
# Usage: rolls.sh PATH
for path in $1/**; do
dirname=`basename "$path"`
for file in $path/**; do
exiftool -overwrite_original -headline="roll $dirname" "$file"
done
View react-popover.diff
checkForOuterAction: function checkForOuterAction(event) {
+ if (event.defaultPrevented) return
var isOuterAction = !this.containerEl.contains(event.target) && !this.targetEl.contains(event.target);
if (isOuterAction) this.props.onOuterAction(event);
},
View eeprom-lefthand.eep
:20000000EDFE0000000000019DAFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBE
:20002000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0
:20004000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0
:20006000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA0
:20008000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF80
:2000A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF60
:2000C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF40
:2000E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF20
:20010000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
:20012000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDF
@nicinabox
nicinabox / flash.sh
Last active May 8, 2019
Find the Pro Micro serial port automatically and flash it
View flash.sh
#!/bin/bash
# Usage
# ./flash.sh path/to/your.hex
TARGET=$1
ls /dev/tty* > /tmp/1
echo "Reset your Pro Micro now"
@nicinabox
nicinabox / lets split build guide.md
Last active May 20, 2019
This guide covers building a Let's Split v2.
View lets split build guide.md

This guide has moved

To improve collaboration this guide is now available on GitHub.

Continue reading

View linearScale.js
const scale = ([domainMin, domainMax], [rangeMin, rangeMax]) => (val) => {
return ((val - domainMin) / (domainMax - domainMin)) * (rangeMax - rangeMin) + rangeMin
}
You can’t perform that action at this time.