Skip to content

Instantly share code, notes, and snippets.

View psimk's full-sized avatar
👨‍🎨
Building in Public

Paul psimk

👨‍🎨
Building in Public
View GitHub Profile
@psimk
psimk / unsplash_sway_wallpapers.sh
Created May 31, 2022 20:50
downloads random wallpapers from unsplash.com and sets them to 3 monitors for the sway wm using swaybg
#!/bin/bash
tags="nature,background"
first_resolution="1920x1200"
second_resolution="2560x1440"
third_resolution="3840x2160"
wallpaper_path="$HOME/wallpapers"
set_bg () {
kill $(pgrep swaybg)
import {
decode,
encode,
} from "https://deno.land/std@0.158.0/encoding/base64.ts";
export function isString(value: unknown): value is string {
return typeof value === "string";
}
class SingleStreamSource<T> implements UnderlyingSource<T> {
const NOOP = () => {}
type PageVisiblityChangeListener = (isHidden: boolean) => void
export class PageVisiblity {
private static BROWSER_SPECIFIC = [
{ hiddenField: 'hidden', changeEvent: 'visibilitychange' },
{ hiddenField: 'msHidden', changeEvent: 'msvisibilitychange' },
{ hiddenField: 'webkitHidden', changeEvent: 'webkitvisibilitychange' },
] as const
nvim -q <(npx eslint -- . --ext .js,.ts,.tsx --cache -f unix)
@psimk
psimk / rrspec.sh
Created March 20, 2023 10:57
runs `spring rspec` on locally discovered `spec.rb` files through `fzf` & `fd`
#!/bin/sh
files=`fd -g "*spec.rb" -X ls -rt`
if [ -z "$files" ]; then
exit 1
fi
selected=`echo $files | tr " " "\n" | fzf --tac --no-sort`
@psimk
psimk / jjest.sh
Last active May 24, 2023 10:22
runs `npx jest` on locally discovered `test.ts` files via `fzf` & `fd`
#!/bin/sh
selected=`fd -e 'test.ts' -e 'test.tsx' -X ls -rt | tr " " "\n" | fzf --exact --tac --no-sort`
[ -z "$selected" ] && exit 0
cd `dirname $selected`
npx jest $1 $selected
@psimk
psimk / zellij-launcher.sh
Last active June 27, 2023 09:30
zellij-launcher
#!/usr/bin/env bash
active_marker="◉ "
inactive_marker="◯ "
green="\x1B[38;5;151m\x1B[1D"
red="\x1B[38;5;217m\x1B[1D"
configured_sessions=(
"zellij"