Skip to content

Instantly share code, notes, and snippets.

View kuno's full-sized avatar

kuno kuno

View GitHub Profile
@kuno
kuno / gist:282db62d7784548bfa11
Created November 21, 2015 09:29 — forked from dodyg/gist:5823184
Kotlin Programming Language Cheat Sheet Part 1

#Intro

Kotlin is a new programming language for the JVM. It produces Java bytecode, supports Android and generates JavaScript. The latest version of the language is Kotlin M5.3

Kotlin project website is at kotlin.jetbrains.org.

All the codes here can be copied and run on Kotlin online editor.

Let's get started.

@kuno
kuno / deploy
Last active August 29, 2015 14:23
The mm-web deploy script that working for local development
#!/bin/bash
# Update nginx config
sed -e "s#MEDIA_ROOT#$MEDIA_ROOT#g" \
-e "s#STATIC_ROOT#$STATIC_ROOT#g" \
/etc/nginx/conf.d/default.conf.tpl > /etc/nginx/conf.d/default.conf
install_requirements() {
for requirement in requirement*
do
@kuno
kuno / data.json
Created April 16, 2015 05:03
data.json that removed incorrect values
{"indicators": {"SI.POV.URHC": {"source": "World Bank, Global Poverty Working Group. Data are based on World Bank's country poverty assessments and country Poverty Reduction Strategies.", "fullname": "Urban poverty headcount ratio at national poverty lines (% of urban population)", "shortname": "Urban poverty headcount ratio at national poverty lines", "id": "SI.POV.URHC", "description": "World Bank, Global Poverty Working Group. Data are compiled from official government sources or are computed by World Bank staff using national (i.e. country\u2013specific) poverty lines."}, "SI.POV.NAHC": {"source": "World Bank, Global Poverty Working Group. Data are based on World Bank's country poverty assessments and country Poverty Reduction Strategies.", "fullname": "Poverty headcount ratio at national poverty lines (% of population)", "shortname": "Poverty headcount ratio at national poverty lines", "id": "SI.POV.NAHC", "description": "World Bank, Global Poverty Working Group. Data are compiled from official governmen
@kuno
kuno / data.json
Created April 16, 2015 04:31
data.json with correct adminlevel2 code
{"indicators": {"SI.POV.URHC": {"source": "World Bank, Global Poverty Working Group. Data are based on World Bank's country poverty assessments and country Poverty Reduction Strategies.", "fullname": "Urban poverty headcount ratio at national poverty lines (% of urban population)", "shortname": "Urban poverty headcount ratio at national poverty lines", "id": "SI.POV.URHC", "description": "World Bank, Global Poverty Working Group. Data are compiled from official government sources or are computed by World Bank staff using national (i.e. country\u2013specific) poverty lines."}, "SI.POV.NAHC": {"source": "World Bank, Global Poverty Working Group. Data are based on World Bank's country poverty assessments and country Poverty Reduction Strategies.", "fullname": "Poverty headcount ratio at national poverty lines (% of population)", "shortname": "Poverty headcount ratio at national poverty lines", "id": "SI.POV.NAHC", "description": "World Bank, Global Poverty Working Group. Data are compiled from official governmen
@kuno
kuno / data.json
Created April 15, 2015 07:47
Example to show how store adminlevel2 poverty data in data.json
{"indicators": {"SI.POV.URHC": {"source": "World Bank, Global Poverty Working Group. Data are based on World Bank's country poverty assessments and country Poverty Reduction Strategies.", "fullname": "Urban poverty headcount ratio at national poverty lines (% of urban population)", "shortname": "Urban poverty headcount ratio at national poverty lines", "id": "SI.POV.URHC", "description": "World Bank, Global Poverty Working Group. Data are compiled from official government sources or are computed by World Bank staff using national (i.e. country\u2013specific) poverty lines."}, "SI.POV.NAHC": {"source": "World Bank, Global Poverty Working Group. Data are based on World Bank's country poverty assessments and country Poverty Reduction Strategies.", "fullname": "Poverty headcount ratio at national poverty lines (% of population)", "shortname": "Poverty headcount ratio at national poverty lines", "id": "SI.POV.NAHC", "description": "World Bank, Global Poverty Working Group. Data are compiled from official governmen
@kuno
kuno / index.html
Last active August 29, 2015 14:19
<!DOCTYPE html>
<meta charset="utf-8">
<body>
<div id="map"></div>
<script src="http://d3js.org/d3.v3.min.js"></script>
<script src="http://d3js.org/topojson.v1.min.js"></script>
<script src="http://api.tiles.mapbox.com/mapbox.js/v1.0.3/mapbox.js"></script>
<link href='http://api.tiles.mapbox.com/mapbox.js/v1.0.3/mapbox.css' rel='stylesheet' />
<style>
body { margin:0; padding:0; }
{"_id":"kuno","_rev":"25-320ebef31ff8f74f5220780873ecf5c4","github":{"id":161327,"name":"kuno","login":"kuno","email":"kuno@wiredcraft.com"},"avatar":"https://avatars.githubusercontent.com/u/161327?v=2","name":"kuno","email":"kuno@wiredcraft.com","$emails":[{"email":"kuno.the.developer@gmail.com","primary":true,"verified":true}],"$emails|updated":1411544216,"$prefs":{"onboarding_steps":[true,true,false],"onboarding":"done","wizard_progress":{"profile":-1}},"$stripe":{"plan":"devops_bootstrap","customerId":"cus_4pq1WeNWwR385c","subscriptionId":"sub_4pq16oKKrzeNSb","cancelled":true,"subscription":{"date":1411553775,"id":"in_4psZ79YQaoEatA","period_start":1411553775,"period_end":1411553775,"lines":{"object":"list","total_count":2,"has_more":false,"url":"/v1/invoices/in_4psZ79YQaoEatA/lines","data":[{"id":"ii_4psYRHZM1j6dKP","object":"line_item","type":"invoiceitem","livemode":false,"amount":-99638,"currency":"usd","proration":true,"period":{"start":1411553708,"end":1411553708},"quantity":1,"plan":{"interval":"mo
@kuno
kuno / data.json
Last active August 29, 2015 14:06
data.json that contains the poverty data, a draft version.
{"indicators": {"SN.SH.SVR.WAST.ZS": {"source": "Yet to receive metadata", "fullname": "Sub-National Prevalence of severe wasting, weight for height (% of children under 5)", "shortname": "Prevalence of severe wasting, weight for height", "id": "SN.SH.SVR.WAST.ZS", "description": "Yet to receive metadata"}, "SN.SH.STA.STNT.ZS": {"source": "World Health Organization, Global Database on Child Growth and Malnutrition. Country-level data are unadjusted data from national surveys, and thus may not be comparable across countries. Adjusted, comparable data are available at http://www.who.int/nutgrowthdb/en. Aggregation is based on UNICEF, WHO, and the World Bank harmonized dataset (adjusted, comparable data) and methodology.", "fullname": "Sub-National Malnutrition prevalence, height for age (% of children under 5)", "shortname": "Malnutrition prevalence, height for age", "id": "SN.SH.STA.STNT.ZS", "description": "Prevalence of child malnutrition is the percentage of children under age 5 whose height for age (stunti
@kuno
kuno / data.json
Created September 16, 2014 03:50
The new data.json including the poverty indicators that came from world bank api.
{"indicators": {"SN.SH.SVR.WAST.ZS": {"source": "Yet to receive metadata", "fullname": "Sub-National Prevalence of severe wasting, weight for height (% of children under 5)", "shortname": "Prevalence of severe wasting, weight for height", "id": "SN.SH.SVR.WAST.ZS", "description": "Yet to receive metadata"}, "SN.SH.STA.STNT.ZS": {"source": "World Health Organization, Global Database on Child Growth and Malnutrition. Country-level data are unadjusted data from national surveys, and thus may not be comparable across countries. Adjusted, comparable data are available at http://www.who.int/nutgrowthdb/en. Aggregation is based on UNICEF, WHO, and the World Bank harmonized dataset (adjusted, comparable data) and methodology.", "fullname": "Sub-National Malnutrition prevalence, height for age (% of children under 5)", "shortname": "Malnutrition prevalence, height for age", "id": "SN.SH.STA.STNT.ZS", "description": "Prevalence of child malnutrition is the percentage of children under age 5 whose height for age (stunti
@kuno
kuno / test.geojson
Created June 18, 2014 04:06
ADM0 of Afghanistan
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.