This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- | |
-- Aperture SFTP Exporter -- | |
-- by Tim O'Brien, t413.com | |
-- | |
-- -uses selected images in Aperture | |
-- -exports images to a subdirectory (asks each time, default is based on project name) | |
-- -growl notifications of sftp upload progress | |
-- -speed metrics (upload speed, export speed) | |
-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* -- USAGE: -- */ | |
//to start a new download | |
new GetHTTPsAsync("https://hi.com") { | |
//provide a callback: | |
protected void onPostExecute(String res) { | |
Log.v(res); //yay, new string! | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Author: Tim O'Brien | |
* Site: t413.com | |
* Lisence: Creative Commons Attribution-Noncommercial-Share Alike 3. | |
* this file updated: 12/23/09 | |
* | |
* Let me know if you're using or adapting this, | |
* Leave a comment, send an email, I'd like to hear about it. | |
*/ | |
#define M1 1 | |
#define M2 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
## update.sh - manage a OpenWRT LetsEncrypt https instalation | |
# HOWTO: | |
# - put update.sh in its own directory (like /root/.https) | |
# - run ./update.sh your.domain.com (that domain needs to point to your router) | |
# * this get an issued cert from letsencrypt.org using the webroot verification method | |
# * also installs curl and ca-certificates packages | |
# - use crontab -e; add the line `0 0 * * * "/root/.https/update.sh" >>/root/.https/log.txt 2>&` | |
# * this runs the update every day, logging everything to log.txt | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//compile with SparkFun Thing Dev, upload works great at 921600 Baud! | |
// backup demo flash first with `esptool.py read_flash 0x00000 0x400000 factory-0-0x400000.bin` | |
// restore with `esptool.py --baud 921600 write_flash 0x0000 factory-0-0x400000.bin` | |
// get esptool.py with `pip install esptool` | |
#include <ESP8266WiFi.h> | |
#include <U8g2lib.h> | |
#include <FastLED.h> | |
// the OLED used |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <FastLED.h> | |
#include <SPI.h> | |
#include <Wire.h> | |
#include <Adafruit_GFX.h> | |
#include <Adafruit_LEDBackpack.h> | |
#include <Encoder.h> | |
#include <avr/sleep.h> | |
#include <avr/power.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
[ -t 0 ] && hash tput 2>/dev/null && COLOR_SHELL=true || COLOR_SHELL=false | |
function clr_gr() { [ "$COLOR_SHELL" = true ] && echo "$(tput setaf 0)$(tput setab 2)"; } | |
function clr_bl() { [ "$COLOR_SHELL" = true ] && echo "$(tput setaf 7)$(tput setab 4)"; } | |
function clr_rd() { [ "$COLOR_SHELL" = true ] && echo "$(tput setaf 7)$(tput setab 1)"; } | |
function clr_or() { [ "$COLOR_SHELL" = true ] && echo "$(tput setaf 0)$(tput setab 3)"; } | |
function clr_ma() { [ "$COLOR_SHELL" = true ] && echo "$(tput setaf 7)$(tput setab 5)"; } | |
function endcolor() { [ "$COLOR_SHELL" = true ] && echo "$(tput sgr 0)" || echo "$@"; } | |
function echo_gr() { [ "$COLOR_SHELL" = true ] && echo "$(clr_gr) $@ $(endcolor)" || echo "$@"; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
[ -t 0 ] && hash tput 2>/dev/null && COLOR_SHELL=true || COLOR_SHELL=false | |
function clr_gr() { [ "$COLOR_SHELL" = true ] && echo "$(tput setaf 0)$(tput setab 2)"; } | |
function clr_bl() { [ "$COLOR_SHELL" = true ] && echo "$(tput setaf 7)$(tput setab 4)"; } | |
function echo_gr() { [ "$COLOR_SHELL" = true ] && echo "$(clr_gr) $@ $(endcolor)" || echo "$@"; } | |
function echo_bl() { [ "$COLOR_SHELL" = true ] && echo "$(clr_bl) $@ $(endcolor)" || echo "$@"; } | |
function endcolor() { [ "$COLOR_SHELL" = true ] && echo "$(tput sgr 0)" || echo "$@"; } | |
function logme() { echo_bl "$@" >&2; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### enables betaflight blackbox filesystem-mode, archives files, then erases blackbox (after manual power cycle) | |
# usage blackboxPull /dev/tty.my.serial [optional folder to output, default is pwd/logs] | |
function blackboxPull() { | |
port="${1}"; | |
folder="${2:-logs}"; | |
[ -f "$port" ] || { echo "port \"$port\" doesn't exist!"; return 1; } | |
{ echo "#"; sleep 0.5; echo msc; } >> "$port"; ##enables cli then sends command for flash download | |
sleep 4; | |
echo "copying files to ${folder}"; |