Skip to content

Instantly share code, notes, and snippets.

View liushooter's full-sized avatar

Shooter liushooter

View GitHub Profile
@liushooter
liushooter / pliim-turnOff.scpt
Created July 31, 2020 04:26 — forked from zehfernandes/pliim-turnOff.scpt
One click and be ready to go up on stage and shine! - https://zehfernandes.github.io/pliim/
# Turn on Notifications
do shell script "defaults -currentHost write com.apple.notificationcenterui doNotDisturb -bool FALSE; defaults -currentHost delete com.apple.notificationcenterui doNotDisturbDate; osascript -e 'quit application \"NotificationCenter\" ' && killall usernoted" -- this set 'Do not disturb' to false in the pref
# Show Desktop
do shell script "defaults write com.apple.finder CreateDesktop -bool true; killall Finder"
# Show all windows
tell application "System Events"
set visible of (every process) to true
end tell
@liushooter
liushooter / debugging_decorators.py
Created June 20, 2020 05:36 — forked from chadgh/debugging_decorators.py
python decorators for; debugging, threading
def timeit(function):
'''Decorator used for debugging. Prints the call and how long it took.'''
def timed(*args, **kwargs):
ts = time.time()
result = function(*args, **kwargs)
te = time.time()
print("{0} ({1}, {2}) {3:.2} sec"
.format(function.__name__, args, kwargs, te - ts))
@liushooter
liushooter / server.badbots
Created May 22, 2020 13:24 — forked from hans2103/server.badbots
NGINX to block bad bots. (add Twenga|TwengaBot if you want to exclude them too)
if ($http_user_agent ~* (360Spider|80legs.com|Abonti|AcoonBot|Acunetix|adbeat_bot|AddThis.com|adidxbot|ADmantX|AhrefsBot|AngloINFO|Antelope|Applebot|BaiduSpider|BeetleBot|billigerbot|binlar|bitlybot|BlackWidow|BLP_bbot|BoardReader|Bolt\ 0|BOT\ for\ JCE|Bot\ mailto\:craftbot@yahoo\.com|casper|CazoodleBot|CCBot|checkprivacy|ChinaClaw|chromeframe|Clerkbot|Cliqzbot|clshttp|CommonCrawler|comodo|CPython|crawler4j|Crawlera|CRAZYWEBCRAWLER|Curious|Curl|Custo|CWS_proxy|Default\ Browser\ 0|diavol|DigExt|Digincore|DIIbot|discobot|DISCo|DoCoMo|DotBot|Download\ Demon|DTS.Agent|EasouSpider|eCatch|ecxi|EirGrabber|Elmer|EmailCollector|EmailSiphon|EmailWolf|Exabot|ExaleadCloudView|ExpertSearchSpider|ExpertSearch|Express\ WebPictures|ExtractorPro|extract|EyeNetIE|Ezooms|F2S|FastSeek|feedfinder|FeedlyBot|FHscan|finbot|Flamingo_SearchEngine|FlappyBot|FlashGet|flicky|Flipboard|g00g1e|Genieo|genieo|GetRight|GetWeb\!|GigablastOpenSource|GozaikBot|Go\!Zilla|Go\-Ahead\-Got\-It|GrabNet|grab|Grafula|GrapeshotCrawler|GTB5|GT\:\:WWW|Guzz
@liushooter
liushooter / subtitle-overlap-fixer.go
Created April 12, 2020 13:13 — forked from nimatrueway/subtitle-overlap-fixer.go
Little tool to fix overlapping subtitles (especially the ones extracted from english auto-subtitles of youtube, vtt files that you would convert to srt with ffmpeg)
package main
import (
"time"
"regexp"
"bufio"
"strconv"
"fmt"
"os"
"errors"
@liushooter
liushooter / README.md
Created February 26, 2020 09:37 — forked from quake/README.md

在本篇文档里,我们会使用 mruby 来作为编程语言演示如何在 CKB 实现一个最基础 UDT (User Defined Token) 合约

Dev Chain

首先我们需要启动一个本地的开发链来方便调试

配置矿工信息

我们先用 ckb-cli 命令生成一个新账户用于挖矿,运行 ckb-cli,然后输入

account new
@liushooter
liushooter / converter.py
Created February 23, 2020 12:55 — forked from Kronopath/converter.py
WeChat audio converter script. See http://kronopath.net/blog/extracting-audio-messages-from-wechat/ for more details.
# WeChat aud file converter to wav files
# Dependencies:
# SILK audio codec decoder (available at https://github.com/gaozehua/SILKCodec)
# ffmpeg
#
# By Gabriel B. Nunes (gabriel@kronopath.net)
# Adapted from another script by Nicodemo Gawronski (nico@deftlinux.net)
#
import os, argparse, subprocess

Image source

https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png

Try resize it!

  • ![](https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png | width=100)
@liushooter
liushooter / multiple_ssh_setting.md
Created July 4, 2019 14:57 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@liushooter
liushooter / msoffice_ooffice_pdf_diffs_with_git.md
Created May 13, 2019 08:43 — forked from mbrehin/msoffice_ooffice_pdf_diffs_with_git.md
Microsoft Office, Open Office, PDF diffs with Git

Sometimes when working with Git you'd like to commit binary files.
But those files won't have clean comparisons with Git standard diff command.
Fortunately Git is a great tool that comes with a lot of possibilities…

MS Office

If, as a developer, you are under company constraints and must use MS Office,
you'll encounter some issues when trying to diff MS Office files.

Maybe you're asking yourself: what's the problem with that?

@liushooter
liushooter / postgres.go
Created April 17, 2019 07:17 — forked from rivo/postgres.go
A demo Go application (a PostgreSQL database browser) highlighting the use of the rivo/tview package. See https://github.com/rivo/tview/wiki/Postgres
package main
import (
"database/sql"
"fmt"
"net/url"
"os"
"reflect"
"regexp"
"strconv"