Skip to content

Instantly share code, notes, and snippets.

View johnteee's full-sized avatar

John Lee johnteee

  • Taipei
View GitHub Profile
@ayaka14732
ayaka14732 / 廣韻反切音韻地位表(測試版).csv
Created May 21, 2021 01:32
《廣韻》(澤存堂本)反切音韻地位表(測試版)
小韻號 小韻首字 上字 下字 被切字音韻描述們 上字音韻描述們 下字音韻描述們
1 端一東平 端開登入 匣一東平
2 定一東平 定模平 匣一東平
3 知三東平 知開蒸入 見三東平
4 澄三東平 澄開蒸入 見三東平
5 章三東平 章開蒸入 日三東平
6 徹三東平 徹開蒸入 知三東平
7 崇三東平 崇魚平 見三東平
8 心三東平 心開蒸入 見三東平
9 日三東平 日魚平 以三東平
@jalbam
jalbam / requestAnimationFrame-polyfill.js
Last active January 4, 2025 00:18
window.requestAnimationFrame polyfill (with high resolution timing, very precise)
'use strict';
// requestAnimationFrame polyfill by Erik Möller.
// Fixes from Paul Irish, Tino Zijdel, Andrew Mao, Klemen Slavic, Darius Bacon and Joan Alba Maldonado.
// Adapted from https://gist.github.com/paulirish/1579671 which derived from
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// Added high resolution timing. This window.performance.now() polyfill can be used: https://gist.github.com/jalbam/cc805ac3cfe14004ecdf323159ecf40e
// MIT license
// Gist: https://gist.github.com/jalbam/5fe05443270fa6d8136238ec72accbc0
@zulhfreelancer
zulhfreelancer / README.md
Created May 15, 2019 04:46
S3 Website + CloudFront - how to show index.html content when at /sub-directory/ path?

Problem

We have index.html file in S3 bucket under a folder called /about-us/. When checking in browser using CloudFront distribution link, custom-domain.com/about-us/ shows AccessDenied error.

But, custom-domain.com/about-us/index.html works fine and show content.

What we want

We want custom-domain.com/about-us/ to show the index.html content.

@jschaf
jschaf / scratch_server.go
Created March 12, 2019 07:40
A Go web server from scratch using syscalls
package main
// Simple, single-threaded server using system calls instead of the net library.
//
// Omitted features from the go net package:
//
// - TLS
// - Most error checking
// - Only supports bodies that close, no persistent or chunked connections
// - Redirects
@zapkub
zapkub / aws-ecr-credential.go
Last active March 7, 2024 07:52
how to get AWS credential from ECR with golang
/*
* Copyright (c) 2019. Inception Asia
* Maintain by DigithunWorldwide ❤
* Maintainer
* - [email protected]
* - [email protected]
*/
package util
@cc32d9
cc32d9 / nodeos_full_node_setup.txt
Last active August 2, 2023 13:21
nodeos installation with ZFS
apt-get update && apt-get install -y aptitude git lxc-utils zfsutils-linux netfilter-persistent sysstat
# find the partition ID that is linked to the storage serial number.
# This will prevent from losing the partition if disk mapping changes
ls -l /dev/disk/by-id/ | grep sda6
zpool create -f zdata /dev/disk/by-id/wwn-0x600507604092b628236df4851535cef5-part6
## Fixate internal IP address of the container
systemctl stop lxc-net
sed -i -e 's,^.*LXC_DHCP_CONFILE,LXC_DHCP_CONFILE,' /etc/default/lxc-net
@koorukuroo
koorukuroo / mcolors_list.py
Created October 2, 2018 07:29
Matplotlib Color List
mcolors = ['b', 'g', 'r', 'c', 'm', 'y', 'k', 'w', 'aliceblue', 'antiquewhite', 'aqua', 'aquamarine', 'azure', 'beige', 'bisque', 'black', 'blanchedalmond', 'blue', 'blueviolet', 'brown', 'burlywood', 'cadetblue', 'chartreuse', 'chocolate', 'coral', 'cornflowerblue', 'cornsilk', 'crimson', 'cyan', 'darkblue', 'darkcyan', 'darkgoldenrod', 'darkgray', 'darkgreen', 'darkgrey', 'darkkhaki', 'darkmagenta', 'darkolivegreen', 'darkorange', 'darkorchid', 'darkred', 'darksalmon', 'darkseagreen', 'darkslateblue', 'darkslategray', 'darkslategrey', 'darkturquoise', 'darkviolet', 'deeppink', 'deepskyblue', 'dimgray', 'dimgrey', 'dodgerblue', 'firebrick', 'floralwhite', 'forestgreen', 'fuchsia', 'gainsboro', 'ghostwhite', 'gold', 'goldenrod', 'gray', 'green', 'greenyellow', 'grey', 'honeydew', 'hotpink', 'indianred', 'indigo', 'ivory', 'khaki', 'lavender', 'lavenderblush', 'lawngreen', 'lemonchiffon', 'lightblue', 'lightcoral', 'lightcyan', 'lightgoldenrodyellow', 'lightgray', 'lightgreen', 'lightgrey', 'lightpink', 'light
@FreeMasen
FreeMasen / Cargo.toml
Last active September 25, 2018 05:04
getpid
[package]
name = "getpid"
version = "0.1.0"
[dependencies]
walkdir = "1"
docopt = "2"
@Godofbrowser
Godofbrowser / axios.refresh_token.1.js
Last active November 18, 2024 04:31 — forked from culttm/axios.refresh_token.js
Axios interceptor for refresh token when you have multiple parallel requests. Demo implementation: https://github.com/Godofbrowser/axios-refresh-multiple-request
// for multiple requests
let isRefreshing = false;
let failedQueue = [];
const processQueue = (error, token = null) => {
failedQueue.forEach(prom => {
if (error) {
prom.reject(error);
} else {
prom.resolve(token);
@dallasjohnson
dallasjohnson / sampletokenSpec.rb
Last active December 10, 2018 03:39
Unit Test for EOS.IO contracts using rspec
require 'rspec_command'
require "json"
# 1. A recent version of Ruby is required
# 2. Ensure the required gems are installed with `gem install rspec json rspec-command`
# 3. Run this from the command line with rspec sampletokenSpec.rb
# Optionally output the test results with -f [p|d|h] for required views of the test results.
# For debugging I added a clear action to the contract which clears everything in the tables