Skip to content

Instantly share code, notes, and snippets.

@towry
towry / color_mode.py
Last active February 26, 2023 06:04
macos auto dark mode with kitty+tmux+neovim. read order: install_dark_mode_notify.sh -> ke.bou.dark-mode-notify.plist -> dark_mode_changed.sh -> color_mode.py | YOU NEED TO CHANGE SOME PATH&VARIABLE to make this work.
#!/usr/bin/env python3
import os
import sys
import subprocess
# author: https://github.com/olimorris/dotfiles/blob/main/commands/color_mode.py
kitty_path = "~/.config/kitty"
# starship_path = "~/.config/starship"
@rka97
rka97 / academic.el
Created November 24, 2021 16:11
Configuration I use in Doom Emacs as part of my academic reading/notetaking workflow
;; The following packages are needed:
;; 1. elfeed and elfeed-score (available from the rss doom module)
;; 2. citar
;; 3. org-ref
;; 4. org-roam and org-roam-bibtex
(defconst robo/bib-libraries (list "~/bib-lib/robo-lib.bib" "~/bib-lib/robo-temp-lib.bib")) ; All of my bib databases.
(defconst robo/main-bib-library (nth 0 robo/bib-libraries)) ; The main db is always the first
(defconst robo/main-pdfs-library-paths `("~/bib-lib/pdfs/" "/home/robo/bib-lib/temp-pdfs/")) ; PDFs directories in a list
@daniel-koudouna
daniel-koudouna / evil-insert-fix.el
Last active September 19, 2021 00:53
Fixes the problem of certain functions adding input before the cursor when using evil mode in emacs
(defun my:is-end-of-line ()
"Compare point with end of line."
(let* ((pos (current-column))
(end-pos (save-excursion
(evil-end-of-line)
(current-column))))
(eq pos end-pos)))
(defun my:compare-with-end-of-word ()
"Compare point with end of word."
@bbqtd
bbqtd / macos-tmux-256color.md
Last active May 20, 2024 04:07
Installing tmux-256color for macOS

Installing tmux-256color for macOS

  • macOS 10.15.5
  • tmux 3.1b

macOS has ncurses version 5.7 which does not ship the terminfo description for tmux. There're two ways that can help you to solve this problem.

The Fast Blazing Solution

Instead of tmux-256color, use screen-256color which comes with system. Place this command into ~/.tmux.conf or ~/.config/tmux/tmux.conf(for version 3.1 and later):

# Luke's config for the Zoomer Shell
# Enable colors and change prompt:
autoload -U colors && colors
PS1="%B%{$fg[red]%}[%{$fg[yellow]%}%n%{$fg[green]%}@%{$fg[blue]%}%M %{$fg[magenta]%}%~%{$fg[red]%}]%{$reset_color%}$%b "
# History in cache directory:
HISTSIZE=10000
SAVEHIST=10000
HISTFILE=~/.cache/zsh/history
local function Chinese()
-- 简体拼音
hs.keycodes.currentSourceID("com.apple.inputmethod.SCIM.ITABC")
end
local function English()
-- ABC
hs.keycodes.currentSourceID("com.apple.keylayout.ABC")
end
@loziju
loziju / macosx-configure-postfix-as-relay.md
Last active May 4, 2024 23:51
Configure postfix as relay for OS X
@jchandra74
jchandra74 / PowerShell Customization.md
Last active March 1, 2024 01:02
PowerShell, Cmder / ConEmu, Posh-Git, Oh-My-Posh, Powerline Customization

Pimping Up Your PowerShell & Cmder with Posh-Git, Oh-My-Posh, & Powerline Fonts

Backstory (TLDR)

I work as a full-stack developer at work. We are a Windows & Azure shop, so we are using Windows as our development platform, hence this customization.

For my console needs, I am using Cmder which is based on ConEmu with PowerShell as my shell of choice.

Yes, yes, I know nowadays you can use the Linux subsystem on Windows 10 which allow you to run Ubuntu on Windows. If you are looking for customization of the Ubuntu bash shell, check out this article by Scott Hanselman.

@silvercircle
silvercircle / userChrome.css
Last active March 23, 2024 01:19
My Thunderbird userChrome for square tabs + some minor UI tweaks
/*
* Thunderbird userChrome.css
*
* WARNING: This style was designed for TB version 60 and will likely not work
* with more recent versions (see comments)
*
* it's meant to be used with the default 3 panel split layout
*/
@namespace url(http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul);
@dktapps
dktapps / TransferPlugin.php
Created February 1, 2017 13:18
Proof of concept transfer plugin for PocketMine with MCPE 1.0.3
<?php
/**
* @name TransferPlugin
* @main dktapps\TransferPlugin\Main
* @api 3.0.0-ALPHA3
* @version 1.0.0
* @description Proof-of-concept for server transfer in MCPE 1.0.3
* @author dktapps
*/