ocftw.kktix.cc
一起來聽聽「開放政府」在台灣的推動狀況、國內外的案例,也聊聊原住民族委員會和其他政府部會目前的承諾事項,以及我們可以如何透過「開放政府」降低門檻,更全面而有效地進入公部門參與政策擬定吧!
Medium
Upload a file in GitHub using GitHub APIs
Sometimes, It is hectic to upload files manually into the GitHub repository. You can just upload the files using GitHub APIs…
<https://github.com/g0v/editor/blob/develop/src/utils/github.js | github.js>
``` class Github { constructor(connection, owner, repo) { this.connection = connection; this.owner = owner; this.repo = repo; return this; } getReference(ref) { return this.connection.get(`/repos/${this.owner}/${this.repo}/git/refs/heads/${ref}`); } getCommit(refs) { this.commit = this.connection.get(refs.object.url); return this.commit; } getTree(commit) { return this.connection.get(commit.tree.url); } createBlob(content) { return <http://this.connection.post|this.connection.post>(`/repos/${this.owner}/${this.repo}/git/blobs`, { data: JSON.stringify({ content: content, encoding: 'utf-8' }), }); } createTree(base_tree) { return <http://this.connection.post|this.connection.post>(`/repos/${this.owner}/${this.repo}/git/trees`, { data: JSON.stringify({ base_tree: base_tree.sha, tree: [{ path: this.filename, mode: '100644', type: 'blob', sha: this.blob.sha }], }), }); } createCommit(tree) { return <http://this.connection.post|this.connection.post>(`/repos/${this.owner}/${this.repo}/git/commits`, { data: JSON.stringify({ message: `update ${this.filename}`, tree: tree.sha, parents: [this.commit.sha], }), }); } createReference(commit) { this.branch = `update-${this.filename}-${Date.now()}`; const data = { sha: commit.sha, ref: `refs/heads/${this.branch}`, }; return <http://this.connection.post|this.connection.post>(`/repos/${this.owner}/${this.repo}/git/refs`, { data: JSON.stringify(data), }); } createPullRequest(ref) { const data = { title: `update ${this.filename}`, body: 'this is a pull request from g0v editor', head: `${this.owner}:${this.branch}`, base: 'master', }; return <http://this.connection.post|this.connection.post>(`/repos/${this.author}/${this.repo}/pulls`, { data: JSON.stringify(data), }); } createFork() { return new Promise((resolve, reject) => { return <http://this.connection.post|this.connection.post>(`/repos/${this.author}/${this.repo}/forks`) .done(resolve).fail(reject); }); } } export default Github; ```
The all-batteries-included GitHub SDK for Browsers, Node.js, and Deno.
<https://github.com/miaoski/amis-moedict-editor/blob/main/amis-editor.js | amis-editor.js>
``` // moedict amis safulo only if(location.href.split('/')[3].slice(0, 2) == '#:') { var c = document.querySelectorAll('nav')[0].innerHTML; c = c.replace( '<a href="http://ckhis.ck.tp.edu.tw/~ljm/amis-mp/" target="_blank" title="「阿美語萌典」校對活動">', '<a href="#" title="編輯本條目" onClick="editme(location.href);">').replace( '幫校對', '編輯本條目'); document.querySelectorAll('nav')[0].innerHTML = c; } else { // Not Safulo dict. Ignore it. } function editme(href) { var lexicon = href.split('/')[3].slice(2); alert('我還沒寫好! 要修改的是: ' + lexicon); } ```
那來玩玩看好了,Discord <https://discord.gg/p879WtrW7P|https://discord.gg/p879WtrW7P>
amis.moedict.tw
提供 Android 及 iOS 離線 App。來源為台灣聖經公會、方敏英神父、潘世光神父、博利亞神父、蔡中涵博士。辭典本文的著作權仍為各該著作人所有。
addons.mozilla.org
moedict-amis-editor – :fox_face: Firefox (ja) 向け拡張機能を入手
Firefox 向け moedict-amis-editor をダウンロード。[en] An online editor of Moedict Amis. It updates Github Pages via Github API calls. [zh-TW] 阿美語萌典的線上編輯器,修改的內容會上傳到 Github Pages 上。
<https://github.com/miaoski/amis-safolu/blob/master/txt/ch-amis.rb | ch-amis.rb>
``` # 目的:將 Google sheet 的漢字阿美語詞幹對應,轉成 json,提升 <http://amis.moedict.tw|amis.moedict.tw> 上漢阿搜尋的精確度 # 運行方式: # 請先到 <https://goo.gl/LHnG1B,匯出成> csv # 將檔案更名為 amis-ch-mapping-sheet.csv,並放到專案的 tmp/ # 在終端機下執行命令 $ ruby txt/ch-amis.rb # 結果:執行命令後,會輸出/更新結果在 txt/amis-ch-mapping.json ```