Skip to content

Instantly share code, notes, and snippets.


Ian Langworth ☠ statico

View GitHub Profile
csandman / debounce-swr.js
Last active Jan 28, 2023
Debounce useSwr
View debounce-swr.js
// originally from:
import useSWR from 'swr';
import useDebounce from 'hooks/use-debounce';
const App = () => {
const [search, setSearch] = useState('');
const debouncedSearch = useDebounce(search, 1000);
const { data: res, isValidating } = useSWR(
() => debouncedSearch ? `/api/suggestion?value=${debouncedSearch}` : null,
statico /
Last active Jul 31, 2021
Ian's Personal Short Link Bookmark Service
nealey / slack-emoji-bulk-delete.js
Last active Jan 11, 2023
Bulk delete every custom emoji in Slack
View slack-emoji-bulk-delete.js
// I just found out that we have a bunch of NSFW emoji in our bulk-imported set of >4000 emoji.
// Rather than weed them out, I want to start with a blank slate. This code does that.
// Navigate to your "Custom Emoji" page, the one with all the delete buttons.
// Delete one of them and acknowledge that it's going away forever.
// Then open the JavaScript console and paste this in.
// At some point your JavaScript console will start spewing errors.
// Reload the Emoji page, delete one emoji by hand again, and paste this in again to resume.

Generating Authy passwords on other authenticators

There is an increasing count of applications which use Authy for two-factor authentication. However many users who aren't using Authy, have their own authenticator setup up already and do not wish to use two applications for generating passwords.

Since I use 1Password for all of my password storing/generating needs, I was looking for a solution to use Authy passwords on that. I couldn't find any completely working solutions, however I stumbled upon a gist by Brian Hartvigsen. His post had a neat code with it to generate QR codes for you to use on your favorite authenticator.

His method is to extract the secret keys using Authy's Google Chrome app via Developer Tools. If this was not possible, I guess people would be reverse engineering the Android app or something like that. But when I tried that code, nothing appeared on the screen. My guess is that Brian used the

algesten / tmux.conf
Created May 14, 2017
A tmux.conf with pbcopy
View tmux.conf
# propagate titles to the window
set -g set-titles on
# Minimalist window title "0:bash"
set -g set-titles-string "#I:#W"
# show colors
set -g default-terminal "screen-256color"
dogeared / 00_README
Last active Nov 24, 2020 — forked from lmarkus/README.MD
Extracting / Exporting custom emoji from Slack
View 00_README
This builds off the excellent work of @lmarkus.
The scripts below can be used in conjunction with the Slack Emoji Tools Google Chrome extension to export emojis from
one Slack team and import into another team.
Original work here:
judy2k / parse_dotenv.bash
Created Mar 22, 2017
Parse a .env (dotenv) file directly using BASH
View parse_dotenv.bash
# Pass the env-vars to MYCOMMAND
eval $(egrep -v '^#' .env | xargs) MYCOMMAND
# … or ...
# Export the vars in .env into your shell:
export $(egrep -v '^#' .env | xargs)
fuxingloh / app.js
Last active Oct 18, 2022
How to use express.js and passport.js with G Suite SAML Apps SSO
View app.js
const express = require('express')
const SamlStrategy = require('passport-saml').Strategy
const passport = require('passport')
const cookieSession = require('cookie-session')
const cookieParser = require('cookie-parser')
// Create express instance
const app = express()
View gist:4983670c508b2f6b181703df43438c37

top (the UNIX process inspector) cheat sheet

This is a list of the most helpful keyboard commands I use within top.

The basics

h shows help on interactive commands. Also see the top manual page

q to quit the program.

lmarkus / README.MD
Last active Jan 27, 2023
Extracting / Exporting custom emoji from Slack

Extracting Emoji From Slack!

Slack doesn't provide an easy way to extract custom emoji from a team. (Especially teams with thousands of custom emoji) This Gist walks you through a relatively simple approach to get your emoji out.

If you're an admin of your own team, you can get the list of emoji directly using this API: Once you have it, skip to Step 3

HOWEVER! This gist is intended for people who don't have admin access, nor access tokens for using that list.

Follow along...