Skip to content

Instantly share code, notes, and snippets.

View nicinabox's full-sized avatar

Nic Haynes nicinabox

View GitHub Profile

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.

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 15:06
React Native common parts
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
#!/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
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);
},
:20000000EDFE0000000000019DAFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBE
:20002000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFE0
:20004000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFC0
:20006000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFA0
:20008000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF80
:2000A000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF60
:2000C000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF40
:2000E000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF20
:20010000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF
:20012000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFDF
@nicinabox
nicinabox / flash.sh
Last active November 13, 2022 18:16
Find the Pro Micro serial port automatically and flash it
#!/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 January 28, 2023 04:10
This guide covers building a Let's Split v2.

This guide has moved

To improve collaboration this guide is now available on GitHub.

Continue reading

const scale = ([domainMin, domainMax], [rangeMin, rangeMax]) => (val) => {
return ((val - domainMin) / (domainMax - domainMin)) * (rangeMax - rangeMin) + rangeMin
}