Skip to content

Instantly share code, notes, and snippets.

View narze's full-sized avatar
🕺
You know the rules, and so do I

Manassarn "Noom" Manoonchai narze

🕺
You know the rules, and so do I
View GitHub Profile
@narze
narze / surfingkeys.js
Last active November 20, 2022 11:07
surfingkeys.js
// 1.0 Compatability
const {
aceVimMap,
mapkey,
imap,
imapkey,
getClickableElements,
vmapkey,
map,
unmap,
@narze
narze / live-coding-notes.md
Last active March 21, 2020 12:51
Live Coding Notes
@narze
narze / pedal.ino
Created January 22, 2020 10:51
Pedal : Arduino foot app switcher
#include <Keyboard.h>
bool pressed = false;
bool currentState;
bool lastState = false;
// the following variables are unsigned longs because the time, measured in
// milliseconds, will quickly become a bigger number than can be stored in an int.
unsigned long lastDebounceTime = 0; // the last time the output pin was toggled
unsigned long debounceDelay = 10; // the debounce time; increase if the output flickers
@narze
narze / remove_sidekiq_processes.md
Created January 14, 2020 10:13
Removing orphaned processes on Sidekiq

Removing orphaned processes on Sidekiq

Sometimes your Sidekiq processes exit prematurely and the process name is still showing on Sidekiq UI, you have to remove it manually in Redis.

  1. Access Redis from cli
redis-cli your-redis-server-url
  1. Sidekiq uses processes set to store processes ids, so list them with SMEMBERS
@narze
narze / karabiner.json
Created November 25, 2019 06:46
karabiner.json from my goku
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
@narze
narze / karabiner_merge.sh
Created June 7, 2019 12:32
Merge karabiner.json with complex modification rules
#!/usr/bin/env bash
# Requirements : goku, jq
# 1. Make sure goku runs
goku
# 2. Make temp json file
cp ~/.config/karabiner/karabiner.json ~/.config/karabiner/karabiner.tmp.json
@narze
narze / require_external.rb
Last active April 5, 2019 05:17
Load external gem (out of Gemfile) into Rails console
def require_external(gem_name=nil, gem_version="*", gem_libdir="lib")
gem_dir = Dir["#{`gem env gemdir`.strip}/gems/#{gem_name}-#{gem_version}"].first
raise "Gem '#{gem_name}' version '#{gem_version}' not found" if gem_dir.nil?
gemlib = Dir["#{gem_dir}/#{gem_libdir}/#{gem_name}.rb"].first
raise "Gem lib file '#{gemlib}' not found" if gemlib.nil?
puts "Loading gem '#{gem_name}' version '#{gem_version}' from #{gemlib}"
@narze
narze / mopidy_install.sh
Last active December 20, 2018 10:03
Install mopidy on macOS High Sierra & Mojave without GObject error (No module named gi)
brew install python
# pygobject3 must be installed with --with-python@2 or it won't work
brew uninstall --ignore-dependencies pygobject3
brew install pygobject3 --with-python@2 gtk+3
brew install py2cairo # Another mopidy dependency
brew tap mopidy/mopidy
brew install mopidy
@narze
narze / karabiner.edn
Last active March 29, 2022 21:09
Goku config with SuperDuper mode (S+D)
{:templates {:alfred "osascript -e 'tell application \"Alfred 3\" to run trigger \"%s\" in workflow \"%s\" with argument \"\"'"
:km "osascript -e 'tell application \"Keyboard Maestro Engine\" to do script \"%s\"'"}
:simlayers {
:f-mode {:key :f}
:o-mode {:key :o}
:h-mode {:key :h}
:superduper-mode {:key :f20} ; Bind an unused key
}
:devices {:filco-bt [{:vendor_id 2652 :product_id 34050}]
:planck [{:vendor_id 65261 :product_id 24672}]
@narze
narze / .sVimrc
Created October 10, 2018 10:36 — forked from TSFoster/.sVimrc
.sVimrc
let scrollstep = 100
let hintcharacters = "asdfjkl"
let homeurl = "about:blank"
let mapleader = "space"
let blacklists = ["*://www.fastmail.com/*","*://mail.google.com/*","*://docs.google.com/*","*://*feedbin.com/*","*://www.babbel.com/*","*://*trello.com/*","*://www.codewars.com/*","*://www.shortcutfoo.com/*","*://getpocket.com/*","*://*netflix.com/*","*://app.youneedabudget.com/*", "*://codepen.io/*","*://duckduckgo.com/*","*://www.youtube.com/watch?*","https://ellie-app.com/*"]