Skip to content

Instantly share code, notes, and snippets.

@nemolize
nemolize / build-qmk-with-macro.md
Last active November 6, 2021 21:58
How to build QMK with passing MASTER_LEFT or MASTER_RIGHT in CLI

Note: replace $KEYBOARD and $KEYMAP to yours.

Docker

  • left hand
    sudo MAKEFLAGS="EXTRAFLAGS=-DMASTER_LEFT" ./util/docker_build.sh crkbd:n:avrdude 
  • right hand
@nemolize
nemolize / GetDisplayRefreshRates.swift
Last active July 9, 2020 15:56
This code demonstrates how display refresh rates can be retrieved in Cocoa framework with swift
// Prints refresh rates of displays.
func debugPrintDisplayRefreshRates() {
var displayCount: UInt32 = 0
var result = CGGetActiveDisplayList(0, nil, &displayCount)
let allocated = Int(displayCount)
let activeDisplays = UnsafeMutablePointer<CGDirectDisplayID>.allocate(capacity: allocated)
defer { activeDisplays.deallocate() }
@nemolize
nemolize / MoveWindow.swift
Created July 25, 2020 20:11
These function demonstrates how to change coordinate of the focused window
func moveWindow(_ appRef: AXUIElement, _ velocity: CGPoint) {
do {
var windowRef: AnyObject?
try appRef.copyAttributeValue(kAXFocusedWindowAttribute, &windowRef)
let windowElement: AXUIElement = windowRef as! AXUIElement
var positionRef: CFTypeRef?
try windowElement.copyAttributeValue(kAXPositionAttribute, &positionRef)
var position = CGPoint()

Keybase proof

I hereby claim:

  • I am nemolize on github.
  • I am nemolize (https://keybase.io/nemolize) on keybase.
  • I have a public key whose fingerprint is CE91 6E32 B769 A792 A743 EC03 AB22 03C1 5744 FF24

To claim this, I am signing this object:

@nemolize
nemolize / screenshot.png
Last active September 24, 2020 15:32
Custom keyboard layout file which disables symbols with alt + letter on mac.
screenshot.png
@nemolize
nemolize / import-keybase-for-verified-git-commits.sh
Last active May 19, 2022 14:40
Sign your git commits with a key imported from keybase
# NOTE: Assuming you have already installed keybase and logged in
# This is only for WSL. see: https://github.com/microsoft/WSL/issues/4029
export GPG_TTY=$(tty)
# import your public/private keys from keybase
keybase pgp export | gpg --import
keybase pgp export --secret | gpg --allow-secret-key --import --batch
# show your imported keys
@nemolize
nemolize / environment
Created September 26, 2021 16:55
Avoid micro stuttering on Linux with 144Hz and 60Hz monitors
# /etc/environment
CLUTTER_DEFAULT_FPS=144
__GL_SYNC_DISPLAY_DEVICE=DP-2
@nemolize
nemolize / grub
Created October 20, 2021 00:12
How to fix Ryzen soft lockup problem on Linux
# add "processor.max_cstate=1 pcie_aspm=off" options to GRUB_CMDLINE_LINUX like the following
GRUB_CMDLINE_LINUX="processor.max_cstate=1 pcie_aspm=off"
@nemolize
nemolize / environment
Created November 16, 2021 01:24
etc/environment settings to enable fcitx for JetBrains IDEs
GTK_IM_MODULE=fcitx
QT_IM_MODULE=fcitx
XMODIFIERS=@im=fcitx
@nemolize
nemolize / idea.properties
Created November 23, 2021 17:37
Use Windows keys as Meta keys in JetBrains IDEs
# custom IntelliJ IDEA properties
# NOTE: specify the following property to use windows keys as meta keys. see https://youtrack.jetbrains.com/issue/IDEA-144702
keymap.windows.as.meta=true