Skip to content

Instantly share code, notes, and snippets.

@clkao
clkao / discourse.patch
Created Dec 30, 2017
discourse sso auto
View discourse.patch
diff --git a/app/controllers/session_controller.rb b/app/controllers/session_controller.rb
index e96566f..f5f63be 100644
--- a/app/controllers/session_controller.rb
+++ b/app/controllers/session_controller.rb
@@ -9,7 +9,7 @@ class SessionController < ApplicationController
before_action :check_local_login_allowed, only: %i(create forgot_password)
skip_before_action :redirect_to_login_if_required
- skip_before_action :preload_json, :check_xhr, only: ['sso', 'sso_login', 'become', 'sso_provider', 'destroy']
+ skip_before_action :preload_json, :check_xhr, only: ['sso', 'sso_dry', 'sso_login', 'become', 'sso_provider', 'destroy']
View ftp2ndjson.js
var JSFtp = require('jsftp');
var ndjson = require('ndjson')
var path = require("path");
var async = require("async");
var URL = require('url');
var FTP_DIR_TYPE = 1;
var base = process.argv[2];//"ftp://ftp02.portlandoregon.gov/Parks"
if (!base) throw "must have ftp url"
@clkao
clkao / g0v-rainbow.svg
Created Nov 27, 2016
g0v-rainbow.svg
View g0v-rainbow.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@clkao
clkao / README.md
Last active Jan 18, 2016 — forked from nitaku/README.md
Custom hex projection
View README.md

An example of some random hexagons from an integer-coordinates hexagonal tiling, rendered with a custom projection that makes hexagons appear regular.

The technique is taken from this Mike Bostock's example, and it makes use of 3x2 hexagons like this one:

   -1 0 1   X
 2    *
 1  *   *
 0  * O *
-1    *
View gist:894b225566168dfb8b3e
Dear Sir or Madam,
It seems your web service is using the country list with the ISO3166-2 list.
It is advised to use country names in the GENC[1] standard (formly known as FIPS 10-4) to avoid controversy of Taiwan and to be able to include Kosovo.
[1] https://www.fgdc.gov/standards/news/GENC
@clkao
clkao / cec.lsc
Last active Aug 29, 2015
中選會回應產生器
View cec.lsc
#!/usr/bin/lsc
#
# Usage:
# % npm i -g LiveScript
# % lsc cec.ls 2
# (stdout)
# 中選會:分享「
# 分享「
# 分享「不能宣傳 2/14 罷免蔡正元」難判定有無違法,盡量不要分享「不能宣傳 2/14 罷免蔡正元」,以免觸法。
# 」難判定有無違法,盡量不要分享「
View gist:6ce01e75af21a00be8c9
### Keybase proof
I hereby claim:
* I am clkao on github.
* I am clkao (https://keybase.io/clkao) on keybase.
* I have a public key whose fingerprint is 8048 10B9 41A6 749E 8AE5 5187 1660 A7D4 0109 3F56
To claim this, I am signing this object:
@clkao
clkao / gist:8caab7465405ae3560f7
Created Oct 5, 2014
2009 縣市議員選舉政治獻金會計報告書 (廉政專刊第7,8期)
View gist:8caab7465405ae3560f7
98 年縣(市)議員選舉擬參選人
基隆市
丁玉玲
丁玉玲政治獻金收支結算表
98 年 10 月 16 日至 98 年 12 月 05 日
金額
收支科目 備註
(新台幣:元)
個人捐贈收入 0
營利事業捐贈收入 0
@clkao
clkao / gist:8731bfaa9b4fc86e0afd
Created Oct 5, 2014
2009 縣市長、鄉鎮市長選舉政治獻金會計報告書 (廉政專刊第6期)
View gist:8731bfaa9b4fc86e0afd
一、 98 年縣(市)長選舉擬參選人
基隆市
林右昌
林右昌政治獻金收支結算表
98 年 06 月 21 日至 99 年 01 月 04 日
金額
收支科目 備註
(新台幣:元)
"個人捐贈收入 2,715,900 "
"營利事業捐贈收入 60,000 "
@clkao
clkao / gist:e89bb1a635887f3ea2e3
Created Oct 5, 2014
2010 直轄市長、議員選舉政治獻金會計報告書 (廉 政 專 刊 第26期)
View gist:e89bb1a635887f3ea2e3
一、 99 年直轄市市長選舉擬參選人
臺北市
吳武明
吳武明政治獻金收支結算表
99 年 08 月 06 日至 99 年 11 月 26 日
金額
收支科目 備註
(新台幣〆元)
"個人捐贈收入 46,200 "
營利事業捐贈收入 0