Skip to content

Instantly share code, notes, and snippets.

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 / index.html
Last active January 29, 2018 17:21 — forked from kunalb/index.html
<html>
<head>
<title>Cyclic Sankeys</title>
<style type="text/css">
#chart {
height: 500px;
}
.node rect {
cursor: move;
@clkao
clkao / discourse.patch
Created December 30, 2017 07:32
discourse sso auto
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']
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 November 27, 2016 15:30
g0v-rainbow.svg
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 January 18, 2016 17:41 — forked from nitaku/README.md
Custom hex projection

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 *
jwt = new googleapis.auth.JWT do
SERVICE_ACCOUNT_EMAIL
KEYFILE_PEM
null
['https://www.googleapis.com/auth/analytics.readonly']
err, client <- googleapis.discover 'analytics', 'v3' .execute
err, result <- jwt.authorize
console.log result
@clkao
clkao / gist:7432906
Last active December 28, 2015 03:09
行政院及所屬各級機關
政府資料開放使用授權規範條款
The Terms of Use of Open Government Data
for the Executive Yuan and Other Government Agencies Under Its Supervision
目的
為便利民眾共享及應用政府資料,促進政府資料加值應用,結合民間創意提升政府資料價值,活化政府資料應用,優化政府服務品質。
Purpose
The purpose of the Terms of Use of Open Government Data (hereinafter referred to as the “Terms of Use”) is to facilitate the general public to have access to and make use of Open Government Data, which in turn inspires creativity of the private sector, creates more value on the Open Government Data and enhances the quality of services of the public sector.
@clkao
clkao / README.md
Last active December 22, 2015 09:28 — forked from mbostock/.block

This simple force-directed graph shows character co-occurence in Les Misérables. A physical simulation of charged particles and springs places related characters in closer proximity, while unrelated characters are farther apart. Layout algorithm inspired by Tim Dwyer and Thomas Jakobsen. Data based on character coappearence in Victor Hugo's Les Misérables, compiled by Donald Knuth.

19:06 < DaPonte> hi folk
19:46 <@clkao> howdy!
19:46 <@DaPonte> hi folk
19:46 <@entropy_> hi
19:47 <@entropy_> afk
19:47 <@clkao> back in 10 ;)
19:59 <@entropy_> FYI the pirate feedback developer cmrcx is on holidays
20:00 <@clkao> ah ok ;)
20:00 <@entropy_> and I'm afraid I'll have to leave soon
20:01 <@clkao> *nod* we shall keep logs