This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ./test.sh | |
node version: v22.4.0 | |
python version: Python 3.12.2 | |
go version: go version go1.22.6 darwin/arm64 | |
rg version: ripgrep 14.1.0 | |
features:-simd-accel,+pcre2 | |
simd(compile):+NEON | |
simd(runtime):+NEON |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Save test.mjs in the root of the repository, and run it as `node test.mjs` | |
import {fromMarkdown} from 'mdast-util-from-markdown' | |
import { | |
gfmAutolinkLiteralFromMarkdown, | |
gfmAutolinkLiteralToMarkdown | |
} from './lib/index.js' | |
const hundredA = 'a'.repeat(100) | |
const fileWithBreaks = `${hundredA}\n`.repeat(800) | |
const fileWithoutBreaks = `${hundredA}`.repeat(800) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish changes to the web | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- main | |
jobs: | |
publish: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from collections import UserList | |
from functools import partial | |
from operator import add | |
# a class that allows a subclass to declare a function to use to handle all protocols | |
class CustomApplyList(UserList): | |
def __init__(self, f, args): | |
super().__init__(args) | |
self.f = f |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -euo pipefail | |
function usage { | |
cat <<"EOF" | |
gif.sh [-rv] image.gif | |
display image.gif on your tidbyt. Assumes you have `pixlet` installed, and that | |
the device you want to display it on is the first in the list of `pixlet | |
devices` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# download_all_emoji.py: A script to query the slack API for all emojis on a | |
# given instance, and then download them into an "emojis" folder | |
# | |
# USAGE | |
# | |
# first, set a `SLACK_TOKEN` environment variable to a token that has | |
# `emoji:read` permission. Then, run this script with | |
# `python download_all_emoji.py`. | |
# | |
# it does not run in parallel, so it may take a while. Are you really |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# Installation (OS X): | |
# | |
# - save this file as "gpt" somewhere in your path | |
# - get an openai api key at: https://platform.openai.com/account/api-keys | |
# - save the openai api key to your keychain with: | |
# security add-generic-password -s 'openai' -a '<account name>' -w '<api key>' | |
# - If you don't already have `jq`, install it with `brew install jq` or whatever | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# many settings from https://raw.githubusercontent.com/mathiasbynens/dotfiles/master/.macos | |
# many settings from https://raw.githubusercontent.com/thoughtbot/laptop/master/mac | |
# instructions on finding the default you've changed: https://pawelgrzybek.com/change-macos-user-preferences-via-command-line/ | |
# previous install notes at: | |
# https://gist.github.com/llimllib/ee591266e05bd880629a4e7511a61bb3 | |
# https://gist.github.com/llimllib/e864a92da94ceb1ef0da2e06fd1f8d70 | |
# https://gist.github.com/llimllib/3fc4fefcfc0152dad8c58201246d8802 | |
# | |
# this script's URL is: https://gist.github.com/llimllib/c4dd0a98a426022b0365d4c0a9090460 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# many settings from https://raw.githubusercontent.com/mathiasbynens/dotfiles/master/.macos | |
# many settings from https://raw.githubusercontent.com/thoughtbot/laptop/master/mac | |
# instructions on finding the default you've changed: https://pawelgrzybek.com/change-macos-user-preferences-via-command-line/ | |
# previous install notes at: | |
# https://gist.github.com/llimllib/ee591266e05bd880629a4e7511a61bb3 | |
# https://gist.github.com/llimllib/e864a92da94ceb1ef0da2e06fd1f8d70 | |
# https://gist.github.com/llimllib/3fc4fefcfc0152dad8c58201246d8802 | |
fancy_echo() { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <stdarg.h> | |
// https://github.com/nothings/stb | |
#define STB_DS_IMPLEMENTATION | |
#include "stb_ds.h" | |
// compile with: gcc -Wall -I . dabeaz_stb.c -o a && ./a | |
typedef struct datum datum; |