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 / keyboard4_4.py
Last active May 11, 2022 08:51
Raspberry 4*4 keyboard code
# #####################################################
# Python Library for 4x4 matrix keypad using
# 7 of the avialable GPIO pins on the Raspberry Pi.
#
# This could easily be expanded to handle a 4x4 but I
# don't have one for testing. The KEYPAD constant
# would need to be updated. Also the setting/checking
# of the colVal part would need to be expanded to
# handle the extra column.
#
@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 / client.py
Last active January 10, 2020 03:15
celery-demo
#!/usr/bin/env python
# encoding: utf-8
from worker import add
# add.apply_async((1, ), priority=1)
# add.apply_async((1, ), priority=1)
add.apply_async((7, ), priority=7)
add.apply_async((6, ), priority=6)
add.apply_async((5, ), priority=5)
add.apply_async((8, ), priority=8)
@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: