Skip to content

Instantly share code, notes, and snippets.


reaper barelyhuman

View GitHub Profile
barelyhuman / *
Created Nov 4, 2022
Single script for doc generation
View *

Doc Generator

Single file doc generator for javascript projects where no other programming language is available.

This was a learning project for working with reactive streams for CLI apps and something I needed at work to generate wiki sites from an existing docs folder.

There's an attached Dockerfile if you wish to deploy it on a container, the script is for flat docs folders with all docs on the first level of the folder a.k.a nested documents aren't supported right now.

barelyhuman / sizesnap.js
Created Oct 30, 2022
Pure ESM version of sizesnap cli
View sizesnap.js
import glob from 'tiny-glob'
import _xs from 'xstream'
import zlib from 'zlib'
import {promises as fs} from 'node:fs'
import _concat from 'xstream/extra/concat.js'
const xs = _xs.default
const concat = _concat.default
// contained exec of the streams
View *

Notion Vuepress Sync

The script simply syncs from a notion database and renders the content of the pages created inside the table based on the following structure.

title type published
page name FAQ [x]
another page Category [x]
barelyhuman / .vimrc
Last active Jan 31, 2023
self sufficient single Vim file for a minimal, portable vim
View .vimrc
" plugs
let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim'
if empty(glob(data_dir . '/autoload/plug.vim'))
silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs'
autocmd VimEnter * PlugInstall --sync | source $MYVIMRC
call plug#begin()
Plug 'junegunn/fzf', { 'do': { -> fzf#install() } }
barelyhuman /
Created Aug 12, 2022
hide arrows for an icon them in vscode
#!/usr/bin/env bash
cd $ext_root
extension_dir=$(ls . | grep miguelsolorio.symbols)
cd $extension_dir
jq -n -f ./src/symbol-icon-theme.json | cat > .tmp
npx json -I -e "this.hidesExplorerArrows=true;" -f .tmp
mv ./src/symbol-icon-theme.json ./src/symbol-icon-theme.json.bak
mv .tmp ./src/symbol-icon-theme.json
View gray-palette.json
"name": "gray-100",
"color": "rgba(25, 24, 21, 1)"
"name": "gray-75",
"color": "rgba(113, 113, 113, 1)"
barelyhuman / boring.itermcolors
Created Jul 25, 2022
iterm colors based on Plastic Theme + RSMS Gray colors
View boring.itermcolors
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "">
<plist version="1.0">
<key>Ansi 0 Color</key>
<key>Alpha Component</key>
<key>Blue Component</key>
View default.nix
with (import <nixpkgs> {});
with (import /home/maarten/code/nixos/yarn2nix { inherit pkgs; });
gems = bundlerEnv {
name = "project-name";
inherit ruby;
gemdir = ./.;
in stdenv.mkDerivation {
name = "project-name";
barelyhuman / availability_function.sql
Created Jun 2, 2022
get open time slots for bookings where bookings can be overlapped if there's more than one slot for booking (postgres)
View availability_function.sql
-- table structure for reference
-- `areas`
-- column type nullable
-- ------------------------------
-- id int4 NO
-- name varchar(11) YES
-- slots int4 NO
-- `avail`
-- column type nullable
barelyhuman / script.js
Created Apr 16, 2022
wonka ( , custom operators code
View script.js
import { fromArray, fromValue, pipe, toPromise } from "wonka";
function talkbackPlaceholder(a) {}
const customTake = (max) => (source) => (sink) => {
let taken = [];
let talkback = talkbackPlaceholder;
let ended = false;
return source((signal) => {
if (typeof signal === "number") {