Skip to content

Instantly share code, notes, and snippets.

Jeremy W. Sherman jeremy-w

Block or report user

Report or block jeremy-w

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@jeremy-w
jeremy-w / zoom-auto-close-tab.user.js
Last active May 23, 2019
Zoom: Auto-Close App Bouncer Tab #userscript
View zoom-auto-close-tab.user.js
// ==UserScript==
// @name Zoom: Auto-Close App Bouncer Tab
// @namespace https://bignerdranch.com/
// @version 1.0
// @description Close the tab Zoom uses to redirect to its app after several seconds.
// @author Jeremy W. Sherman <jeremy@bignerdranch.com>
// @downloadURL https://gist.github.com/jeremy-w/8d04eb16d48357b150ec2d9337129702/raw/be1298fce020667b8b0cf5fd644bc6bbe0761976/zoom-auto-close-tab.user.js
// @match https://zoom.us/j/*
// @grant none
// ==/UserScript==
@jeremy-w
jeremy-w / MainActivity.kt
Last active Feb 25, 2019
Exploring how Moshi reacts to missing required JSON fields, thanks to Arek Olek's prompting
View MainActivity.kt
/**
This was a small test bench to see how [Moshi](https://github.com/square/moshi)
behaves in the face of missing JSON fields.
It was prompted by Arek Olek's comment on
["When Nullability Lies"](https://www.bignerdranch.com/blog/when-nullability-lies-a-cautionary-tale/)
about how Gson's skullduggery in the service of easy JSON parsing
let a not-null field wind up null, go boom under the SQLite lock,
and take out an entire app process.
@jeremy-w
jeremy-w / named-match-repro.kts
Created Nov 16, 2018
How do you access a named group in Kotlin?
View named-match-repro.kts
#!/usr/bin/env kotlinc -script --
/**
@file named-match-repro.kts
@author Jeremy W. Sherman (GitHub: @jeremy-w)
Demo of some perplexing behavior.
Questions:
- Main question: How do I access a named capture group in a Kotlin script?
@jeremy-w
jeremy-w / [Better developers] Where (and how) Git stores your files.txt
Last active Aug 31, 2018
Git in a Nutshell - from Reuven Lerner's *Better Developers* newsletter, 2018-03-19 edition
View [Better developers] Where (and how) Git stores your files.txt
This week, let's take a break from Python and talk a little bit
about Git ( http://t.dripemail2.com/c/eyJhY2NvdW50X2lkIjoiNjE2ODIxOCIsImRlb=
Gl2ZXJ5X2lkIjoiMjMxMTgyMzY3OSIsInVybCI6Imh0dHA6Ly9naXQtc2NtLmNvbS8_X19zPXhz=
d2dxc3FiNHFuMml6d3c0aXloIn0 ). I teach Git courses every few
months, and without fail people come into the class saying that
they have been using Git for a few months, and it seems to work
OK so long as they use the list of commands that their boss
provided. But if something happens that isn't on that list, and
if they cannot figure out what to do based on Stack Overflow,
they're sunk.
@jeremy-w
jeremy-w / Apero_2017-12-19-170132_Eclipse.crash
Created Dec 20, 2017
Apero crash after Cmd-Return posting a message
View Apero_2017-12-19-170132_Eclipse.crash
Process: Apero [58055]
Path: /Applications/Apero.app/Contents/MacOS/Apero
Identifier: io.aya.Apero
Version: 1.7.3 (23)
App Item ID: 1219902108
App External ID: 825340621
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Apero [58055]
User ID: 501
View adn_stars_clean.py
#coding: utf-8
import sys
import json
import requests
import datetime
user_id = sys.argv[1] # use @username format here
adn_token = sys.argv[2] # Your ADN token
auth_data = 'Bearer ' + adn_token
@jeremy-w
jeremy-w / blurb.fish
Created Mar 10, 2017
Fish function to create or reply to a social post on 10 Centuries. MPLv2
View blurb.fish
function blurb --description Post\ to\ 10C.\\nblurb\ post\ MESSAGE\\nblurb\ POST_ID\ REPLY --argument reply_id message
set -l token $TEN_CENTURIES_API_TOKEN
set -l endpoint https://api.10centuries.org/content/write
set -l usage 'blurb: post or reply to a message on 10C
Usage:
blurb post MESSAGE
Post a new blurb
View dump-header-map.c
//cc -Wextra -o build/dump-header-map dump-header-map.c
// see: https://github.com/llvm-mirror/clang/blob/release_40/include/clang/Lex/HeaderMapTypes.h
// https://github.com/llvm-mirror/clang/blob/release_40/include/clang/Lex/HeaderMap.h// https://github.com/llvm-mirror/clang/blob/release_40/lib/Lex/HeaderMap.cpp
// This is basically dump() from there.
#include <stdio.h>
#include <stdlib.h>
#include <sysexits.h>
#include <err.h>
View pascal.c
// pascal.c -- demonstrates effect of -fpascal-strings
// install -d build/ && cc -fpascal-strings pascal.c -o build/pascal
#include <stdio.h>
#include <string.h>
#include <vis.h>
static const char PascalString[] = "\pWirth";
static char VisifiedString[4 * (sizeof(PascalString) - sizeof('\0')) + sizeof('\0')];
int
@jeremy-w
jeremy-w / just a b64 url.txt
Created Oct 3, 2016
Editorial workflow to propose a filename for Markdown file based on first h1 and current date
View just a b64 url.txt
editorial://add-workflow?workflow-data-b64=eNrNVdtqGzEQ_RWhUuhlY-zSp30JqZOmgbgxttNQmjZMpFlbZC0JXWIHs9Cv6Us_oW_5lH5JR7bXcRwKIQ8muy_izNHMnDNa7YwrYTTP-eBr96h98rm_s3d8fNE-HTSsHvKMgwjKaM_zbzNuIXr8gIVx2ItaKyLkBZQes0XoTIWRiaE_MhOKdcHBGAM6v2KJ6IMZD1QokSpSdlGCpzA_M-6qKM1kb17tEMOBVMG4AU4DT8nvMs14YUqJMoVObGLzvJmtgT20JQgcow6U-O_PX7yqsu313oEgRj0cxhLcwdQ69D71uCnC4RCnaRFubMoH8hq0WCggcjBXqHugh5jYFQEJz_mPF-fn_s2rxtvXnMBxqnXoTLQUam1XZ5_Gg1_AKbgk4qY8TWvaIo2IaRAXYZ4u49dQRnysbD5rZqxVEe1I2xj4nQ27pPX5iYXwBInvlhJfpu15p0OU2ft7mJQJa97DbuhZ92OH3ufoicbJU2dfG_PgDK2smBu-ZgLbugUY2qWylwac3HRgu41Qgk-n-w-mQNjc3Ueb3vrPB3f7e_f2DxPGKpQsGCZq2Y1EktHB6iZe_E6aVfU9q0_BR1ViWrLCmTHbp7Ex0JINlgOV6IVTy7ucd2PwDJiPQ2oqULmi3m00CyNkFgiui_8DX4Fgiw~~
You can’t perform that action at this time.