Skip to content

Instantly share code, notes, and snippets.

@yetone
yetone / macos-tmux-256color.md
Created January 9, 2022 17:27 — forked from bbqtd/macos-tmux-256color.md
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):

@yetone
yetone / gist:7a7bac261f96657aeef5fd98be50b5ff
Created November 15, 2019 14:34 — forked from pfreixes/gist:3187511
Supervisorctl bash autocomplete
View gist:7a7bac261f96657aeef5fd98be50b5ff
# pfreixes, 2012-07-27
# Add to /etc/bash_completion.d/supervisorctl
_supervisor()
{
local cur prev opts base
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
@yetone
yetone / README-Template.md
Created November 16, 2018 07:44 — forked from PurpleBooth/README-Template.md
A template to make good README.md
View README-Template.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@yetone
yetone / who-weibo.js
Created January 15, 2018 02:33 — forked from zh-h/who-weibo.js
是谁发的微博微博图片
View who-weibo.js
function decodeBase62(number) {
var alphabet = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
var out = 0
var len = number.length - 1
for (var t = 0; t <= len; t++) {
out = out + alphabet.indexOf(number.substr(t, 1)) * Math.pow(62, len - t)
}
return out
}
@yetone
yetone / .pylintrc
Created December 11, 2017 02:30 — forked from xen/.pylintrc
View .pylintrc
[MASTER]
# Specify a configuration file.
#rcfile=
# Python code to execute, usually for sys.path manipulation such as
# pygtk.require().
#init-hook=
# Profiled execution.
@yetone
yetone / svm.py
Created July 24, 2017 10:38 — forked from mblondel/svm.py
Support Vector Machines
View svm.py
# Mathieu Blondel, September 2010
# License: BSD 3 clause
import numpy as np
from numpy import linalg
import cvxopt
import cvxopt.solvers
def linear_kernel(x1, x2):
return np.dot(x1, x2)
@yetone
yetone / svm.py
Created July 24, 2017 10:38 — forked from mblondel/svm.py
Support Vector Machines
View svm.py
# Mathieu Blondel, September 2010
# License: BSD 3 clause
import numpy as np
from numpy import linalg
import cvxopt
import cvxopt.solvers
def linear_kernel(x1, x2):
return np.dot(x1, x2)
@yetone
yetone / waifu2x.py
Created June 26, 2017 03:08 — forked from Tydus/waifu2x.py
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")
@yetone
yetone / README.md
Created April 26, 2017 13:34 — forked from xaviervia/README.md
Sketch 43 files JSON types
View README.md
@yetone
yetone / python-monkey-patch-built-ins.py
Created April 10, 2017 07:39 — forked from mahmoudimus/python-monkey-patch-built-ins.py
pythonic monkey patching built-in types
View python-monkey-patch-built-ins.py
# found this from Armin R. on Twitter, what a beautiful gem ;)
import ctypes
from types import DictProxyType, MethodType
# figure out side of _Py_ssize_t
if hasattr(ctypes.pythonapi, 'Py_InitModule4_64'):
_Py_ssize_t = ctypes.c_int64
else:
_Py_ssize_t = ctypes.c_int