Skip to content

Instantly share code, notes, and snippets.


Dan Levy justsml

View GitHub Profile
View hammerspoon-init.lua
-- credit:
--[[ function factory that takes the multipliers of screen width
and height to produce the window's x pos, y pos, width, and height ]]
function baseMove(x, y, w, h)
return function()
local win = hs.window.focusedWindow()
local f = win:frame()
local screen = win:screen()
local max = screen:frame()
justsml /
Last active Jun 16, 2021
Fix Open files limit on MacOS OSX 11.4
set -euo pipefail
sudo cat << HEREDOC > /Library/LaunchDaemons/limit.maxfiles.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">


Use Volta for cross-platform Node.js version management.

curl | bash
volta install node@14
volta setup
# NOTE: Reload Terminal or run profile/*rc script.
justsml / config-overrides.js
Created Mar 15, 2021
Reference for 'Rewiring' Create-React-Apps without their rude defaults.
View config-overrides.js
// Follow setup instructions
// Example config:
const path = require('path');
const { alias, configPaths } = require('react-app-rewire-alias');
const addRewireScssLoader = require('react-app-rewire-scss-loaders');
const rewireWebpackBundleAnalyzer = require('react-app-rewire-webpack-bundle-analyzer');
module.exports = function override(config, env) {
// Fucking CRApps feel entitled to overwrite tsconfig.json...
View bgschiller-example.js
"use strict";
const fs = require("fs");
const fsPromises = fs.promises;
const { spawnSync } = require("child_process");
const workflows = "test";
const out = "test";
// See docs:
const FP = require('functional-promises');

Speaker Rider

by Tatiana Mac

Before I'll agree to a speaking event, I try to do as much research I can around the event to ensure it aligns with my ethos. I want to share this in case it's helpful to any other speakers.

👐 Speaking comes with immense privilege. I am grateful to all the conference organisers who have brilliantly hosted me. I would love to continue to exercise this privilege to speak at conferences, and use this privilege to make the landscape more accessible and beneficial to tech's most marginalised and suppressed communities.

😫 I wish I didn't have to, but this is long because I provide a lot of explanations for those of you who never had to consider these things. And I will be honest, most thoughtful conferences I've attended check most of these boxes intrinsically, particularly when conference runners are experienced speakers. They get it.

1️⃣ All of these are based on my own ethos. I don't wish to or attempt to speak on behalf of all conference speake

View unicode-helpers.js
const combiningMarks = /([\0-\u02FF\u0370-\u1AAF\u1B00-\u1DBF\u1E00-\u20CF\u2100-\uD7FF\uE000-\uFE1F\uFE30-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])([\u0300-\u036F\u1AB0-\u1AFF\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]+)/gmi;
Remove unicode combining symbols.
Will convert the following string: Z͑ͫ̓ͪ̂ͫ̽͏̴̙̤̞͉͚̯̞̠͍A̴̵̜̰͔ͫ͗͢L̠ͨͧͩ͘G̴̻͈͍͔̹̑͗̎̅͛́Ǫ̵̹̻̝̳͂̌̌͘!͖̬̰̙̗̿̋ͥͥ̂ͣ̐́́͜͞
Into: ZALGǪ!
export const removeCombiningMarks = (input) => {
return input.replace(combiningMarks, (substr, ...args) => {
justsml / cloudflare-workers-signup-endpoint.js
Created Feb 23, 2020
Uses Cloudflare KV data store & Google ReCaptcha!
View cloudflare-workers-signup-endpoint.js
// Note to self: Currently running here:
## Utility Functions
const isEmailShaped = email => email && email.length > 5 && email.indexOf('@') > -1
const sendJSON = (data, status = 200) => new Response(
typeof data !== 'string' ? JSON.stringify(data) : data, {
headers: { 'Content-Type': 'application/json; charset=UTF-8' },
justsml /
Last active Feb 1, 2020
PSA: Modern project configuration files needlessly pollute root folders by default!
justsml /
Created Jan 29, 2020
Export all collections in a mongo database to JSON files!
set -euo pipefail