Skip to content

Instantly share code, notes, and snippets.

View AdamWagner's full-sized avatar

Adam Wagner AdamWagner

View GitHub Profile
// Unmap undesired defaults
const unmaps = [
"sb", "sw", "ob",
"ow", "cp", ";cp",
";ap", "spa", "spb",
"spd", "sps", "spc",
"spi", "sfr", "zQ",
"zz", "zR", "ab",
"Q", "q", "ag",
"af", ";s", "yp",
{"title": "Mission control, elaborate",
"rules":[
{ "description": "Mission control, elaborate; requires Ctrl, Shft & arrows. Was created to make movements in Mission Control 'key-able', but works in all apps.",
"manipulators": [
{ "from": {
"key_code": "right_arrow",
"modifiers": {
"mandatory": ["control",
"shift"] } },
"to": [
@luruke
luruke / bunny.js
Created October 27, 2018 07:51
draw bunny on terminal
const drawille = require('drawille')
const bunny = require('bunny')
const glmatrix = require('gl-matrix')
const width = 200
const height = 200
const canvas = new drawille(width, height)
const mat4 = glmatrix.mat4
const vec3 = glmatrix.vec3
let points = []
@nkhil
nkhil / github.js
Created November 25, 2018 00:29
How to close a repo, work on it and upload it to Github as a different repo
// GitHub: git clone someone else's repository & git push to your own repository
// Create a new repository at github.com. (this is your repository)
// Give it the same name as the other repository.
// Don't initialize it with a README, .gitignore, or license.
// Clone the other repository to your local machine. (if you haven't done so already)
// git clone https://github.com/other-account/other-repository.git
// Rename the local repository's current 'origin' to 'upstream'.
@focusaurus
focusaurus / fuzzball.sh
Created November 25, 2018 18:22
Fuzzball desktop automation script
#!/usr/bin/env bash
# Please Use Google Shell Style: https://google.github.io/styleguide/shell.xml
# ---- Start unofficial bash strict mode boilerplate
# http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -o errexit # always exit on error
set -o errtrace # trap errors in functions as well
set -o pipefail # don't ignore exit codes when piping output
set -o posix # more strict failures in subshells
@bool3max
bool3max / kitty.conf
Created March 6, 2019 11:05
My kitty terminal config
font_family Iosevka Term
bold_font Iosevka Term Bold
italic_font Iosevka Term Italic
bold_italic_font Iosevka Term Bold Italic
font_size 10.0
background #141414
foreground #F8F8F0
active_border_color #b2b2b0
inactive_text_alpha 0.85
# This is heavily based in the code here:
# https://gist.github.com/enpassant/0496e3db19e32e110edca03647c36541
# Special thank you to the user enpassant for starting it https://github.com/enpassant
#!/bin/bash
SYNTAX="$2"
EXTENSION="$3"
OUTPUTDIR="$4"
INPUT="$5"
@pirate
pirate / alfred-clipboard.sh
Last active July 25, 2025 09:27
Script to manage searching, backing up, and collecting infinite clipboard history from the Alfred Clipboard History on macOS. Workflow UI: https://alfred.app/workflows/mayjunejuly/clipboard-history-archive/
#!/usr/bin/env bash
# This is a script that provides infinite history to get around Alfred's 3-month limit.
# It works by regularly backing up and appending the items in the alfred db to a
# sqlite database in the user's home folder. It also provides search functionality.
# 🎉 A NEWER IMPROVED VERSION OF THIS IN WORKFLOW FORM: 🚨
# ➡️ https://alfred.app/workflows/mayjunejuly/clipboard-history-archive/
# https://www.alfredforum.com/topic/10969-keep-clipboard-history-forever/?tab=comments#comment-68859
# https://www.reddit.com/r/Alfred/comments/cde29x/script_to_manage_searching_backing_up_and/

Vim will move the cursor to the beginning of an object after invoking operator upon it. From an interactive editing perspective this may be considered annoying however it is the consistent choice as operators can be destructive. As such restoring the cursor to its prior position after invoking an operator on an object may not make sense.

There are many ways possible to alter this behaviour to your preference with mappings and/or scripting. But with custom operator mappings this can be particularly ugly.

@FractalWire
FractalWire / nvrp
Last active September 5, 2020 03:32
preview file with fzf and nvr
#!/bin/bash
# simple script to preview files with the help of fzf
cwd=$(pwd)
# set up
nvr --nostart -cc 'let nvrp_buffer=""'
set_variables='mime_list=( "application/json" "text/" ); mime=$(file --mime-type {} | cut -d " " -f 2)'
f_is_text='for m in ${mime_list[@]}; do test "${mime#$m}" != "$mime" && break || false; done'