Skip to content

Instantly share code, notes, and snippets.

View ayoayco's full-sized avatar

Ayo Ayco ayoayco

View GitHub Profile
@ayoayco
ayoayco / following_accounts.csv
Created January 3, 2025 18:55
some tech bsk accoungs bridged to the fedi by fed.brid.gy
Account address Show boosts Notify on new posts Languages
[email protected] true false
[email protected] true false
[email protected] true false
[email protected] true false
[email protected] true false
[email protected] true false
[email protected] true false
[email protected] true false
[email protected] true false
@ayoayco
ayoayco / exec-husky.sh
Created December 27, 2024 20:27
allow executing husky precommit
chmod ug+x .husky/*
@ayoayco
ayoayco / delete-vim-backup-files
Created September 3, 2024 18:41
recursively delete all vim backup files
find -name "*~" -print -delete
@ayoayco
ayoayco / gh-alerts.md
Created December 14, 2023 12:16
GH Alerts in MD files

Note

Highlights information that users should take into account, even when skimming.

Tip

Optional information to help a user be more successful.

Important

Crucial information necessary for users to succeed.

[!WARNING]

/**
* A typeguard to check if a value is valid entry in an Enum.
* If it passes, the value will be typed as the enum
* @param value value to check
* @param enumType Enum to check against
* @returns boolean and assigns type to value
* @example
* ```ts
* enum TestEnum {
* Value1 = 'Value1',
@ayoayco
ayoayco / freeze-object.js
Last active August 5, 2023 04:45
Type-checking vanilla JS with JSdoc and the TS typechecker
// @ts-check
/**
* @typedef {string | number | boolean | null | undefined} Primitive
*/
/**
* @template { Primitive } T
* @template {T | Record.<string,T>} R
* @param {R} v
@ayoayco
ayoayco / install-vundle.txt
Created July 15, 2023 16:29
install vundle
git clone https://github.com/VundleVim/Vundle.vim.git ~/.vim/bundle/Vundle.vim
#!/bin/bash
while IFS="," read -r user boosts notify lang
do
echo "refreshing $user..."
RAILS_ENV=production /home/mastodon/live/bin/tootctl accounts refresh $user
done < <(tail -n +2 following.csv)
#!/bin/bash
# Delete all cached headers
rm -rf /home/mastodon/live/public/system/cache/accounts/headers/*
# Prune remote accounts that never interacted with a local user
RAILS_ENV=production /home/mastodon/live/bin/tootctl accounts prune;
# Remove remote statuses that local users never interacted with older than n days
RAILS_ENV=production /home/mastodon/live/bin/tootctl statuses remove --days 7;
@ayoayco
ayoayco / Counter.tsx
Created April 19, 2023 06:40
Counter component
import { useState } from 'react'
const Counter = () => {
const [state, setState] = useState(0)
return (
<>
<h1>Counter</h1>
<p>{state}</p>
<button onClick={() => setState(state + 1)}>+</button>