Skip to content

Instantly share code, notes, and snippets.

@bbqtd
bbqtd / macos-tmux-256color.md
Last active August 7, 2024 14:39
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):

@huytd
huytd / customize.material-dark-theme.md
Last active September 2, 2023 13:03
My minimal Emacs config

;; Automatically generated
(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(anzu-cons-mode-line-p nil)
@remram44
remram44 / 01_plasma.yaml
Created May 8, 2018 18:42
plasma on kubernetes
# Setup (on whatever worker the pods are running on):
# mkdir /var/plasma-remi
# mkdir /var/plasma-remi/socket
# mkdir /var/plasma-remi/hugepages
# mount -t hugetlbfs -o uid=0 -o gid=0 none /var/plasma-remi/hugepages
# Apply this config (kubectl apply -f plasma-remi.yaml)-test
# Execute plasma commands on client 1:
# POD=$(kubectl get pod -l app=plasma-test-remi,thing=client1 -o='jsonpath={.items[*].metadata.name}')
@spemer
spemer / customize-scrollbar.css
Last active August 8, 2024 17:02
✨ Customize website's scrollbar like Mac OS. Not supports in Firefox and IE.
/* Customize website's scrollbar like Mac OS
Not supports in Firefox and IE */
/* total width */
body::-webkit-scrollbar {
background-color: #fff;
width: 16px;
}
/* background of the scrollbar except button or resizer */
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vivkin
vivkin / 16-color-table.sh
Created May 26, 2017 07:11
Terminal color test scripts
#!/bin/bash
#
# This file echoes a bunch of color codes to the terminal to demonstrate
# what's available. Each line is the color code of one forground color,
# out of 17 (default + 16 escapes), followed by a test use of that color
# on all nine background colors (default + 8 escapes).
#
T='gYw' # The test text
echo -e "\n 40m 41m 42m 43m 44m 45m 46m 47m";
for FGs in ' m' ' 1m' ' 30m' '1;30m' ' 31m' '1;31m' ' 32m' '1;32m' ' 33m' '1;33m' ' 34m' '1;34m' ' 35m' '1;35m' ' 36m' '1;36m' ' 37m' '1;37m';
@xaviervia
xaviervia / README.md
Last active February 16, 2021 20:12
Sketch 43 files JSON types
@chrisdone
chrisdone / Printf.idr
Last active May 27, 2024 13:01
Type-safe dependently-typed printf in Idris
module Printf
%default total
-- Formatting AST.
data Format
= FInt Format
| FString Format
| FOther Char Format
| FEnd
@Tydus
Tydus / waifu2x.py
Last active May 30, 2022 07:16
waifu2x in 15 lines of Python by @marcan42
import json, sys, numpy as np
from scipy import misc, signal
from PIL import Image
infile, outfile, modelpath = sys.argv[1:]
model = json.load(open(modelpath))
im = Image.open(infile).convert("YCbCr")
im = misc.fromimage(im.resize((2*im.size[0], 2*im.size[1]), resample=Image.NEAREST)).astype("float32")
planes = [np.pad(im[:,:,0], len(model), "edge") / 255.0]
for step in model:
o_planes = [sum([signal.convolve2d(ip, np.float32(kernel), "valid")

海盗哥talks about vim

  1. visual 模式下面能用o来切换选中上下

  2. repeat: .,用来重复上一次对字符串的操作

  3. visual模式下可以这样用:

        :'<,'>g/text_feature/vimcommand

:'<,'>g/text_feature/s/this/that