Skip to content

Instantly share code, notes, and snippets.

View phwt's full-sized avatar
💤

Phuwathid Summaviwat phwt

💤
  • Earth, Solar System
  • 02:59 (UTC +07:00)
View GitHub Profile
@phwt
phwt / rename-local-remote.sh
Last active March 13, 2024 01:33
Rename local Git directory to match the current remote name in GitHub
export GH_PAT="ghp_xxxxxxxxxxxxxxxxxxxxxxxx"
for dir in */; do
cd "$dir" || exit
if [ -d .git ]; then
cleaned_dir=$(echo $dir | sed 's:/*$::') # Remove trailing slash
if git remote get-url origin &>/dev/null; then
remote_url=$(git remote get-url origin)
repo_ref=$(basename "$(dirname "$remote_url")")/$(basename "$remote_url" | sed 's:.git*$::')
@fauxpark
fauxpark / applefn.patch
Last active May 2, 2024 18:45
QMK Apple Fn
diff --git a/builddefs/common_features.mk b/builddefs/common_features.mk
index 18f8b0bbfc..4ef3e230e4 100644
--- a/builddefs/common_features.mk
+++ b/builddefs/common_features.mk
@@ -878,6 +878,10 @@ ifeq ($(strip $(JOYSTICK_ENABLE)), yes)
endif
endif
+ifeq ($(strip $(APPLE_FN_ENABLE)), yes)
+ OPT_DEFS += -DAPPLE_FN_ENABLE
@sararob
sararob / data-structure.js
Last active April 26, 2022 22:21
Role-based security in Firebase
/*
This example shows how you can use your data structure as a basis for
your Firebase security rules to implement role-based security. We store
each user by their Twitter uid, and use the following simplistic approach
for user roles:
0 - GUEST
10 - USER
20 - MODERATOR