Skip to content

Instantly share code, notes, and snippets.

View dtinth's full-sized avatar
🎶
𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪

Thai Pangsakulyanont dtinth

🎶
𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪𒐪
  • @bemusic                 @creatorsgarten                 @eventpop                 @showdownspace                 @spacetme                @wonderfulsoftware                
  • Krungthepmahanakhonamonrattanakosinmahintharayutthayamahadilokphopnoppharatratchathaniburiromudomratchaniwetmahasathanamonphimanawatansathitsakkathattiyawitsanukamprasit (Bangkok), Thailand
  • YouTube @dtinth
View GitHub Profile
@dtinth
dtinth / .gitignore
Last active September 26, 2019 17:09
Live coding 2019-09-25 — brute forcing AunJessada’s upcoming song title
dataset
file_list = Dir['original/*.wav']
file_list.each_with_index do |original_wav, index|
basename = File.basename(original_wav)
target_wav = "processed/#{basename}"
gain = case basename
when /^piano/; 4
else; 0
end
puts "[#{index + 1}/#{file_list.length}] #{basename} (#{gain})"
system "sox", original_wav, target_wav, "gain", "#{gain}" or raise "Cannot convert"
import * as Immutable from 'immutable'
import * as rxjs from 'rxjs'
import { scan, startWith, map } from 'rxjs/operators'
export function reactiveHangman(
secretWord: string,
letters: rxjs.Observable<string>
): rxjs.Observable<Output> {
const initialState = initialize(secretWord)
return letters.pipe(
@dtinth
dtinth / cut.js
Created June 28, 2019 07:54
Thai word cut in Chrome
// Note: Using non-standard V8 feature
// https://code.google.com/archive/p/v8-i18n/wikis/BreakIterator.wiki
//
// The standard is now Intl.Segmenter but no browser implements it yet.
//
function cut(text) {
const iterator = new Intl.v8BreakIterator(["th"]);
iterator.adoptText(text);
const result = [];
let pos = iterator.first();
@dtinth
dtinth / thai.php
Created November 26, 2010 14:59
Utility function to fix floating tone marks when outputting as PDF.
<?php
function thai($x) {
$back = array(
"\xE0\xB9\x88" => "\xEF\x9C\x85",
"\xE0\xB9\x89" => "\xEF\x9C\x86",
"\xE0\xB9\x8A" => "\xEF\x9C\x87",
"\xE0\xB9\x8B" => "\xEF\x9C\x88",
"\xE0\xB9\x8C" => "\xEF\x9C\x89"
);
import * as functions from 'firebase-functions'
import * as admin from 'firebase-admin'
import 'firebase-functions'
import express from 'express'
import { middleware, Client } from '@line/bot-sdk'
admin.initializeApp()
export const bot = functions.https.onRequest((req, res) => {
const config = {
channelAccessToken: functions.config().line.channel.accesstoken,
channelSecret: functions.config().line.channel.secret
@dtinth
dtinth / Lecture.md
Last active May 28, 2018 06:34
ISO 29110 Lecture

ISO 29910 Lecture

This lecture note is taken from Workgroup Software Development Process course...

PDCA Cycle

  • Plan, do, check, act.
/* A */
export function Card (props) {
return (
<CardContainer centered={props.centered}>
<CardTitle>{props.title}</CardTitle>
<CardContent>{props.children}</CardContent>
</CardContainer>
)
}
const CardContainer = styled.article`
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
.layout {
display: flex;
<style>
.x{display:inline-block;padding:20px;border-left:1px solid #ddd;font:bold 20px sans-serif}
</style>
<div>
<span class=x style="border:0">[LOGO]</span>
<span class=x>SEE & DO</span>
<span class=x>FESTIVAL & EVENTS</span>
<span class=x>EAT & DRINK</span>
<span class=x>SHOP</span>
<span class=x>STAY</span>