Skip to content

Instantly share code, notes, and snippets.

View andostronaut's full-sized avatar
🛰️
on orbit

Ando Ramanamihanta andostronaut

🛰️
on orbit
View GitHub Profile
@guilherme
guilherme / gist:9604324
Last active October 10, 2024 18:27
Git pre-commit hook that detects if the developer forget to remove all the javascript console.log before commit.
#!/bin/sh
# Redirect output to stderr.
exec 1>&2
# enable user input
exec < /dev/tty
consoleregexp='console.log'
# CHECK
if test $(git diff --cached | grep $consoleregexp | wc -l) != 0
then
@lukas-h
lukas-h / license-badges.md
Last active October 20, 2025 22:24
Markdown License Badges for your Project

Markdown License badges

Collection of License badges for your Project's README file.
This list includes the most common open source and open data licenses.
Easily copy and paste the code under the badges into your Markdown files.

Notes

  • The badges do not fully replace the license informations for your projects, they are only emblems for the README, that the user can see the License at first glance.

Translations: (No guarantee that the translations are up-to-date)

@mattbeiswenger
mattbeiswenger / README.md
Last active September 2, 2023 12:55
How to Close an Open Port in Unix

How to Close an Open Port in Unix

  1. Type the following command to list all ports listening for a connection lsof -i -P -n | grep LISTEN

  2. Find the process you would like to terminate

redis-server 1913 mbeiswenger 6u IPv4 0x395e893ba0f300d5 0t0 TCP *:6379 (LISTEN)

  • sshd is the name of the application
git_current_branch () {
local ref
ref=$(command git symbolic-ref --quiet HEAD 2> /dev/null)
local ret=$?
if [[ $ret != 0 ]]
then
[[ $ret == 128 ]] && return
ref=$(command git rev-parse --short HEAD 2> /dev/null) || return
fi
echo ${ref#refs/heads/}
@davidteren
davidteren / nerd_fonts.md
Last active October 27, 2025 21:58
Install Nerd Fonts via Homebrew [updated & fixed]
@deepanchal
deepanchal / starship.toml
Last active November 2, 2024 19:22
Starship config
# Get editor completions based on the config schema
"$schema" = 'https://starship.rs/config-schema.json'
format = """
$username\
$hostname\
$localip\
$shlvl\
$singularity\
$kubernetes\
@andostronaut
andostronaut / app.tsx
Last active July 27, 2023 16:10
Using DeepReadonly, we cannot mutate anything in the entire tree, preventing a whole range of bugs that could occur.
export function EditEvent() {
const [event, setEvent] = useState<DeepReadonly<Event>>()
// ...
// ❌
event.attendees.push('foo') // Error
// ✅
setEvent({
...event,
@andostronaut
andostronaut / auto-assign.yml
Created July 27, 2023 16:10
GitHub Workflow : Auto Assign
name: Auto Assign
on:
issues:
types: [opened]
pull_request:
types: [opened]
jobs:
run:
runs-on: ubuntu-latest
permissions:
@jcarroll
jcarroll / README.md
Last active March 24, 2025 13:10 — forked from renestalder/README.md
Unfollow all on Facebook

Facebook: Unlike All Pages from Activity Log

  1. Facebook Settings & Privacy

  2. Activity Log

  3. Connections

  4. Pages, page likes and interests

  5. Replace the following line with today's class (see screenshot)

    [class="x6s0dn4 x78zum5 x1q0g3np x1iyjqo2 x1qughib xeuugli"]

  6. Run the script in your browser console

@khattaksd
khattaksd / seed.sql
Created September 22, 2023 00:19
Supabase Seed Users for local development & testing
-- supabase/seed.sql
--
-- create test users
INSERT INTO
auth.users (
instance_id,
id,
aud,
role,
email,