Skip to content

Instantly share code, notes, and snippets.

@kuznero
kuznero / install-polybar.md
Last active October 17, 2022 17:36
Install polybar on Ubuntu 18.03

Polybar for i3

Installation in Ubuntu 18.04

sudo apt-get install \
  cmake cmake-data libcairo2-dev libxcb1-dev libxcb-ewmh-dev \
  libxcb-icccm4-dev libxcb-image0-dev libxcb-randr0-dev \
  libxcb-util0-dev libxcb-xkb-dev pkg-config python-xcbgen \
  xcb-proto libxcb-xrm-dev i3-wm libasound2-dev libmpdclient-dev \
@mcg1969
mcg1969 / rearch.py
Last active May 31, 2019 19:08
rearch.py: building arch-dependent versions of noarch python packages
# usage: python rearch.py <spec-that-resolves-to-noarch-package>
# 1. creates a directory derived from the spec (replacing ':/=' with dashes)
# 2. creates a conda recipe to build a python-version-specific package
# 3. runs the conda recipe for PYTHON_VERSIONS
# 4. runs conda-convert to obtain the other platforms
# leaves everything in the given directory.
import os
import shutil
import sys
@tanyuan
tanyuan / smart-caps-lock.md
Last active April 17, 2024 00:19
Smart Caps Lock: Remap Caps Lock to Control AND Escape

Smart Caps Lock: Remap to Control AND Escape (Linux, Mac, Windows)

Caps Lock 變成智慧的 Control 以及 Escape

  • 單獨輕按一下就是 Escape
  • 若按下時同時按著其他鍵,就會是 Control

這應該是 Vim 和 Emacs 的最佳解了!(Emacs? Bash 的快捷鍵就是 Emacs 系列的)

  • Send Escape if you tap Caps Lock alone.
@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
@frimik
frimik / git-submodule-sync.rb
Created March 9, 2013 19:32
Make damn sure that git submodule sync is going to work.
#! /usr/bin/env ruby
submods = Hash.new
%x{git config -f .gitmodules --get-regexp '^submodule\..*\.(path|url)$'}.lines.each do |l|
submodule, key, value = l.match(/^submodule\.(.*)\.(path|url)\s+(.*)$/)[1..3]
submods[submodule] = Hash.new unless submods[submodule].is_a?(Hash)
submods[submodule][key] = value
end