Skip to content

Instantly share code, notes, and snippets.

View stilllisisi's full-sized avatar
🎯
Focusing

stilllisisi

🎯
Focusing
View GitHub Profile
@stilllisisi
stilllisisi / README.md
Created February 28, 2020 03:52 — forked from eliquious/README.md
Golang OpenPGP examples

Building

go build -o goencrypt main.go

Generating Keys

@stilllisisi
stilllisisi / postgres_array.go
Created February 28, 2020 02:53 — forked from adharris/postgres_array.go
PostgreSQL demo of Array types using Golang
package main
import (
"database/sql"
"errors"
"fmt"
_ "github.com/bmizerany/pq"
"os"
"regexp"
"strings"
@stilllisisi
stilllisisi / 文件按行读取.go
Last active March 13, 2020 09:57 — forked from ma6174/文件按行读取.go
【GO-文件/目录处理】文件按行读取
f, err := os.Open("a.txt")
defer f.Close()
if nil == err {
buff := bufio.NewReader(f)
for {
line, err := buff.ReadString('\n')
if err != nil || io.EOF == err{
break
}
fmt.Println(line)
@stilllisisi
stilllisisi / gist:9409eda29e3a1828c2e8627b7b0501fa
Last active February 18, 2020 03:11 — forked from Quasimo/gist:1139189
【python-字符串/正则表达式】新手常用代码片段
# via: http://www.oschina.net/code/snippet_16840_1568
1.生成随机数
import random #这个是注释,引入模块
rnd = random.randint(1,500)#生成1-500之间的随机数
2.读文件
f = open("c:\\1.txt","r")
lines = f.readlines()#读取全部内容
@stilllisisi
stilllisisi / callee.js
Last active February 18, 2020 03:12 — forked from dreamsky/callee.js
【JavaScript-列表/字典处理】优秀的 JavaScript 代码片段集合
//JavaScript callee 用法示例
function factorial(num) {
if (num <= 1) {
return 1;
} else {
return num * arguments.callee(num - 1);
}
}
@stilllisisi
stilllisisi / exception.py
Last active February 18, 2020 03:14 — forked from banjin/优秀代码集合...
【python-异常处理】忽略异常的处理
忽略抛出的异常:
常用的写法:
try:
os.remove('somefile.tmp')
except OSError:
pass