Skip to content

Instantly share code, notes, and snippets.

View lookis's full-sized avatar

Jingsi lookis

  • 快手
  • BeiJing
  • 09:18 (UTC +08:00)
View GitHub Profile
@lookis
lookis / gist:d1771d8816018305b70fde3591638ba8
Last active September 8, 2023 06:47
snowflake in postgresql
CREATE SEQUENCE IF NOT EXISTS public.global_id_sequence;
CREATE OR REPLACE FUNCTION id_generator()
RETURNS bigint
LANGUAGE 'plpgsql'
AS $BODY$
DECLARE
epoch BIGINT := 1688745600000;
seq_id BIGINT;
now_millis BIGINT;
@lookis
lookis / maven_settings.xml
Last active December 13, 2022 08:03
在线使用,通过 shlink 跳过来
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<mirrors>
<mirror>
<id>aliyun-public</id>
<mirrorOf>*</mirrorOf>
<name>aliyun public</name>
<url>https://maven.aliyun.com/repository/public</url>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<mirrors>
<mirror>
<id>aliyun-public</id>
<mirrorOf>*</mirrorOf>
<name>aliyun public</name>
<url>https://maven.aliyun.com/repository/public</url>
@lookis
lookis / install.sh
Last active December 13, 2022 08:02
在线使用,通过 shlink 跳过来
#!/bin/sh
set -e
is_wsl() {
case "$(uname -r)" in
*microsoft* ) true ;; # WSL 2
*Microsoft* ) true ;; # WSL 1
* ) false;;
esac
}
stages:
- build
- deploy
build:
stage: build
script:
- |
export CI_APPLICATION_REPOSITORY=${CI_APPLICATION_REPOSITORY:-$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG}
export CI_APPLICATION_TAG=${CI_APPLICATION_TAG:-$CI_COMMIT_SHA}
# Best Shadowrocket Rules (https://github.com/h2y/Shadowrocket-ADBlock-Rules)
# by Moshel
# build time: 2021-03-29 02:33:16
[General]
bypass-system = true
skip-proxy = 192.168.0.0/16, 10.0.0.0/8, 172.16.0.0/12, localhost, *.local, e.crashlytics.com, captive.apple.com
bypass-tun = 10.0.0.0/8,100.64.0.0/10,127.0.0.0/8,169.254.0.0/16,172.16.0.0/12,192.0.0.0/24,192.0.2.0/24,192.88.99.0/24,192.168.0.0/16,198.18.0.0/15,198.51.100.0/24,203.0.113.0/24,224.0.0.0/4,255.255.255.255/32
dns-server = system, 114.114.114.114, 112.124.47.27, 8.8.8.8, 8.8.4.4
[Rule]
@lookis
lookis / gist:87bbd6e8d55a016a0e5436f4ebaa2815
Last active March 27, 2021 04:13
安装 zipline 1.4.1
参考 dockerfile 的安装:
使用 python 3.5.10 (需要补丁)
brew install openssl bzip2 readline
安装 python
CFLAGS="-I$(brew --prefix openssl)/include -I$(brew --prefix bzip2)/include -I$(brew --prefix readline)/include -I$(xcrun --show-sdk-path)/usr/include" LDFLAGS="-L$(brew --prefix openssl)/lib -L$(brew --prefix readline)/lib -L$(brew --prefix zlib)/lib -L$(brew --prefix bzip2)/lib"
pyenv install --patch 3.x.x < <(curl -sSL https://github.com/python/cpython/commit/8ea6353.patch\?full_index\=1)
安装zipline所需库依赖
@lookis
lookis / pypy3-fix
Last active March 1, 2020 07:05
fix tk 8.6 in pypy3
/usr/local/Cellar/pypy3/7.3.0/libexec/lib_pypy/_tkinter
mv tklib_cffi.pypy36-pp73-darwin.so tklib_cffi.pypy36-pp73-darwin.so.bak
cp ~/Downloads/pypy3.6-v7.3.0-osx64/lib_pypy/_tkinter/tklib_cffi.pypy36-pp73-darwin.so .
@lookis
lookis / setup.md
Created January 17, 2018 09:52 — forked from novemberborn/setup.md
OS X Redirect ports 80 and 443 to 8080 and 8443 respectively

Changes with .dev domains in mind.

Create /etc/pf.anchors/dev, containing:

rdr pass inet proto tcp from any to any port 80 -> 127.0.0.1 port 8080
rdr pass inet proto tcp from any to any port 443 -> 127.0.0.1 port 8443

@lookis
lookis / gist:c198ccde7b8741c19d3e4c749cc4bee0
Created November 29, 2017 06:24
Remo Omni Sync Server Directory
echo -n "To remove your OmniPresence data, please enter your Omni Sync Server account name: "; read OSSACCOUNT; curl -v --request DELETE --location-trusted --digest --user "$OSSACCOUNT" "https://sync.omnigroup.com/$OSSACCOUNT/usage"