Skip to content

Instantly share code, notes, and snippets.

View randallwc's full-sized avatar
🥳

William Randall randallwc

🥳
View GitHub Profile
@ryukoposting
ryukoposting / Makefile
Created November 14, 2022 21:59
Automatically generate c_cpp_properties.json from Makefile with a 99-line Ruby script
CC:=gcc
CFLAGS:=\
-I./include\
-DFOO\
-DBAR\
-std=c11
.vscode/c_cpp_properties.json: Makefile
ruby vscode_cprops_gen.rb .vscode $(CC) $(CFLAGS)
@aashreys
aashreys / config.h
Last active September 22, 2024 03:37
Adding RGB Timeout functionality to your QMK keyboard
/* In your config.h define a new variable RGBLIGHT_TIMEOUT and give it a value in milliseconds */
#define RGBLIGHT_SLEEP // allows us to use rgblight_suspend() and rgblight_wakeup() in keymap.c
#define RGBLIGHT_TIMEOUT 30000 // 30 seconds
@awesomebytes
awesomebytes / ipython_to_file.md
Created March 16, 2016 10:38
Save iPython session to a python file as code

Save an iPython session commands/code to a file

You must use the magic method %save:

In [1]: %save?
Type:       Magic function
String Form:<bound method CodeMagics.save of <IPython.core.magics.code.CodeMagics object at 0x7fb5d25bb1d0>>
Namespace:  IPython internal
File: /usr/lib/python2.7/dist-packages/IPython/core/magics/code.py
@gene1wood
gene1wood / batch-delete-gmail-emails.js
Last active July 28, 2025 00:33
A Google Apps Script script to bulk delete large amounts of email in Gmail while avoiding the error #793 which Gmail encounters normally
/*
This script, when used with Google Apps Scripts, will delete 400 emails and
can be triggered to run every few minutes without user interaction enabling you
to bulk delete email in Gmail without getting the #793 error from Gmail.
Google returns a maximum of 500 email threads in a single API call.
This script fetches 400 threads in case 500 threads is causing timeouts
Configure the search query in the code below to match the type of emails
you want to delete
@myusuf3
myusuf3 / delete_git_submodule.md
Created November 3, 2014 17:36
How effectively delete a git submodule.

To remove a submodule you need to:

  • Delete the relevant section from the .gitmodules file.
  • Stage the .gitmodules changes git add .gitmodules
  • Delete the relevant section from .git/config.
  • Run git rm --cached path_to_submodule (no trailing slash).
  • Run rm -rf .git/modules/path_to_submodule (no trailing slash).
  • Commit git commit -m "Removed submodule "
  • Delete the now untracked submodule files rm -rf path_to_submodule

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: