Skip to content

Instantly share code, notes, and snippets.

View puffsun's full-sized avatar

George Sun/孙魁 puffsun

View GitHub Profile
@puffsun
puffsun / wikijs-keycloak-config-guide.md
Created February 28, 2022 05:17 — forked from Sherex/wikijs-keycloak-config-guide.md
A guide for configuring Keycloak as a authentication provider in WikiJS | https://wiki.js.org | Feature request for adding this to the docs: https://requarks.canny.io/wiki/p/keycloak-auth-docs-proposal-for-a-guide-written
@puffsun
puffsun / npm.taobao.sh
Created January 4, 2021 01:08 — forked from lvxianchao/npm.taobao.sh
设置 npm 和 yarn 的镜像源为淘宝镜像源
# ==========================================================
# NPM
# ==========================================================
npm set registry https://r.npm.taobao.org # 注册模块镜像
npm set disturl https://npm.taobao.org/dist # node-gyp 编译依赖的 node 源码镜像
## 以下选择添加
npm set sass_binary_site https://npm.taobao.org/mirrors/node-sass # node-sass 二进制包镜像
npm set electron_mirror https://npm.taobao.org/mirrors/electron/ # electron 二进制包镜像
@puffsun
puffsun / books.md
Created December 18, 2020 09:58 — forked from abstractart/books.md
Free Programming Ebooks - O'Reilly Media. Codeship free ebooks here - https://bit.ly/2oQ0knQ
@puffsun
puffsun / urllib-request_basicAuth.py
Created October 30, 2020 08:54 — forked from kaito834/urllib-request_basicAuth.py
Python 3.x snippet code for Basic Authentication HTTP request by urllib.request
#!/usr/bin/env python
#
# I tested by Python 3.4.3 on Windows 8.1
# Python 3.4.3 (v3.4.3:9b73f1c3e601, Feb 24 2015, 22:43:06) [MSC v.1600 32 bit (Intel)] on win32
import urllib.request
import getpass
# If you access to url below via Proxy,
# set environment variable 'http_proxy' before execute this.
@puffsun
puffsun / Jenkinsfile
Created October 30, 2020 06:07 — forked from merikan/Jenkinsfile
Some Jenkinsfile examples
Some Jenkinsfile examples
@puffsun
puffsun / .gitlab-ci.yml
Created June 5, 2019 12:50 — forked from superjose/.gitlab-ci.yml
This is an example of a .gitlab-ci.yml that is required for Continuous Integration on GitLab projects.
# Reference: https://www.exclamationlabs.com/blog/continuous-deployment-to-npm-using-gitlab-ci/
# GitLab uses docker in the background, so we need to specify the
# image versions. This is useful because we're freely to use
# multiple node versions to work with it. They come from the docker
# repo.
# Uses NodeJS V 9.4.0
image: node:9.4.0
# And to cache them as well.
@puffsun
puffsun / avro_header.py
Created June 3, 2019 02:27 — forked from martindurant/avro_header.py
How to read an avro header easily
from __future__ import unicode_literals
import json
MAGIC = b'Obj\x01'
SYNC_SIZE = 16
def read_long(fo):
"""variable-length, zig-zag coding."""
c = fo.read(1)
@puffsun
puffsun / avro+ga4gh.md
Created May 23, 2019 08:42 — forked from meatcar/avro+ga4gh.md
These notes should help you undestand Avro, and give you an entrypoint to start understanding the ga4gh API.

What is Avro?

Parsing the ga4gh API requires you first to understand what is Avro.

Avro is a project that allows you to

  • formaly declare and define data structures (schemas in Avro) to be later used in different languages.
  • store data in a file
  • fetch data from a file
@puffsun
puffsun / .tmux.conf
Created December 19, 2015 15:22
My tmux.conf
# Our .tmux.conf file
# List of plugins
set -g @plugin 'tmux-plugins/tpm'
set -g @plugin 'tmux-plugins/tmux-sensible'
set -g @plugin 'nhdaly/tmux-scroll-copy-mode'
set -g @plugin 'tmux-plugins/tmux-urlview'
set -g @plugin 'tmux-plugins/tmux-copycat'
set -g @plugin 'tmux-plugins/tmux-resurrect'
set -g @plugin 'tmux-plugins/tmux-continuum'
#!/bin/sh
# Converts a mysqldump file into a Sqlite 3 compatible file. It also extracts the MySQL `KEY xxxxx` from the
# CREATE block and create them in separate commands _after_ all the INSERTs.
# Awk is choosen because it's fast and portable. You can use gawk, original awk or even the lightning fast mawk.
# The mysqldump file is traversed only once.
# Usage: $ ./mysql2sqlite mysqldump-opts db-name | sqlite3 database.sqlite
# Example: $ ./mysql2sqlite --no-data -u root -pMySecretPassWord myDbase | sqlite3 database.sqlite