Skip to content

Instantly share code, notes, and snippets.

@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active March 19, 2025 02:29
Conventional Commits Cheatsheet

Conventional Commit Messages starline

See how a minor change to your commit message style can make a difference.

Tip

Take a look at git-conventional-commits , a CLI util to ensure these conventions, determine version and generate changelogs

Commit Message Formats

Default

@zubaer-ahammed
zubaer-ahammed / Reset MySQL Root Password in Mac OS.md
Last active March 19, 2025 02:28
Reset MySQL Root Password in Mac OS

Reset mysql root password in Mac OS:

First Stop MySQL:

  1. Go to: 'System Preferences' >> 'MySQL' and stop MySQL

OR,

  1. sudo /usr/local/mysql/support-files/mysql.server start
  2. sudo /usr/local/mysql/support-files/mysql.server stop
@str4d
str4d / DemangleRust.py
Last active March 19, 2025 02:27
Ghidra script for demangling Rust symbols
# Attempts to demangle all mangled symbols in the current program using the Rust
# mangling schemes, and replace the default symbol and function signature
# (if applicable) with the demangled symbol.
#
# License: MIT OR Apache-2.0
#@author Jack Grigg <[email protected]>
#@category Symbol
import string
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active March 19, 2025 02:24
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@VelichkoAlexander
VelichkoAlexander / edit.tsx
Last active March 19, 2025 02:21
How to work with preview state for Gutenberg
import {useSelect, useDispatch} from '@wordpress/data'
//Access the current mode value
const { deviceType } = useSelect( select => {
const { __experimentalGetPreviewDeviceType } = select( 'core/edit-post' );
return {
deviceType: __experimentalGetPreviewDeviceType(),
}
}, [] );
@floxay
floxay / optimize_simple_glb.py
Last active March 19, 2025 02:20
Python 3 script to optimize textures in simple(!) glTF 2.0 GLB files.
import json
from io import BytesIO
from pathlib import Path
from struct import Struct
from typing import TYPE_CHECKING
from PIL import Image
from PIL.PngImagePlugin import PngImageFile
if TYPE_CHECKING:
@jwbee
jwbee / jq.md
Last active March 19, 2025 02:20
Make Ubuntu packages 90% faster by rebuilding them

Make Ubuntu packages 90% faster by rebuilding them

TL;DR

You can take the same source code package that Ubuntu uses to build jq, compile it again, and realize 90% better performance.

Setting

I use jq for processing GeoJSON files and other open data offered in JSON format. Today I am working with a 500MB GeoJSON file that contains the Alameda County Assessor's parcel map. I want to run a query that prints the city for every parcel worth more than a threshold amount. The program is

@chrisroos
chrisroos / gpg-import-and-export-instructions.md
Created September 9, 2011 10:49
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/

or, instead of backing up trustdb...

@encse
encse / iq_demod.py
Last active March 19, 2025 02:14
iq demodulation
import matplotlib.pyplot as plt
import numpy as np
from scipy import signal
# Source: https://github.com/guillaume-chevalier/filtering-stft-and-laplace-transform
def butter_lowpass_filter(data, cutoff_freq, sampling_freq, order=4):
nyq_freq = 0.5 * sampling_freq
normal_cutoff = float(cutoff_freq) / nyq_freq
b, a = signal.butter(order, normal_cutoff, btype='lowpass')
@eungju
eungju / BulkheadClientInterceptor.kt
Last active March 19, 2025 02:13
resilience4j-grpc
import io.github.resilience4j.bulkhead.Bulkhead
import io.github.resilience4j.bulkhead.utils.BulkheadUtils
import io.grpc.CallOptions
import io.grpc.Channel
import io.grpc.ClientCall
import io.grpc.ClientInterceptor
import io.grpc.ClientInterceptors
import io.grpc.ForwardingClientCallListener
import io.grpc.Metadata
import io.grpc.MethodDescriptor