Skip to content

Instantly share code, notes, and snippets.

View taichunmin's full-sized avatar

戴均民 taichunmin

View GitHub Profile
@taichunmin
taichunmin / messaging-api.html
Created September 6, 2019 06:35
LINE Messaging API reference 20190729 vs 20190906
<div class="Main Reference Reference-hasSide">
<div class="Content">
<div class="ReferenceCodesSide"></div>
<ul class="BreadCrumb">
<li><a href="/en/"><span>LINE Developers</span></a></li>
<li><a href="/en/reference/"><span>API references</span></a></li>
<li class="current">Messaging API reference</li>
</ul>
<div class="Article">
<section class="SectionReference SectionReference-hasSide">
@taichunmin
taichunmin / mp-contacts.user.js
Last active May 17, 2022 04:09
從微程式的 Portal 系統中下載通訊錄,需先安裝 Greasemonkey 或 Tampermonkey 才能執行! 下方連結是安裝網址。 https://gist.github.com/taichunmin/3e854e9e118785a7985ec24905ee16ce/raw/mp-contacts.user.js
// ==UserScript==
// @name 微程式通訊錄
// @namespace https://ef.program.com.tw:8443/contacts
// @version 0.24
// @description 從微程式的 Portal 系統中下載通訊錄
// @author taichunmin <taichunmin@gmail.com>
// @website https://gist.github.com/taichunmin/3e854e9e118785a7985ec24905ee16ce/
// @updateURL https://gist.github.com/taichunmin/3e854e9e118785a7985ec24905ee16ce/raw/contacts.user.js
// @downloadURL https://gist.github.com/taichunmin/3e854e9e118785a7985ec24905ee16ce/raw/contacts.user.js
// @match https://ef.program.com.tw:8443/*
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
/**
* Auto-generated code below aims at helping you parse

dont starve together cave

{
  "MINE_workable": {
    "rock1": 1,
    "rock2": 1,
    "rock_flintless": 1,
    "rock_petrified_tree": 1,
    "stalagmite": 1,
// 一般的寫法
new Promise(function(resolve, reject) {
setTimeout(function() {
// resolve()
reject(new Error('123'))
}, 1000)
}).then(function() {
console.log('success')
}).catch(function(e) {
console.error(e)
export default {
alpha_dash: (field) => `${field} 欄位只能填寫半形英文字母、數字、底線及剪號。`,
alpha_num: (field) => `${field} 欄位只能填寫半形英文字母及數字。`,
alpha: (field) => `The ${field} 欄位只能填寫半形英文字母。`,
between: (field, [min, max]) => `${field} 欄位必須介於 ${min} 和 ${max} 之間。`,
confirmed: (field, [confirmedField]) => `${field} 欄位必須與 ${confirmedField} 欄位相同。`,
decimal: (field, [decimals] = ['*']) => `${field} 欄位只能填寫${decimals === '*' ? '' : '小數點 ' + decimals + ' 位以內的'}小數。`,
digits: (field, [length]) => `${field} 欄位只能填寫剛好 ${length} 位數的數字。`,
dimensions: (field, [width, height]) => `${field} 欄位只能填寫 ${width} 像素乘以 ${height} 像素。`,
email: (field) => `${field} 欄位的電子郵件地址不正確。`,

用 Docker 來製作優雅的 MongoDB Seeder

本篇是原文 Delightful Database Seeding with Docker 的摘要

流程總共區分為三個階段:

  • 複製正式伺服器的資料並清理
  • 打包並發佈 Seeder
  • 使用 Seeder 匯入資料
@taichunmin
taichunmin / atom-packages.txt
Last active August 31, 2017 08:12
My Atom Installed Packages
aligner@1.2.4
aligner-css@1.2.1
aligner-javascript@1.3.0
aligner-php@1.1.1
atom-beautify@0.30.5
atom-format-lua@0.1.5
autocomplete-paths@2.8.1
busy-signal@1.4.3
docblockr@0.11.0
duplicate-line-or-selection@0.9.0
apt-get install build-essential libtool libusb-dev libusb-1.0 gcc make autoconf pkg-config libudev-dev flex pcsc-tools libpcsclite-dev
#download pcsc lite
wget https://alioth.debian.org/frs/download.php/file/4225/pcsc-lite-1.8.22.tar.bz2
tar xvf pcsc-lite*.tar.bz2
cd pcsc*
@taichunmin
taichunmin / mp-portal.user.js
Last active November 27, 2019 10:10
這是為了讓微程式的 Portal 系統支援 Chrome,需先安裝 Greasemonkey 或 Tampermonkey 才能執行! 下方連結是安裝網址。 https://gist.github.com/taichunmin/b480b8322b5cf0eadbfbc07f3dd2e485/raw/mp-portal.user.js
// ==UserScript==
// @name Microprogram Portal
// @namespace http://ef.program.com.tw:8081/
// @version 1.16
// @description try to let portal support Chrome
// @author taichunmin <taichunmin@gmail.com>
// @website https://gist.github.com/taichunmin/b480b8322b5cf0eadbfbc07f3dd2e485/
// @updateURL https://gist.github.com/taichunmin/b480b8322b5cf0eadbfbc07f3dd2e485/raw/mp-portal.user.js
// @downloadURL https://gist.github.com/taichunmin/b480b8322b5cf0eadbfbc07f3dd2e485/raw/mp-portal.user.js
// @match http://ef.program.com.tw:8081/*