Skip to content

Instantly share code, notes, and snippets.

View amorist's full-sized avatar
🔞
Focusing

Amor amorist

🔞
Focusing
View GitHub Profile
export http_proxy="http://127.0.0.1:1080"
export https_proxy="http://127.0.0.1:1080"
docker run --name amor-nginx -d -p 80:80 nginx
@amorist
amorist / ConvertNumToCn.go
Last active April 26, 2018 11:24
ConvertNumToCn
package main
import (
"fmt"
"strconv"
)
func ConvertNumToCn(num int) string {
strnum := strconv.Itoa(num)
chineseDigits := []string{"", "一", "二", "三", "四", "五", "六", "七", "八", "九"}
@amorist
amorist / 提问的智慧.md
Created May 15, 2018 05:16 — forked from zer4tul/提问的智慧.md
Simplified Chinese edition of "How To Ask Questions The Smart Way"
@amorist
amorist / zsh.md
Created May 19, 2018 07:38 — forked from tsabat/zsh.md
Getting oh-my-zsh to work in Ubuntu
Option Explicit
Sub UnProtectAllDocFiles()
On Error Resume Next
Const strRootPath = "F:\doc" ' 存放文档的目录
Const strPassword = "0216" ' 密码
Dim oDoc As Document
@amorist
amorist / across.client.js
Created August 30, 2018 08:45 — forked from yueyuzhao/across.client.js
代理翻墙 (nodejs实现)
// 客户端实现
const net = require('net')
const tls = require('tls')
const localServer = new net.Server()
localServer.on('connection', (socket) => {
socket.pause()
const context = {
alias setproxy="export http_proxy=http://127.0.0.1:1080 && export https_proxy=http://127.0.0.1:1080 && curl -i http://ip.cn"
alias unsetproxy="unset http_proxy && unset https_proxy && curl -i http://ip.cn"
@amorist
amorist / MyClippings.txt
Last active October 19, 2018 05:16
My Clippings.txt
note_path='/Volumes/Kindle/documents/My Clippings.txt'
f=open(note_path,'r+')
digest_path='/Users/amor/Documents/'
while True:
onenote=[]
for i in range(0,5):
line=f.readline()
if not line:
exit()
onenote.append(line)
const getWindowPosition = () => {
const windowBounds = window.getBounds()
const trayBounds = tray.getBounds()
// Center window horizontally below the tray icon
const x = Math.round(trayBounds.x + (trayBounds.width / 2) - (windowBounds.width / 2))
// Position window 4 pixels vertically below the tray icon
const y = Math.round(trayBounds.y + trayBounds.height + 4)