Skip to content

Instantly share code, notes, and snippets.

View johnnymillergh's full-sized avatar
💪
Coding & Building

Johnny Miller johnnymillergh

💪
Coding & Building
View GitHub Profile
@marcojahn
marcojahn / conventional-commit-regex.md
Last active February 10, 2025 18:43
Conventional Commit Regex

the following regex will validate all examples provided here: https://www.conventionalcommits.org/en/v1.0.0/

  ^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([\w\-\.]+\))?(!)?: ([\w ])+([\s\S]*)

a grep/posix compatible variant

  ^(build|chore|ci|docs|feat|fix|perf|refactor|revert|style|test){1}(\([[:alnum:]._-]+\))?(!)?: ([[:alnum:]])+([[:space:][:print:]]*)
@fworks
fworks / install-zsh-windows-git-bash.md
Last active March 18, 2025 14:39
Zsh / Oh-my-zsh on Windows Git Bash
@Happytreat
Happytreat / gist:dd48116ba8698a41315494a62d3149c6
Last active August 11, 2021 16:14
Weekly development breakdown
We couldn’t find that file to show.
#!/usr/bin/python
#
# Singapore\'s Identification Number Generation Tool.
# Copyright (C) 2017
#
# This program can be redistributed and/or modified under the terms of the
# GNU General Public License, either version 3 of the License, or (at your
# option) any later version.
#
@joao-timescale
joao-timescale / blog.py
Last active July 7, 2023 02:36
Blog example showing how to integrate pydantic with the peewee ORM
import pydantic
import peewee
from playhouse.db_url import connect
from typing import List
import logging
logger = logging.getLogger('peewee')
logger.addHandler(logging.StreamHandler())
logger.setLevel(logging.DEBUG)
@vbsteven
vbsteven / Validators.kt
Created April 8, 2019 16:27
Custom Spring annotation and validator in Kotlin
package io.license.core.validation
import javax.validation.Constraint
import javax.validation.ConstraintValidator
import javax.validation.ConstraintValidatorContext
import javax.validation.Payload
import kotlin.reflect.KClass
@Target(AnnotationTarget.FIELD)
@maxme
maxme / raspberry-power-supply-check.sh
Last active August 5, 2023 06:45
Check your Raspberry pi power supply and USB cable
#!/bin/bash
# Before running this script, make sure you have sysbench installed:
# sudo apt-get install sysbench
#
# This script helps you check if your Raspberry pi is correctly powered.
# You can read more about Raspberry pi powering issues here: https://ownyourbits.com/2019/02/02/whats-wrong-with-the-raspberry-pi/
# If you're pi is correctly powered (stable power supply and quality cable), after running the script, you should get something like:
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active April 8, 2025 13:21
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

@mbrownnycnyc
mbrownnycnyc / disable_android_notification_info.txt
Last active April 13, 2023 13:06
Disabling heads up notifications on android per app. Requires root access. This will simply hide: "sim card is not from verizon wireless"
#you can do the below if you have root.
# if you don't have root, you can uninstall the Samsung Setup Wizard. Not sure if this is at all valuable, as you can configure APNs manually worst case. Best case, it has no affect on OTA activations (which I truly don't think it does):
# adb shell
# pm uninstall -k --user 0 com.sec.android.app.setupwizard
# cycle airplane mode and you'll see you don't get the notification.
"sim card is not from verizon wireless"
@hectorguo
hectorguo / throttle.js
Created November 14, 2018 06:36
throttle without using setTimeout (only last run)
function throttle(fn, rate) {
let oldTime;
let timer;
function helper(...args) {
const now = Date.now();
// first time: need to call fn once
if(!oldTime || now - oldTime > rate) {