Skip to content

Instantly share code, notes, and snippets.

@iamamused
iamamused / optparsing_demo.zsh
Created April 3, 2022 03:31 — forked from mattmc3/optparsing_demo.zsh
Zsh option parsing example
# Manual opt parsing example
#
# Features:
# - supports short and long flags (ie: -v|--verbose)
# - supports short and long key/value options (ie: -f <file> | --filename <file>)
# - supports short and long key/value options with equals assignment (ie: -f=<file> | --filename=<file>)
# - does NOT support short option chaining (ie: -vh)
# - everything after -- is positional even if it looks like an option (ie: -f)
# - once we hit an arg that isn't an option flag, everything after that is considered positional
function optparsing_demo() {
@iamamused
iamamused / parse_dotenv.bash
Created March 3, 2021 20:29 — forked from judy2k/parse_dotenv.bash
Parse a .env (dotenv) file directly using BASH
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
@iamamused
iamamused / Pinout_EPS32.txt
Created February 19, 2020 16:03
ESP32 Development Board Pinout Ascii Art
Unoffical ESP32 Development Board Pinout Ascii Art
For more information:
https://www.espressif.com/en/products/hardware/esp32/overview
https://lastminuteengineers.com/esp32-arduino-ide-tutorial/#esp32-development-board-pinout
@iamamused
iamamused / Pinout_Feather_HUZZAH32.txt
Last active February 7, 2023 00:02
Feather HUZZAH32 Pinout Ascii Art
This is an unofficial pinout diagram of the Adafruit Feather Huzza32 (ESP32) board:
https://learn.adafruit.com/adafruit-huzzah32-esp32-feather
For more information about this diagram, see:
https://learn.adafruit.com/adafruit-huzzah32-esp32-feather/pinouts
+-------------------+
| O | USB | O |
import React, { Component } from 'react';
import {
CardElement,
injectStripe,
StripeProvider,
CardNumberElement,
CardExpiryElement,
CardCVCElement,
Elements
} from 'react-stripe-elements';
@iamamused
iamamused / _hover_example.py
Created June 6, 2018 15:42 — forked from dankrause/_hover_example.py
Example code to use the (unofficial, unsupported, undocumented) hover.com DNS API.
import requests
class HoverException(Exception):
pass
class HoverAPI(object):
def __init__(self, username, password):
params = {"username": username, "password": password}
r = requests.post("https://www.hover.com/api/login", params=params)
@iamamused
iamamused / 00. tutorial.md
Created January 29, 2018 21:19 — forked from maxivak/00. tutorial.md
Importing/Indexing database (MySQL or SQL Server) in Solr using Data Import Handler
@iamamused
iamamused / build.gradle
Created May 10, 2016 16:29 — forked from tprochazka/build.gradle
Smart versionName and versionCode for android Gradle build evaluation
/**
* Will return version from properties file and replace -SNAPSHOT by GIT commit hash
* to recognize origin commit for the every build.
*/
project.ext.evalVersionName = {
def ideBuild = project.properties['android.injected.invoked.from.ide']
if (ideBuild) {
logger.info("IDE build");
return "dev"
} else if (project.VERSION.toUpperCase().contains("SNAPSHOT")) {
@iamamused
iamamused / AppDelegate.m
Created April 13, 2016 13:55
CocoaLumberjack with colours and line numbers, common config
#import "AppDelegate.h"
// install XcodeColors plugin https://github.com/robbiehanson/XcodeColors
// install KZLinkedConsole plugin https://github.com/krzysztofzablocki/KZLinkedConsole
// Include cocoalumberjack in your pods
// pod 'CocoaLumberjack', '~> 1'
// NOTE this will work for version 2 as well, just need to tweak it.
#import <CocoaLumberjack/DDASLLogger.h>
#import <CocoaLumberjack/DDTTYLogger.h>
@iamamused
iamamused / zoho.js
Created February 21, 2013 15:42
[Quickscript](http://canisbos.com/quickscript) scripts
// urls:https://projects.zoho.com/*
// Inject so we're running in the document context
function inject(newScript) {
var oScript = document.createElement("script");
oScript.language = "javascript";
oScript.type = "text/javascript";
oScript.text = newScript;
document.getElementsByTagName('BODY').item(0).appendChild(oScript);
}