Skip to content

Instantly share code, notes, and snippets.

View dsewnr's full-sized avatar
⛰️
LNT

Peter Lu dsewnr

⛰️
LNT
View GitHub Profile
@dsewnr
dsewnr / 不自殺聲明.txt
Last active November 22, 2017 09:08
不自殺聲明
本人在此特地聲明:
本人樂觀開朗,身體健康,無任何使我困擾之慢性病或心理疾病,故絕不可能做出任何看似自殺之行為。
本人從無睡眠困擾,故不需服用安眠藥。
本人不酗酒亦不吸毒,也絕不會接近下列地點──
開放性水域
無救生員之游泳池
有高壓、危險氣體,或密閉式未經抽氣處理之地下室、蓄水池、水桶等
無安全護欄之任何高處
@dsewnr
dsewnr / .fonts.conf
Last active April 20, 2018 15:02
Linux User Font Config ( Solve Ugly Chinese Font in Telegram Desktop )
<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
<dir>~/.fonts</dir>
<match target="font">
<edit mode="assign" name="antialias">
<bool>true</bool>
</edit>
</match>
<alias>
@dsewnr
dsewnr / .shellrc
Created April 20, 2018 15:11
pbcopy & pbpaste in Linux
# Install xclip and add below lines to your shell rc file.
alias pbcopy='xclip -selection clipboard'
alias pbpaste='xclip -selection clipboard -o'
@dsewnr
dsewnr / speedup_trackpoint.sh
Last active May 2, 2018 06:25
Script to Speed Up TrackPoint for Thinkpad X1 Carbon 5th Gen
#!/bin/bash
# obtain TrackPoint ID from xinput list
TP_ID=$(xinput list | grep TrackPoint | cut -f 2 | grep -Eo '[0-9]{1,}')
if [ -n "$TP_ID" ]; then
# obtain properties from xinput list-props "$TP_ID"
AS_ID=$(xinput list-props "$TP_ID" | grep 'libinput Accel Speed (' | cut -f 2 | grep -Eo '[0-9]{1,}')
# set the speed you want
xinput set-prop "$TP_ID" "$AS_ID" 1
@dsewnr
dsewnr / ctrl_touchpad.sh
Last active May 2, 2018 06:25
Script To Enable/Disable TouchPad for Thinkpad X1 Carbon 5th Gen
#!/bin/bash
# ./ctrl_touchpad.sh (enable|disable)
xinput $1 $(xinput | grep TouchPad | cut -d '=' -f 2 | awk '{print $1}')
@dsewnr
dsewnr / localStorage.js
Created June 5, 2018 05:04 — forked from anhang/localStorage.js
HTML5 Local Storage with Expiration
AZHU.storage = {
save : function(key, jsonData, expirationMin){
if (!Modernizr.localstorage){return false;}
var expirationMS = expirationMin * 60 * 1000;
var record = {value: JSON.stringify(jsonData), timestamp: new Date().getTime() + expirationMS}
localStorage.setItem(key, JSON.stringify(record));
return jsonData;
},
load : function(key){
if (!Modernizr.localstorage){return false;}
@dsewnr
dsewnr / docker-compose.yml
Last active January 19, 2019 16:18
docker-compose.yml for NSQ
# DON'T FORGET TO ADD "127.0.0.1 nsqd" TO /etc/hosts
version: '3'
services:
nsqlookupd:
image: nsqio/nsq
networks:
- nsq-network
hostname: nsqlookupd
ports:
@dsewnr
dsewnr / TrueColour.md
Created August 1, 2019 03:24 — forked from XVilka/TrueColour.md
True Colour (16 million colours) support in various terminal applications and terminals

Terminal Colors

There exists common confusion about terminal colors. This is what we have right now:

  • Plain ASCII
  • ANSI escape codes: 16 color codes with bold/italic and background
  • 256 color palette: 216 colors + 16 ANSI + 24 gray (colors are 24-bit)
  • 24-bit true color: "888" colors (aka 16 milion)
" curl -fLo ~/.vim/autoload/plug.vim --create-dirs \
" https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim
" Specify a directory for plugins
" - For Neovim: ~/.local/share/nvim/plugged
" - Avoid using standard Vim directory names like 'plugin'
call plug#begin('~/.vim/plugged')
Plug 'mhinz/vim-startify'
Plug 'tpope/vim-obsession'

Keybase proof

I hereby claim:

  • I am dsewnr on github.
  • I am dsewnr (https://keybase.io/dsewnr) on keybase.
  • I have a public key whose fingerprint is 9959 7643 7C7E 532B 837C 06A3 7B00 DE06 31B5 FDA9

To claim this, I am signing this object: