Skip to content

Instantly share code, notes, and snippets.

View rapee's full-sized avatar
🥢
Coding with chopsticks

Rapee Suveeranont rapee

🥢
Coding with chopsticks
  • Boonmee Lab
  • Bangkok, Thailand
View GitHub Profile
@rapee
rapee / 2-category-by-id.json
Last active December 11, 2020 08:24
Sample data for ELECT's constitution website
{
"id": 10,
"name": "อำนาจนิติบัญญัติ",
"color": "#cc9900",
"content": "อำนาจนิติบัญญัติหรืออำนาจของรัฐสภา อันประกอบด้วยสภาผู้แทนราษฎร และวุฒิสภา �มีหน้าที่หลักในการตรา แก้ไข ตรวจสอบ หรือยกเลิกกฎหมาย รวมถึงการแก้ไขรัฐธรรมนูญ ทั้งยังมีอำนาจในการควบคุมการบริหารราชการแผ่นดินของฝ่ายบริหาร และพิจารณาให้ความเห็นชอบเรื่องสำคัญ ๆ ที่มีผลกระทบต่อประชาชน",
"subcategories": [
{
"id": 1028,
"name": "สมาชิกสภาผู้แทนราษฎร",
@rapee
rapee / json2csv.sh
Created August 29, 2019 06:50
JSON to CSV
# Use pure jq
# Assumes input JSON is array of objects:
# [ { a: 1, b: 1, ...} , { a: 2, b:2, ... }, ... ]
jq -r '.[] | to_entries | [.[].value] | @csv' 20190829_ippd_survey1_results.json > 20190829_ippd_survey1_results.csv
@rapee
rapee / points-100.json
Last active September 22, 2019 16:28
Points for TR-Stopcrying
[
{
"id": 1,
"count": 100,
"year": "2547 - 2550",
"province": "ปัตตานี",
"gender": "ชาย",
"orphan": "กำพร้าพ่อ"
},
{
@rapee
rapee / tile.stamen.js
Created October 14, 2017 10:35
Leaflet Tile Stamen
(function(exports) {
/*
* tile.stamen.js v1.3.0
*/
var SUBDOMAINS = "a. b. c. d.".split(" "),
MAKE_PROVIDER = function(layer, type, minZoom, maxZoom) {
return {
"url": ["http://{S}tile.stamen.com/", layer, "/{Z}/{X}/{Y}.", type].join(""),
@rapee
rapee / gold.csv
Last active October 7, 2017 06:46
Practical Data Visualization
name gold
Thailand 35
Thailand 21
Thailand 38
Thailand 77
Thailand 32
Thailand 44
Thailand 47
Thailand 80
Thailand 37
@rapee
rapee / latest.json
Last active August 4, 2017 14:30
Get latest maps from Bus Portrait
{
"data": [
"https://s3-ap-southeast-1.amazonaws.com/bml-may/59847c5f1ad7e8ea3cade190.png",
"https://s3-ap-southeast-1.amazonaws.com/bml-may/59846229a5ff7ae041b8640f.png",
"https://s3-ap-southeast-1.amazonaws.com/bml-may/59846200a5ff7ae041b8640e.png",
"https://s3-ap-southeast-1.amazonaws.com/bml-may/59845f4ff05408df5208bfcf.png",
"https://s3-ap-southeast-1.amazonaws.com/bml-may/59845f32f05408df5208bfce.png",
"https://s3-ap-southeast-1.amazonaws.com/bml-may/59845f0e04940edf4771b8c3.png",
"https://s3-ap-southeast-1.amazonaws.com/bml-may/59845e48cbba0fde6190e35e.png",
"https://s3-ap-southeast-1.amazonaws.com/bml-may/59845e34cbba0fde6190e35d.png",
@rapee
rapee / README.md
Created July 27, 2017 09:24 — forked from puripant/README.md
States I have visited

I lived in New York (in dark green) and have visited the green states. One rule: passing by or layover doesn't count; I have spent at least one night in these states. Major cities that I have visited are also shown as small bubbles.

Forked from

@rapee
rapee / 0_reuse_code.js
Created March 12, 2017 15:54
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@rapee
rapee / Preferences.sublime-settings
Created October 13, 2016 03:21
Settings For Sublime Text 3
{
"bold_folder_labels": true,
"find_selected_text": true,
"font_size": 14,
"highlight_modified_tabs": true,
"ignored_packages":
[
"Vintage"
],
"indent_guide_options":
@rapee
rapee / cityglide_api_doc.md
Last active October 24, 2016 07:46
CityGlide API Hack Manual