Skip to content

Instantly share code, notes, and snippets.

Avatar

戴均民 taichunmin

View GitHub Profile
@taichunmin
taichunmin / dayjs-plugin.js
Last active Aug 13, 2021
瀏覽器書籤 JS 大補帖
View dayjs-plugin.js
(async function () {
const sleep = t => new Promise(resolve => { setTimeout(resolve, t) })
while (!window.jsSnippetsPromise) await sleep(100)
await window.jsSnippetsPromise
await sleep(1000)
const plugins = _.chain(_.keys(window))
.filter(k => _.startsWith(k, 'dayjs_plugin_'))
.value()
console.log(`found ${plugins.length} plugins of dayjs`)
for (const plugin of plugins) window.dayjs.extend(window[plugin])
@taichunmin
taichunmin / MsgAcademy00.png
Last active Aug 5, 2020
動物森友會卡片 ACNH MailDesign
@taichunmin
taichunmin / flex-dice-ga.txt
Last active Jun 17, 2020
能使用變數的 LINE 訊息推送小工具 (+Googla Analytics 追蹤)
View flex-dice-ga.txt
<% function gaScreenView (lineId, name) {
return `https://www.google-analytics.com/collect?${Qs.stringify({
an: 'My App',
cd: name, // 畫面名稱,
cid: lineId.replace(/^U(\w{8})(\w{4})(\w{4})(\w{4})(\w{12})$/, '$1-$2-$3-$4-$5'), // client id
ds: 'app', // 資料來源,填寫為 app
t: 'screenview',
tid: 'UA-xxxxxxxxx-1', // GA 追蹤代碼
uid: lineId, // LINE userId
ul: 'zh-tw', // locale
@taichunmin
taichunmin / flex-dice.json
Created Jun 13, 2020
能使用變數的 LINE 訊息推送小工具
View flex-dice.json
{
"type": "bubble",
"hero": {
"type": "image",
"url": "https://scdn.line-apps.com/n/channel_devcenter/img/fx/01_1_cafe.png",
"size": "full",
"aspectRatio": "20:13",
"aspectMode": "cover"
},
"body": {
View LICENSE
MIT License
Copyright (c) 2020 戴均民
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
View resume.json
{
"awards": [
{
"awarder": "LINE Corporation",
"date": "2020-08-19",
"summary": "LINE API Expert 是 LINE Corporation 定期針對積極參與相關活動(如:公開發表相關知識與資訊、在社交媒體或部落格中分享資訊、對 API/SDK 提供意見…等)的外部開發者,所授予的特殊榮譽。",
"title": "LINE API Expert"
},
{
"title": "2013 全國大專校院開放軟體創作競賽 銅牌",
@taichunmin
taichunmin / index.js
Last active Dec 10, 2019
Google Cloud Function for LINE pushMessage https://hackmd.io/@taichunmin/B1rUayhjr
View index.js
const axios = require('axios')
exports.helloWorld = async (req, res) => {
res.set('Access-Control-Allow-Origin', '*')
res.set('Access-Control-Allow-Credentials', 'true')
if (req.method === 'OPTIONS') {
// Send response to OPTIONS requests
res.set('Access-Control-Allow-Methods', 'POST, OPTIONS')
res.set('Access-Control-Allow-Headers', 'authorization,content-type')
View 爐石牌組代碼預覽.js
// ==UserScript==
// @name 爐石牌組代碼預覽
// @version 1.1.14.6
// @description 預覽文章中牌組代碼的牌組內容
// @author starfi5h(海星)
// @namespace https://home.gamer.com.tw/starfi5h
// @include https://forum.gamer.com.tw/C.php?*bsn=24044*
// @include https://forum.gamer.com.tw/G2.php?*bsn=24044*
// @match https://forum.gamer.com.tw/C.php?*bsn=60076*&snA=4483814*
// @include https://m.gamer.com.tw/forum/C.php?bsn=24044*
@taichunmin
taichunmin / messaging-api.html
Created Sep 6, 2019
LINE Messaging API reference 20190729 vs 20190906
View messaging-api.html
<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 Jul 16, 2018
從微程式的 Portal 系統中下載通訊錄,需先安裝 Greasemonkey 或 Tampermonkey 才能執行! 下方連結是安裝網址。 https://gist.github.com/taichunmin/3e854e9e118785a7985ec24905ee16ce/raw/mp-contacts.user.js
View mp-contacts.user.js
// ==UserScript==
// @name 微程式通訊錄
// @namespace http://ef.program.com.tw:8081/contacts
// @version 0.16
// @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 http://ef.program.com.tw:8081/*