Skip to content

Instantly share code, notes, and snippets.

View kevinfiol's full-sized avatar
🌔
man on the moon

kevinfiol

🌔
man on the moon
View GitHub Profile
@kevinfiol
kevinfiol / merge.js
Created December 20, 2022 04:13
small immutable object merge
let NIL = void 0,
isObj = x => x && Object.getPrototypeOf(x) === Object.prototype;
function merge(obj, patch) {
obj = Array.isArray(obj) ? [ ...obj ] : isObj(obj) ? { ...obj } : NIL;
if (!obj) throw Error('You can only copy objects or arrays.');
for (let k in patch) {
let v = patch[k];
if (typeof v === 'function') obj[k] = v(obj[k]);
import servbot from 'servbot';
import esbuild from 'esbuild';
import env from 'env-smart';
import { writeFile } from 'fs/promises';
import { resolve } from 'path';
// load .env file variables
env.load();
const DEV = process.argv.includes('-d');
@kevinfiol
kevinfiol / cache.js
Last active September 22, 2022 02:10
lru cache
function Cache(max, ttl) {
let items = {},
size = 0,
first = undefined,
last = undefined;
return $ = {
has(key) {
return key in items;
},
@kevinfiol
kevinfiol / youtube_feeds.user.js
Last active August 12, 2022 16:26
a crappy script to get RSS feeds from your channel subscriptions at https://www.youtube.com/feed/channels
// ==UserScript==
// @name get feeds
// @namespace Violentmonkey Scripts
// @match https://www.youtube.com/feed/channels
// @grant none
// @version 1.0
// @author -
// @description 8/9/2022, 11:24:20 PM
// ==/UserScript==
@kevinfiol
kevinfiol / .bashrc
Last active May 5, 2024 02:10
shell configs
if [ -f ~/me/.profile.sh ]; then
. ~/me/.profile.sh
fi
@kevinfiol
kevinfiol / Dockerfile
Last active June 30, 2022 16:54
dockerfile for a redbean app
FROM alpine:3.16
RUN apk update \
&& apk add --no-cache \
bash \
zip
RUN wget https://justine.lol/ape.elf -O /usr/bin/ape
RUN chmod +x /usr/bin/ape
@kevinfiol
kevinfiol / keybase.md
Created June 15, 2022 20:23
keybase.md

Keybase proof

I hereby claim:

  • I am kevinfiol on github.
  • I am kevinfiol (https://keybase.io/kevinfiol) on keybase.
  • I have a public key ASCDaMYsQFL_1qQj9Pqh-uDHpXm-UDuaJA1-Mu2bYpIOyAo

To claim this, I am signing this object:

@kevinfiol
kevinfiol / .gitconfig
Last active August 10, 2022 15:27
base git configs
[includeIf "gitdir/i:<path>"]
path = .gitconfig-kevinfiol
[alias]
lg = log --pretty=oneline --abbrev-commit
[pull]
rebase = false
[core]
# enable if on windows
# autocrlf = true
eol = lf
@kevinfiol
kevinfiol / Microsoft.PowerShell_profile.ps1
Last active June 3, 2022 01:50
alacritty conf (put in C:\Users\<username>\AppData\Roaming\alacritty) PS Profile in (C:\Users\<username>\Documents\WindowsPowerShell)
try { $null = gcm pshazz -ea stop; pshazz init } catch { }
Import-Module posh-git
# install with: Install-Module PSColor
Import-Module PSColor
# install oh-my-posh with: Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://ohmyposh.dev/install.ps1'))
# https://ohmyposh.dev/docs/installation/windows
oh-my-posh init pwsh --config C:\Users\kevin\apps\alacritty\pure-mod.omp.json | Invoke-Expression
$DefaultUser = $Env:UserName
/* http://colormind.io/ */
:root {
--main-bg: #1c1c1c;
}
.logo-div, p.footer {
display: none !important;
}
html, body {