Skip to content

Instantly share code, notes, and snippets.

Tevin tevino

Block or report user

Report or block tevino

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tevino
tevino / Daily Journal.applescript
Created Oct 12, 2019
Markdown daily journal template based on builtin smart template "Daily Journal" in DEVONthink 3
View Daily Journal.applescript
(*
Based on script by Chuck Lane October 2, 2013
https://discourse.devontechnologies.com/t/daily-journal-script/16509
Updated and optimized for DEVONthink 3 by Christian Grunenberg April 30, 2019
Localized and styles updated by Eric Böhnisch-Volkmann June 28, 2019
Changes done by Tevin Zhang 2019-10-12
- Use markdown instead of rtd
- Remove news
- Use date format specified by ISO 8601 to reduce the effort of localization
*)
View wpad.dat
function r(r){for(var t={};i=r.pop();)t[i]=1;return t}function FindProxyForURL(r,i){if(isPlainHostName(i))return e;var f=i,o=0;do{if(_.hasOwnProperty(f))return t;if(n.hasOwnProperty(f))return e;o=i.indexOf(".",o)+1,f=i.substring(o)}while(o>0);var u=dnsResolve(i);if(!u)return t;if(u.indexOf(":")>=0)return e;var l=u.split("."),p=(255&l[1])<<8|255&l[2],v=l[0],d=s[v],h=a[v];if(0===d)return t;if(16===h)return e;var w=0,L=d.length,c=L>>1;do d[c]>p?L=c:w=c,c=w+L>>1;while(w+1<L);return p-d[w]>>h[w]===0?e:t}var t="PROXY 127.0.0.1:1235;",e="DIRECT",n=r("v2ex.co|qishu.co|cn|loli.vg|pp.cc|cnu.cc|adchina.cc|chinave.cc|hefei.cc|yiyi.cc|snsfun.cc|ulink.cc|ffdy.cc|ngacn.cc|zhibo8.cc|akarin.xyz|sf.gg|iapps.im|dcloud.io|mindstore.io|daocloud.io|coding.io|jianshu.io|my-card.in|pdim.gs|51.la|ijq.tv|acg.tv|yy.tv|muho.tv|zerodm.tv|pps.tv|mootion.tv|miomio.tv|imgo.tv|rrmj.tv|bilibili.tv|fun.tv|zhanqi.tv|xiaoka.tv|feizao.tv|1006.tv|ganews.tv|hoolo.tv|panda.tv|acfun.tv|1cool.tv|cctvcom|kdnet.net|cloudxns.net|lxdns.net|768cn.net|zoosn
@tevino
tevino / casio-watch-spider.py
Last active Aug 27, 2019
A spider to get CASIO(including G-SHOCK) watch specs, to help you make your choice.
View casio-watch-spider.py
import re
import scrapy
def parse_date(s):
if s:
s = s.replace('', '').replace('', '').replace('NEW', '')
if len(s) == 5:
month = s[-1]
s = s[:4] + "0" + month # add a leading zero to month
s = int(s)
View truth_about_love.py
while you.is_single and you.love_letter in you.code_written:
you.is_single = True
View Find similar contents.scpt
-- Find Similar Contents.
-- Created by Christian Grunenberg on Thu Feb 10 2005.
-- Copyright (c) 2005-2014. All rights reserved.
-- Limit for more or less identical contents (0.0: no similarity, 1.0: almost identical)
property pLimit : 0.9
-- Max. number of similar results to display
@tevino
tevino / paperkey.sh
Last active Apr 7, 2019
A script to split long(e.g. 4096 bits) private keys into qr codes so you could print on a paper.
View paperkey.sh
#!/bin/sh
# Q&As
#
# Q: Why not use [paperkey][paperkey]?
# A: It brings much more complexity and dependencies, and I don't have time to check the implementation for security.
#
# Q: Why not OCR?
# A: I didn't find an open-source ocr software that works for normal photos.
# even though I used [OCR-A][OCR-A] for printing and [ScannerPro][ScannerPro] for image processing.
@tevino
tevino / sync-brightness
Last active Nov 7, 2018
Sync brightness between builtin and external monitor on a Mac
View sync-brightness
#!/bin/bash
set -e
DEPS="ioreg ggrep jq ddcctl"
EXTERNAL_DISPLAY_NO=${EXTERNAL_DISPLAY_NO:-1}
RATIO=${RATIO:-100} # 0-100
get-builtin-brightness() {
View shell-cheatsheet.sh
indent() { sed 's/^/ /'; }
confirm() {
msg=$1 || "Are you sure?"
msg="$msg (y/N)"
read -p "$msg" -n 1 -r
echo
[[ $REPLY =~ ^[Yy]$ ]]
}
View synology-feedback.md

需求

高级配置问题

现状

网上存在各类通过命令行编辑深藏在 NAS 文件系统深处的某配置文件而实现某些高级功能的方法,就连群晖官方的技术支持也会提供这种方案。

这种方式的问题

@tevino
tevino / pico8.txt
Created May 27, 2018 — forked from paniq/pico8.txt
PICO-8 hacks & secrets
View pico8.txt
Screen resolutions
------------------
PICO-8 supports different undocumented videomodes that can be activated at runtime,
using poke(0x5F2C, X) where X is one of the following mode numbers:
0: 128x128, 0 pages
1: 64x128, 1 page
2: 128x64, 1 page
3: 64x64, 3 pages
You can’t perform that action at this time.