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
// undeclared function you need to declare:
// cb(data): fired when new data from the stream is available.
// data is the updated line. use JSON.parse to parse data.
// hungup(): fired when the user stream is disconnected.
// this function needs to handle it. maybe retry or display error.
// undeclared variables you need to declare.
// url: user stream's url endpoint.
var xh = new XMLHttpRequest();
(function() {
var factor = 0.25;
var _Date = Date;
var _setTimeout = setTimeout;
var _setInterval = setInterval;
var start = new _Date().getTime();
Date = function(a,b,c,d,e,f,g) {
if (arguments.length == 0) {
We couldn’t find that file to show.
<?php
define ('CONSUMER_KEY', '__________');
define ('CONSUMER_SECRET', '__________');
define ('ACCESS_TOKEN', '__________');
define ('ACCESS_TOKEN_SECRET', '__________');
@dtinth
dtinth / main.c
Created October 17, 2010 14:17
Task: Sort the input _without_ using any kind of loops. No do, while, for allowed.
/*
LANG: C
TASK: oct14_sort
*/
#include <stdio.h>
#include <stdlib.h>
int canwn;
int ladab_khxng_canwn[1000];
void rabkha(int cak, int thung) {
if (cak >= thung) return;
@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"
);
>>> from pizza import pizza
>>> print ''.join([ '- ' + crust['name'] + '\n' for crust in pizza.pizza.getAllCrustType('EN') ])
- Thirty Bites Pizza(Promotion)
- Thirty Bites Pizza
- Pan Pizza
- Thin Crispy
- Cheesy Max
- Extreme Pizza
- Extra Cheesy Sausage Bites
- X-Pan
@dtinth
dtinth / thaiWitter-fullscreen.css
Created December 19, 2010 15:14
Fullscreen mod!
/* FULL SCREEN MODE MOD!
replace 1280 and 800 with your screen size and do not zoom.
use F11 to go to full screen mode.
use ctrl+alt+c to edit custom CSS.
hidden/experimental feature. use at your own risk. */
@media (min-width: 1280px) and (min-height: 800px) {
#head {
padding-bottom: 5px;
font-size: 16pt;
@dtinth
dtinth / testbass.py
Created December 29, 2010 16:56
Using BASS from Python.
from ctypes import *
bass = cdll.LoadLibrary('./libbass.so')
# init bass
bass.BASS_Init(-1, 44100, 0, 0, None)
# load sample
file = '/path/to/wav/file.wav'
sample = bass.BASS_SampleLoad(False, file, c_longlong(0), 0, 2, 0x20000)
fs = require 'fs'
sys = require 'sys'
(-> # force global scope
input =
if process.argv[2]
try
fs.readFileSync process.argv[2], 'utf-8'
catch e