This guide has moved
To improve collaboration this guide is now available on GitHub.
To improve collaboration this guide is now available on GitHub.
#!/bin/bash | |
# Usage | |
# ./flash.sh path/to/your.hex | |
TARGET=$1 | |
ls /dev/tty* > /tmp/1 | |
echo "Reset your Pro Micro now" |
Anduril is an open-source firmware for flashlights, distributed under the terms of the GPL v3. The sources can be obtained here:
http://tiny.cc/TKAnduril https://bazaar.launchpad.net/~toykeeper/flashlight-firmware/trunk/files/head:/ToyKeeper/spaghetti-monster/anduril/
# $ crx `pwd` | |
function crx() { | |
~/Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --pack-extension=$@ --pack-extension-key=$@/key.pem | |
} |
/* | |
Author: Nic Aitch - @nicinabox | |
Version: 1.1 | |
Description: Basic device properties for use when checking screen size or mobile. | |
License: MIT | |
*/ | |
(function(window, document, undefined) { | |
var device = {}; |
convert favicon.png -bordercolor white -border 0 \ | |
\( -clone 0 -resize 16x16 \) \ | |
\( -clone 0 -resize 32x32 \) \ | |
\( -clone 0 -resize 48x48 \) \ | |
\( -clone 0 -resize 64x64 \) \ | |
-delete 0 -alpha off -colors 256 favicon.ico |
# confirm you can access the internet | |
if [[ ! $(curl -Is http://www.google.com/ | head -n 1) =~ "200 OK" ]]; then | |
echo "Your Internet seems broken. Press Ctrl-C to abort or enter to continue." | |
read | |
fi | |
# make 2 partitions on the disk. | |
parted -s /dev/sda mktable msdos | |
parted -s /dev/sda mkpart primary 0% 100m | |
parted -s /dev/sda mkpart primary 100m 100% |
I can't remember exactly why I started using this over the built in Terminal, but it's very customizable and feature rich.
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` |
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 |