Skip to content

Instantly share code, notes, and snippets.

View JohnAtl's full-sized avatar

John T. Johnson JohnAtl

View GitHub Profile
@dmsul
dmsul / vim_crash_course.md
Last active September 1, 2024 08:51
Vim Crash Course

NOTE: Specific examples given for options, flags, commands variations, etc., are not comprehensive.

NORMAL MODE

Vim has 2 main "modes", that chance the behavior of all your keys. The default mode of Vim is Normal Mode and is mostly used for moving the cursor and navigating the current file.

Some important (or longer) commands begin with ":" and you will see the text you enter next at the bottom left of the screen.

:q[uit] - quit (the current window of) Vim. ("Window" here is internal to Vim, not if you have multiple OS-level windows of Vim open at once.)
:q! - force quit (if the current buffer has been changed since the last save)
:e[dit] {filename} - read file {filename} into a new buffer.

@LouisAmon
LouisAmon / json_to_gzip.py
Created July 26, 2018 12:49
How to compress JSON-able data using gzip (Python 3)
import json
import gzip
def compress_data(data):
# Convert to JSON
json_data = json.dumps(data, indent=2)
# Convert to bytes
encoded = json_data.encode('utf-8')
# Compress
compressed = gzip.compress(encoded)
@rodchristiansen
rodchristiansen / Uninstall Soundflower in macOS Catalina
Created June 27, 2020 20:22
Script to remove Soundflower audio driver from macOS Catalina 10.15+
#!/bin/bash
# Clears the SIP protected folder where Soundflower will be loaded by the system
sudo kextcache --clear-staging
if [ -d /Library/Extensions/Soundflower.kext ]; then
sudo kextunload -q /Library/Extensions/Soundflower.kext
sudo rm -rf /Library/Extensions/Soundflower.kext
fi
@nikolai-cc
nikolai-cc / karabiner.edn
Last active October 9, 2024 01:24
my sourcefile for Karabiner in Goku's .edn format
{
;; ----------------------------------
;; this is my goku file for karabiner
;; ----------------------------------
;; more info about goku: https://github.com/yqrashawn/GokuRakuJoudo
;; more info about karabiner: https://karabiner-elements.pqrs.org/docs
;; ----------------------------------
;; article karabiner god mode by nikita: https://medium.com/@nikitavoloboev/karabiner-god-mode-7407a5ddc8f6
;; examples: https://github.com/yqrashawn/GokuRakuJoudo/blob/master/examples.org#profiles-wip
;; tutorial: https://github.com/yqrashawn/GokuRakuJoudo/blob/master/tutorial.md#basic8