Skip to content

Instantly share code, notes, and snippets.

View iquabius's full-sized avatar

Josias Iquabius iquabius

View GitHub Profile
@mieky
mieky / lockwatch.bash
Last active October 20, 2025 15:26
Zero-dependency watcher for macOS session lock/unlock events
#!/bin/bash
#
# Watches for macOS session lock/unlock events and runs ~/.lock or ~/.unlock on change.
#
# Usage:
# - chmod u+x /path/to/lockwatch.bash
# - to test, run /path/to/lockwatch.bash
# - to launch in the background, set up a launchd agent with lockwatch.plist.
script_lock=~/.lock
@nandorojo
nandorojo / README.md
Last active February 17, 2025 08:31
Expo + Next.js Query Param state

Expo + Next.js Query Params State 🦦

A typical use-case on web for maintaining React State is your URL's query parameters. It lets users refresh pages & share links without losing their spot in your app.

URL-as-state is especially useful on Next.js, since next/router will re-render your page with shallow navigation.

This gist lets you leverage the power of URL-as-state, while providing a fallback to React state for usage in React Native apps.

It's essentially a replacement for useState.

@sm-Fifteen
sm-Fifteen / whats_a_yubikey.md
Last active March 29, 2026 22:12
"What the heck is a Yubikey and why did I buy one?": A user guide

"What the heck is a Yubikey and why did I buy one?": A user guide

(EDIT: Besides Reddit, I've also put this up on Github Gist)

So while looking for information on security keys before getting one myself, I got very confused reading about all the different modes and advertised features of Yubikeys and other similar dongles. The official documentation tends to be surprisingly convoluted at times, weirdly organized and oddly shy about a few of the limitations of these keys (which I'm making a point of putting front and center). Now that I have one, I decided to write down everything I figured out in order to help myself (and hopefully some other people reading this) make sense of all this.

Since I'm partly writing these notes for myself, there might be some back and forth between "exp

@martinheld
martinheld / GraphQL introspection query via curl.md
Last active August 15, 2025 00:10
GraphQL introspection query via curl

GraphQL introspection query via curl

cat introspection_query.json

{ 
  "query": "query IntrospectionQuery {
      __schema {
        queryType { name }
        mutationType { name }
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active May 12, 2026 16:44
Conventional Commits Cheatsheet
@ankjevel
ankjevel / clear-cache.sh
Last active September 8, 2025 18:34
clear npm cache (when using nvm); run with `nvm list | clear-cache`
#!/usr/bin/env bash
function clear-cache {
versions=()
while read -r line; do
clean="$(echo ${line} | sed "s,$(printf '\033')\\[[0-9;]*[a-zA-Z],,g")"
valid=$(echo "${clean}" | grep '^[^a-zA-Z]' | grep -v 'system' | sed 's/->//' | sed 's/\s.*v//')
if [[ ! -z $valid ]]; then
versions+=(${valid})
@ryansimms
ryansimms / circleci-2.0-eb-deployment.md
Last active February 22, 2024 04:55
Deploying to Elastic Beanstalk via CircleCi 2.0

Deploying to Elastic Beanstalk via CircleCi 2.0

I got to here after spending hours trying to deploy to an Elastic Beanstalk instance via CircleCi 2.0 so I thought I'd write up what worked for me to hopefully help others. Shout out to RobertoSchneiders who's steps for getting it to work with CircleCi 1.0 were my starting point.

For the record, I'm not the most server-savvy of developers so there may be a better way of doing this.

Setup a user on AWS IAM to use for deployments

@nfort
nfort / getIPLocalServer
Last active April 4, 2024 18:28
Node.js get local ip server
var os = require('os');
var ip = '0.0.0.0';
var ips = os.networkInterfaces();
Object
.keys(ips)
.forEach(function(_interface) {
ips[_interface]
.forEach(function(_dev) {
if (_dev.family === 'IPv4' && !_dev.internal) ip = _dev.address
})
@cjsteel
cjsteel / Staging&ProductionUsingGit.md
Last active March 10, 2025 12:20 — forked from mylesthedev/Staging&ProductionUsingGit
Staging and Production Server using Git.

If you are running a large project such as a website or ansible server you will want to test new features before pushing them into production then something like the following setup may work for you.

For this example imagine your url is mysite.ca and you want a development/staging site on a subdomain which is dev.mysite.ca

Setup

For websites

Create the website's domain and subdomain

@gaearon
gaearon / slim-redux.js
Last active March 26, 2026 21:25
Redux without the sanity checks in a single file. Don't use this, use normal Redux. :-)
function mapValues(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
result[key] = fn(obj[key], key);
return result;
}, {});
}
function pick(obj, fn) {
return Object.keys(obj).reduce((result, key) => {
if (fn(obj[key])) {