Skip to content

Instantly share code, notes, and snippets.

if ! set -q prompt_symbol
set -g prompt_symbol "→"
end
if ! set -q prompt_symbol_color
set -g prompt_symbol_color normal
end
function fish_prompt
set -l last_status $status
function killport --argument port
set pids (lsof -t -i tcp:$port)
if test -n "$pids"
kill $pids
echo "killed process $pids"
end
end
# with https://github.com/acomagu/fish-async-prompt
function fish_prompt_loading_indicator -a last_prompt
set uncolored_last_prompt (echo -n $last_prompt | string replace -ra '\e\[[^m]*m' '' | string collect)
echo -n (set_color brblack)"$uncolored_last_prompt"(set_color normal)
end
@furudean
furudean / userChrome.css
Last active July 8, 2024 20:55
my firefox userChrome.css
/* hides the native tabs */
#TabsToolbar {
visibility: collapse;
}
@furudean
furudean / rot.js
Last active February 1, 2022 12:28
ROT13 JavaScript implementation
function mod(a, n) {
return ((a % n) + n) % n
}
export function rot(str, shift) {
const a = "a".charCodeAt(0)
const z = "z".charCodeAt(0)
const A = "A".charCodeAt(0)
const Z = "Z".charCodeAt(0)
function get(obj, path, defaultValue) {
return path.reduce((o, key) => o[key] ?? defaultValue, obj);
}
function packmanga
for file in */
set base (basename $file)
echo "Pack '$base'"
cd $base
zip -q "../$base.cbz" *
cd ..
end
end
@furudean
furudean / svelte-persistent-store.js
Last active May 21, 2022 01:25
Store that saves and loads data from `localStorage` or `sessionStorage`. Svelte Kit compatible!
import { writable } from "svelte/store"
/**
* @template {unknown} T
*
* @typedef {Object} Options
*
* @property {T} start_value
* Initial value of the store, if there is nothing in `Storage`.
*
@furudean
furudean / index.ts
Last active March 13, 2020 13:29
Clone a table with a small data sets from DynamoDB
import { DocumentClient, } from "aws-sdk/clients/dynamodb";
import { chunk } from "lodash";
const dynamoDb = new DocumentClient();
const sourceTable = '';
const destinationTable = '';
const chunkSize = 25;
const sleepTime = 1000;
@furudean
furudean / .gitconfig
Last active March 16, 2024 05:49
Git config
[user]
email = [email protected]
name = Merilynn Bandy
signingkey = 3D463BCC4E2C6CE1
[commit]
gpgsign = true
[pull]
rebase = true
[rebase]
autoStash = true