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 / README.md
Created October 29, 2014 15:18
iPhoto Location Export

iPhotoLocation

Exports the locations of photos in a photo album as JSON data...

osascript -l JavaScript iPhotoLocation.js "NAIST Internship"
@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 / README.md
Last active May 11, 2024 02:21
Batch File Rename Script

Batch File Rename

Use JavaScript for Automation to rename files in batch!

Motivation

@dtinth
dtinth / README.md
Created August 13, 2019 12:59
Transcribing Thai YouTube video using Google Cloud

How to transcribe Thai speech in videos into text.

Requirements

# https://www.youtube.com/watch?v=vz1oG-YlvAY
# https://www.reddit.com/r/adventofcode/comments/zu3pat/2022_day_24_part_2_terminal_visualization/?utm_source=share&utm_medium=web2x&context=3
require 'paint'
lines = $stdin.readlines.map(&:chomp)
directions = {
'^' => [0, -1],
'v' => [0, 1],
'<' => [-1, 0],
'>' => [1, 0]
@dtinth
dtinth / stagesetter.ts
Created November 4, 2022 11:06
stagesetter.ts
const customInspectSymbol = Symbol.for('nodejs.util.inspect.custom')
export type Input<T> = T | Output<T>
export interface Output<T> {
resolveWithContext(ctx: Context): Promise<T>
}
class OutputImpl<T> implements Output<T> {
private promise?: Promise<T>
@dtinth
dtinth / gen-regex.js
Created November 9, 2011 09:19
Regex เมพ
require('https').get({
host: 'raw.github.com',
path: '/twitter/twitter-text-js/master/twitter-text.js'
}, function(res) {
var buf = '';
res.setEncoding('utf-8');
res.on('data', function(d) { buf += d });
res.on('end', function() { gen(buf); });
});
#include <stdio.h>
#include <stdlib.h>
#define NUM_VERTEX 10
struct Vertex {
char name;
int mark;
struct Node* list;
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
int iCurNumChannels;
int vecChannelOrder[100];
unsigned int vecChannels[100];
#define INVALID_CHANNEL_ID 101
void InitChannel(int iNewChanID, unsigned int InetAddr)