Skip to content

Instantly share code, notes, and snippets.

@bbqtd
bbqtd / macos-tmux-256color.md
Last active Aug 11, 2022
Installing tmux-256color for macOS
View macos-tmux-256color.md

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):

View customize.material-dark-theme.md

;; 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
plasma on kubernetes
View 01_plasma.yaml
# 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 Aug 5, 2022
Customize website's scrollbar like Mac OS. Not supports in Firefox and IE.
View customize-scrollbar.css
/* 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 */
View multiprocessing_widgets.ipynb
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
Terminal color test scripts
View 16-color-table.sh
#!/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 Feb 16, 2021
Sketch 43 files JSON types
View README.md
@chrisdone
chrisdone / Printf.idr
Last active Jan 22, 2022
Type-safe dependently-typed printf in Idris
View Printf.idr
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
waifu2x in 15 lines of Python by @marcan42
View waifu2x.py
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")
View fuyuquan.md

海盗哥talks about vim

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

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

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

        :'<,'>g/text_feature/vimcommand

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