Skip to content

Instantly share code, notes, and snippets.

View mcint's full-sized avatar

Loren McIntyre mcint

  • Berkeley/San Francisco, CA, USA
  • 16:09 (UTC -07:00)
View GitHub Profile
@mcint
mcint / monkey-semantle.js
Last active March 28, 2024 14:00
violentmonkey script, for semantle.com - make similarity tiers visible at end of line
// ==UserScript==
// @name New script semantle.com
// @namespace Violentmonkey Scripts
// @match https://semantle.com/*
// @grant none
// @version 1.0
// @author mcint
// @description 3/27/2024, 10:18:04 PM
// ==/UserScript==
@mcint
mcint / stub.tabs-brave.jxa
Last active December 30, 2023 22:15
Bash script to call Applescript to export a list of urls and titles, grouped by window, and output in the format of OneTab.
-- Javascript for Automation
-- *this* works, but simple naive JS-literate variants do not.
-- prepending newlines b/c values are returned with implicit trailing ","
Application("Brave")
.windows.tabs()
.map(w=>"\n"+
w.map(t=>"\n"+
t.url()+" | "+t.title()))
@mcint
mcint / minimal-parser-example.bash
Last active July 19, 2023 23:56
Minimal parser and interpreter
#!/usr/bin/env bash
: ${DEBUG:=} # 0 ... 2
shopt -s extglob
debug(){ if [[ $DEBUG -ge $1 ]]; then shift 1; eval "${@}"; fi; }
debug 2 shopt -p extglob
acceptArg () {
local spec="$1" cb="$2" arg="$3";
{
"settingsVersion": "1.63.3",
"exclusionRules": [
{
"pattern": "https?://mail.google.com/*",
"passKeys": ""
}
],
"filterLinkHints": true,
"waitForEnterForFilteredHints": true,
@mcint
mcint / gist:3de07d8a2bebd6111c4eae0b632a5383
Created December 6, 2019 22:19
Jinja template testing one-liner
# pip3 install fluentpy jinja2
python3 -m fluentpy '_.lib.jinja2.Template("""asdf\n{% if "qwer" in lst %}rewq{% endif %}\nfdsa""").render({"lst":["qwer"]}).print()'
@mcint
mcint / ke_config_skel.sh
Last active July 3, 2019 22:11 — forked from david-thorman/ke_config_skel.sh
Kloudless Enterprise configuration file skeleton generator
#!/bin/bash
set -eu -o pipefail
gen_priv() {
openssl genrsa 2048 2> /dev/null
}
gen_pub() {
echo "${1}" | openssl rsa -pubout 2> /dev/null
}

Keybase proof

I hereby claim:

  • I am mcint on github.
  • I am mcint (https://keybase.io/mcint) on keybase.
  • I have a public key ASCfrC1CkNEqo47DDEgRsIdKR5ID8BGp719vfN0__wfCFAo

To claim this, I am signing this object:

### Keybase proof
I hereby claim:
* I am mcint on github.
* I am mcint (https://keybase.io/mcint) on keybase.
* I have a public key ASCUlyLiIN-lEUEuiJGoi1vceKBWs4nu9TifsX--2O99Ywo
To claim this, I am signing this object:
@mcint
mcint / unix-decal-lab1
Created September 19, 2017 12:44
Lab 1 - VPS setup
# Unix SysAdmin Decal
## Lab 1: Unix, the Shell, OSS {#lab1}
[Slides](https://ocf.io/decal/slides/1) and [lab](https://ocf.io/decal/labs/1) links for Tuesday 9-12-2017.
### Table of Contents {#toc}
1. [Create ssh key](#ssh-create)
2. [VPS hosting provider](#vps-hosting)
- We'll be providing the machines, one of
- Amazon Web Services
- Google Cloud Platform - account provided by us
- Digital Ocean
if [[ "$PATH" =~ "%" ]]; then
PATH="$((for SUB in $(echo $PATH | tr : '\n'); do [[ \"$SUB\" =~ \"%\" ]] && (echo \"$(printenv `echo $SUB|cut -d% -f2`)$(echo $SUB|cut -d% -f3)\" | sed 's_C:_/c_g' | sed 's_\\_/_g') || echo $SUB; done) | tr '\n' : | sed 's_:$__')"
fi