Skip to content

Instantly share code, notes, and snippets.

View kristw's full-sized avatar

Krist Wongsuphasawat kristw

View GitHub Profile
@kristw
kristw / .block
Last active April 27, 2024 07:28
Bangkok Metropolitan map
license: mit
#!/bin/bash
func install_yamlfmt {
# Check the machine architecture
arch=$(uname -m)
# Set the URL based on the machine architecture
if [[ $arch == "x86_64" ]]; then
url="https://github.com/google/yamlfmt/releases/download/v0.10.0/yamlfmt_0.10.0_Linux_x86_64.tar.gz"
elif [[ $arch == "arm64" ]]; then
@kristw
kristw / index.html
Last active September 14, 2023 13:16
Thailand map
<!DOCTYPE html>
<meta charset="utf-8">
<style>
@import url(http://fonts.googleapis.com/css?family=Open+Sans+Condensed:300|Josefin+Slab|Arvo|Lato|Vollkorn|Abril+Fatface|Old+Standard+TT|Droid+Sans|Lobster|Inconsolata|Montserrat|Playfair+Display|Karla|Alegreya|Libre+Baskerville|Merriweather|Lora|Archivo+Narrow|Neuton|Signika|Questrial|Fjalla+One|Bitter|Varela+Round);
.background {
fill: #eee;
pointer-events: all;
}
@kristw
kristw / dropboxSublime.sh
Last active October 24, 2022 11:11
Sync Sublime Text 3 settings
# If you are working in multiple computers, you might want to keep and apply the same Settings for SublimeText across these computers.
# We can set this up with the help of Dropbox (and a small tweak).
# Credit: http://www.hongkiat.com/blog/sublime-text-tips/
# First, run the following command in Terminal.
DROPBOX_PATH=$HOME/Dropbox/settings/sublime-text-3/
mkdir -p $DROPBOX_PATH
mv "$HOME/Library/Application Support/Sublime Text 3/Packages" "$DROPBOX_PATH"
mv "$HOME/Library/Application Support/Sublime Text 3/Installed Packages" "$DROPBOX_PATH"
@kristw
kristw / .babelrc
Created October 16, 2016 21:26
Configure rollup with lodash
{
"presets": ["es2015"]
}
@kristw
kristw / example-nivo.jsx
Last active September 10, 2020 19:41
blog example: nivo
import { Calendar } from '@nivo/calendar';
<Calendar
data={[
{ "day": "2016-02-05", "value": 397 },
{ "day": "2015-09-17", "value": 283 },
]}
from="2015-04-01"
to="2016-12-12"
emptyColor="#eeeeee"
@kristw
kristw / example-g2.js
Last active September 10, 2020 19:38
import { Chart } from '@antv/g2';
const data = [
{country: "China", population: 131744},
{country: "India", population: 104970},
{country: "US", population: 29034},
];
const chart = new Chart({ container: 'container', autoFit: true, height: 500 });
chart.data(data);
@kristw
kristw / example-vega-lite.json
Last active September 10, 2020 19:35
blog example: vega-lite
{
"$schema": "https://vega.github.io/schema/vega-lite/v4.json",
"description": "A simple bar chart with embedded data.",
"data": {
"values": [
{"country": "China", "population": 131744},
{"country": "India", "population": 104970},
{"country": "US", "population": 29034}
]
},
@kristw
kristw / example-p5js.js
Last active September 10, 2020 19:31
blog example: p5.js
import p5 from 'p5';
const p = new p5(function(sketch) {
sketch.setup = () => {
sketch.createCanvas(200, 200);
};
sketch.draw = () => {
sketch.background(0);
sketch.fill(255);
sketch.rect(100, 100, 50, 50);
const myRadarChart = new Chart(ctx, {
type: 'radar',
data: data,
options: options
});