Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Liqiang Lau liuliqiang

🎯
Focusing
View GitHub Profile
@liuliqiang
liuliqiang / main.go
Created Jul 10, 2020
四则运算表达式求值
View main.go
package main
import (
"container/list"
"errors"
"fmt"
"strings"
)
var stackNumber list.List
View fuck.py
# -*- coding: utf-8 -*-
from flask import Flask, jsonify
app = Flask(__name__)
# 跨域支持
def after_request(resp):
resp.headers['Access-Control-Allow-Origin'] = '*'
return resp
View config
confdir /etc/privoxy
actionsfile match-all.action # Actions that are applied to all sites and maybe overruled later on.
actionsfile default.action # Main actions file
actionsfile user.action # User customizations
filterfile default.filter
filterfile user.filter # User customizations
logfile logfile
listen-address 127.0.0.1:8118
enable-remote-toggle 0
@liuliqiang
liuliqiang / .travis.yml
Created Mar 16, 2019 — forked from brenns10/.travis.yml
Travis Sphinx Auto-Doc
View .travis.yml
language: python
python:
- 3.5
install:
- pip install sphinx sphinx_rtd_theme
script: make html
after_success:
- ./push.sh
env:
global:
@liuliqiang
liuliqiang / script.sh
Created Dec 11, 2018 — forked from haisum/script.sh
comment and uncomment lines in bash script via sed
View script.sh
sed -i '/<pattern>/s/^/#/g' file #comment
sed -i '/<pattern>/s/^#//g' file #uncomment
@liuliqiang
liuliqiang / consul.service
Created Oct 8, 2018 — forked from yunano/consul.service
/etc/systemd/system/consul.service
View consul.service
[Unit]
Description=consul agent
Requires=network-online.target
After=network-online.target
[Service]
EnvironmentFile=-/etc/sysconfig/consul
Environment=GOMAXPROCS=2
Restart=on-failure
ExecStart=/usr/local/sbin/consul agent $OPTIONS -config-dir=/etc/consul.d
View XMLHTTPRequest
<html>
<!-- created by https://liqiang.io -->
<head>
<script type="text/javascript">function loadXMLDoc() {
// code for IE7+, Firefox, Chrome, Opera, Safari
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
console.log(xmlhttp.responseText);
}
View XMLHTTPRequest
<html>
<!-- created by https://liqiang.io -->
<head>
<script type="text/javascript">function loadXMLDoc() {
// code for IE7+, Firefox, Chrome, Opera, Safari
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
console.log(xmlhttp.responseText);
}
@liuliqiang
liuliqiang / defer顺序
Last active Aug 15, 2018
Go 语言中的异常处理
View defer顺序
package main
import "fmt"
func main() {
defer func() {
fmt.Println("stack a")
}()
defer func() {
fmt.Println("stack b")
View tmux-cheatsheet.markdown

Tmux 快捷键 & 速查表

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

tmux at [-t 会话名]
You can’t perform that action at this time.