Skip to content

Instantly share code, notes, and snippets.

View liuliqiang's full-sized avatar

Liqiang Lau liuliqiang

View GitHub Profile
@liuliqiang
liuliqiang / delta_only.js
Created July 17, 2023 12:50 — forked from derianpt/delta_only.js
activesg badminton booking scripts
// ==UserScript==
// @name activesg - single court for 2 hrs
// @namespace blah
// @version 0.6.5
// @description activesg court booking
// @match https://members.myactivesg.com/*
// @copyright 2017+, naresh,Gavin,Kent
// @require http://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js
// ==/UserScript==
@liuliqiang
liuliqiang / docker-compose.yaml
Created March 3, 2022 22:39
etcd docker compose
version: '2'
services:
etcd0:
image: quay.io/coreos/etcd
ports:
- 2379
volumes:
- etcd0:/etcd_data
command:
- /usr/local/bin/etcd
func openbrowser(url string) {
var err error
switch runtime.GOOS {
case "linux":
err = exec.Command("xdg-open", url).Start()
case "windows":
err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start()
case "darwin":
err = exec.Command("open", url).Start()
func openbrowser(url string) {
var err error
switch runtime.GOOS {
case "linux":
err = exec.Command("xdg-open", url).Start()
case "windows":
err = exec.Command("rundll32", "url.dll,FileProtocolHandler", url).Start()
case "darwin":
err = exec.Command("open", url).Start()
@liuliqiang
liuliqiang / main.go
Created July 10, 2020 16:26
四则运算表达式求值
package main
import (
"container/list"
"errors"
"fmt"
"strings"
)
var stackNumber list.List
@liuliqiang
liuliqiang / fuck.py
Created November 18, 2019 07:48
fuck you
# -*- coding: utf-8 -*-
from flask import Flask, jsonify
app = Flask(__name__)
# 跨域支持
def after_request(resp):
resp.headers['Access-Control-Allow-Origin'] = '*'
return resp
@liuliqiang
liuliqiang / config
Created July 30, 2019 06:34
privoxy
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 March 16, 2019 09:23 — forked from brenns10/.travis.yml
Travis Sphinx Auto-Doc
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 December 11, 2018 06:07 — forked from haisum/script.sh
comment and uncomment lines in bash script via sed
sed -i '/<pattern>/s/^/#/g' file #comment
sed -i '/<pattern>/s/^#//g' file #uncomment
@liuliqiang
liuliqiang / consul.service
Created October 8, 2018 02:22 — forked from yunano/consul.service
/etc/systemd/system/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