Skip to content

Instantly share code, notes, and snippets.


Thai Pangsakulyanont dtinth

  • Taskworld; Labs
  • Krungthepmahanakhonamonrattanakosinmahintharayutthayamahadilokphopnoppharatratchathaniburiromudomratchaniwetmahasathanamonphimanawatansathitsakkathattiyawitsanukamprasit (Bangkok), Thailand
View GitHub Profile
View bms_sound_process.rb
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
puts "[#{index + 1}/#{file_list.length}] #{basename} (#{gain})"
system "sox", original_wav, target_wav, "gain", "#{gain}" or raise "Cannot convert"
dtinth / .gitignore
Last active Sep 26, 2019
Live coding 2019-09-25 — brute forcing AunJessada’s upcoming song title
dtinth /
Created Aug 13, 2019
Transcribing Thai YouTube video using Google Cloud

How to transcribe Thai speech in videos into text.


dtinth / cut.js
Created Jun 28, 2019
Thai word cut in Chrome
View cut.js
// Note: Using non-standard V8 feature
// The standard is now Intl.Segmenter but no browser implements it yet.
function cut(text) {
const iterator = new Intl.v8BreakIterator(["th"]);
const result = [];
let pos = iterator.first();
View index.ts
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'
export const bot = functions.https.onRequest((req, res) => {
const config = {
channelAccessToken: functions.config(),
channelSecret: functions.config()
View Hangman.ts
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(
View A.jsx
/* A */
export function Card (props) {
return (
<CardContainer centered={props.centered}>
const CardContainer = styled.article`
View flexlol.html
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
.layout {
display: flex;
View x.html
.x{display:inline-block;padding:20px;border-left:1px solid #ddd;font:bold 20px sans-serif}
<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>