Skip to content

Instantly share code, notes, and snippets.

@noahcoad
noahcoad / whenVisible.js
Last active Nov 9, 2021
Utility function for Tampermonkey and Greasemonkey scripts to detect and handle AJAX elements and single page apps, waiting until elements exist and become visible
View whenVisible.js
//
// Description
// whenVisible(): a utility function for Tampermonkey and Greasemonkey
// scripts to detect and handle AJAX elements and single
// page apps, waiting until elements exist and become visible
//
// Created
// 2021-10-01 by Noah Coad http://coad.net
//
// Usage Example
View volume.sh
#!/bin/bash
# 2021-04-28 by Noah Coad
# simple bash script to turn the Mac OSX volume up, down, get value, or set
# vol = get current volume level
# vol u = volume up by 5%
# vol d = volume down by 5%
# vol 25 = set volume level between 0-100
re='^[0-9]+$'
dir=
@noahcoad
noahcoad / install_mongoose_os_mos_cli_tool_on_raspberry_pi_rpi.md
Created Jan 27, 2021
There isn't a build of the Mongoose OS mos cli tool for a Raspberry Pi provided, so this shows how to build the tool on an RPi
View install_mongoose_os_mos_cli_tool_on_raspberry_pi_rpi.md

Install Mongoose OS mos CLI Tool on Raspberry Pi RPi

I enjoy seeing how little my dev environment can actually be to accomplish cool stuff. Currently I'm using a terminal app on my iPhone to remote into a RPi0w connected to an ESP8266 dev board to code and program the ESP8266 'from my iphone'. Mongoose OS is a fantastic OS for the ESPxx family line, with it's super easy interface and tons of built-in support into the OS (configuration, common IoT platforms, event-driven javascript, libraries, etc).

View open_daily_google_chrome_bookmarks_folder.sh
#!/bin/bash
# open all the URLs under the "daily" folder on the
# Google Chrome bookmarks bar in a new window from the command line
# dependency: jq
jq '.roots.bookmark_bar.children[] | select(.name | contains("daily")) | .children[].url' \
< ~/Library/Application\ Support/Google/Chrome/Default/Bookmarks \
| xargs '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome' --new-window
View magentic_card_reader.ino
//
// Magnetic Card Reader with ESP32 Arduino
// Created on 2020-06-13 by Noah Coad
//
// Connect card reader cable to ESP32 pins:
// DATA (yellow) = 15, PRESENT (orange) = 14, STROBE (green) = 32
//
// I'm using Adafruit HUZZAH32 ESP32 Feather Board, but any ESP32 should work
// And the Magtek 21050071 card reader, which reads the 2nd card track only (encoded in 5 bits)
// Double check your card reader, which track(s) it reads, because track #1 is encoded differently
View crypto.ino
//
// Example of using ESP32 Arudino mbed library to
// Encrypt and Decrypt using an asyncronous RSA 2048 bit public and private key pair
// created 2020-07-05 by Noah Coad
//
// Inside a "data" directory, run these commands to generate a key pair
// then use the ESP32 Sketch Data Uploader to upload files to ESP32 SPIFFS files
//
// openssl genrsa -out private-rsa 2048
// openssl pkcs8 -topk8 -inform pem -in private-rsa -outform pem -nocrypt -out private
View base64.ino
// base64 encoding and decoding example on ESP32 Arudino
// using the built-in libb64 libraries
//
// ~/Documents/Arduino/hardware/espressif/esp32/cores/esp32/libb64/cdecode.h
// ~/Documents/Arduino/hardware/espressif/esp32/cores/esp32/libb64/cencode.h
#include "libb64/cdecode.h"
#include "libb64/cencode.h"
void setup() {
View rpi_vision_board_photo_frame.md

Raspberry Pi (RPi) Vision Board
or Photo Frame or Slideshow

I like to have a Raspberry Pi computer set up as a digital Vision Board, which is also the same as a photo frame or slideshow.

@noahcoad
noahcoad / remote_edit_file_sublime_text.md
Created Apr 3, 2020
Remote Edit Files w Sublime Text
View remote_edit_file_sublime_text.md

Remote Edit Files w Sublime Text

How to edit a file on a remote linux machine in your local Sublime Text editor. Thanks to @josiahcoad for inspiring me to post this. BOO YAH

View gist:ecd1ea41b12544caba7ae6a65f5ff60e
https://lovejoyisd.zoom.us/j/539961694?pwd=N2M1akFhMk9TMzlRNThtVUdjVi9KUT09