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 / canvasrenderer.py
Created February 19, 2010 15:09
Canvas Renderer
#!/usr/bin/env python
import sys
import json
import base64
try:
import WebKit
view = WebKit.WebView.alloc().init()
wso = view.windowScriptObject()
#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>
int main() {
int num, i, j, current, *data;
FILE* fp = fopen("input.txt", "r");
num = 0;
while (fscanf(fp, "%d", &current) == 1) {
num ++;
}
data = (int*)malloc(num * sizeof(int));
<?php
$task = $argv[1];
$num = intval($argv[2]);
$code = escapeshellarg($argv[3]);
@unlink ('/tmp/ao');
$cc = 'gcc';
`$cc -lm $code -o /tmp/ao`;
<?php
function processPage($pdf, $page) {
$pdf->addPage ();
processSection ($pdf, $page['left'], 0);
processSection ($pdf, $page['right'], 147.5);
}
foreach (preparePapers(41) as $paper) {
processPage ($pdf, $paper['back']);
// find links to convert
if (strstr($msg, 'http://'))
{
$links = array();
foreach (explode(' ', $msg) as $w)
Array
(
[0] => Array
(
[index] => 1
[name] => BATT
[level] => Futurist
)
[1] => Array
#!/usr/bin/env python
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from subprocess import Popen
from random import choice
port = 60506
key = ''
for i in range(6):
key += choice('123456789')
print ':' + str(port) + '/' + key
<?php
$q = $_SERVER['QUERY_STRING'];
$o = array();
if (preg_match_all('~longUrl=([^&]+)~', $q, $m)) {
foreach ($m[1] as $v) {
$url = urldecode($v);
if (substr($url, 0, 14) != 'http://lnw.me/' && !isset($o[$url])) {
$o[$url] = array(
'shortUrl' => file_get_contents('http://lnw.me/s/short.php?url='
function load() {
var prefix = 'http://tw.dt.in.th/thaiWitter/';
if (window.location.href.substr(0, prefix.length) == prefix) {
// do some required work here
}
var mediator = Components.classes["@mozilla.org/appshell/window-mediator;1"]
.getService(Components.interfaces.nsIWindowMediator);
var windows = mediator.getEnumerator(null);