Skip to content

Instantly share code, notes, and snippets.

View canadaduane's full-sized avatar

Duane Johnson canadaduane

View GitHub Profile
@canadaduane
canadaduane / .zshrc
Created April 8, 2024 14:51
Reformat graphite.dev output to link to github when submitting
# Normally, graphite wants to point you to their website after you submit a stack. I don't use their website, and I
# would prefer to go directly to the github PR. I wrote an alias that uses `unbuffer` to keep all of the nice ansi color
# and formatting, while replacing the final URL displayed with a github URL.
#
# Install unbuffer:
# - Mac OS: `brew install expect`
# - Ubuntu Linux: `sudo apt install expect`
#
# I have this in my .zshrc; "gts" is short for "gt submit":
export type TaskJobType =
| 'chat.created'
| 'chat.messageSent'
| 'content.generateCoursePipeline'
| 'content.generateOutcomeRubrics'
| 'content.getTopicActivities'
| 'content.getTopicActivity'
| 'content.getTopicDescription'
| 'etl.humanloopProjects' // cron task
| 'healthcheck.ping'
@canadaduane
canadaduane / Filter-NGPVAN-Political-Emails.md
Last active February 6, 2024 18:16
Move Incoming NGPVAN Political Emails in Gmail to Spam (Google Apps Script)
  1. Go to https://script.google.com
  2. Create a New Project
  3. Replace the Code.gs file it creates for you with the javascript below (copy/paste)
  4. Save the script
  5. Go to Triggers (looks like an alarm clock on left-hand side)
  6. Create a Trigger that acts every 10 minutes and calls filterNGPVANSpam
  7. You'll need to authorize this script to act on your behalf, which may require that you use the scary "Advanced" section to allow the script to read/write to your email inbox.
@canadaduane
canadaduane / package.json
Last active April 13, 2023 14:25
Using Turborepo for build and Overmind for process management
{
//... snip ...
"scripts": {
"dev": "sh -c '(export TURBO_ARGS=\"${*}\"; turbo dev:deps $TURBO_ARGS && overmind start --root . --no-port --procfile $(node run-dev.mjs))' zero",
"dev:dry": "turbo dev --dry=json $TURBO_ARGS"
}
}
@canadaduane
canadaduane / VSCodium.md
Created January 27, 2023 02:44
Some screenshots of VSCodium on Pop!_OS

image

image

@canadaduane
canadaduane / jquery.textselect.js
Created February 12, 2011 05:29
jQuery Text Selection method and events
/* jQuery plugin textselect
* version: 1.0
* tested on jQuery 1.3.2, 1.5
* author: josef.moravec@gmail.com, duane.johnson@gmail.com
*
* usage:
* $(function() {
* $(document).bind('textselect', function(e) {
* Do stuff with e.text
* });
@canadaduane
canadaduane / myserver.conf
Created April 14, 2020 03:56
nginx configuration for yjs over https reverse proxy
server {
listen 80 ;
# listen [::]:80 ipv6only=on;
root /var/www/html;
index index.php index.html index.htm;
server_name y.relm.us;
location / {
@canadaduane
canadaduane / generate_wave.js
Last active June 23, 2019 14:26
Generate Wave card for Game Builder
// User-editable properties for this card:
export const PROPS = [
propNumber('range', 10)
];
// Make surrounding things tagged with "wave" do The Wave
export function onTick() {
card.cycle = (card.cycle || 0) + 1;
let actors = overlapSphere(getPos(), props.range);
@canadaduane
canadaduane / ron-test.sh
Last active May 13, 2019 16:11
Ignorantly trying to use RON swarmdb CLI
./swarmdb new --help
# NotFound$~~~~~~~~~~
# no replica found (.swarmdb)
./swarmdb init
./swarmdb new
# BADARGS$~~~~~~~~~~
# new <rdt> [as objectname] [on BranchName]
# create an empty object of the given type
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.