Skip to content

Instantly share code, notes, and snippets.

View olets's full-sized avatar
:shipit:

Henry Bley-Vroman olets

:shipit:
View GitHub Profile
function numsFromNumsAndRanges(numsAndRanges) {
const nums = new Set();
const numsAtStartOfRanges = new Set();
const numsAtEndOfRanges = new Set();
if (!numsAndRanges.length > 0) {
return { nums, numsAtStartOfRanges, numsAtEndOfRanges };
}
for (const numOrRange of numsAndRanges.split(',')) {
@olets
olets / A Tailwind CSS aspect-ratio Replacement Supporting Safari 14.md
Last active October 11, 2023 19:25
A Tailwind CSS aspect-ratio Replacement Supporting Safari 14
@olets
olets / input.scss
Created April 11, 2022 21:51
Generated by SassMeister.com.
@mixin focus() {
&:focus,
&:hover {
@content;
}
}
$btn-saturate-default: 25%;
$btn-lighten-default: 4%;
$btn-darken-default: 5%; // see also ecomm/molecules/button.scss
@olets
olets / links-elements-of-interest.js
Created October 21, 2021 23:18
find on a page all links with a pathname you care about
@olets
olets / README.md
Created September 24, 2021 07:06
Twig text transform (case) macros

Twig text transform (case) macros

Macros for

  • camelCase ( camel(string))
  • PascaleCase (pascale(string))
  • snake_case (snake(string))
  • SCREAMING_SNAKE_CASE (screamingsnake(string))
// ==UserScript==
// @name GitHub Ignore Whitespace
// @namespace https://olets.dev/
// @version 1.1
// @description Add URL parameter to ignore whitespace in GitHub pull request reviews
// @author Nimai C. Malle, forked by Henry Bley-Vroman
// @match https://github.com/*/*/pull/*
// @grant none
// @downloadURL https://gist.githubusercontent.com/olets/5083dad8870a4bdb4bf1cee8f38bc14b/raw/github_ignore_whitespace.js?v=1.1
// ==/UserScript==
@olets
olets / install-netbeans-on-macos-with-homebrew.md
Created July 7, 2021 23:10
Install Netbeans on macOS with Homebrew

Netbeans requires Java but the Netbeans Homebrew formula does not include Java as a dependency so it must be installed manually first:

brew install java

Per the Netbeans formula caveats,

For the system Java wrappers to find this JDK, symlink it with

@olets
olets / form-redirect-without-hash.md
Created June 25, 2021 23:54
Redirect form submission without hash

When redirecting a form with a redirect input, for example

<input type="hidden" name="redirect" value="<url>">

the browser may preserve the window hash after the redirect. For example, submitting

@olets
olets / appendFormDataToUrl.js
Created May 26, 2021 13:15
Append form data to a URL
/**
* Append form data to URL
* Henry Bley-Vroman, 2021
*
* Takes a URL and a form, returns a URL
* Use case: handling form submission with JS
*
* `url = (form.action, form)` and then use `url`
* `url = (url, form)` and then use `url`
*
@olets
olets / zsh-plugin-manager-plugin-installation-procedures.md
Last active March 26, 2024 07:04
zsh plugin manager cross-reference

Instructions for installing zsh plugins, for a variety of plugin managers

  • antibody: Add <owner>/<repo> to your plugins file. If you use static loading update the sh.

  • Antigen: Add antigen bundle <owner>/<repo> to your .zshrc.

  • Oh-My-Zsh:

    • Clone to OMZ's plugins' directory: