Skip to content

Instantly share code, notes, and snippets.

View noomz's full-sized avatar

Siriwat Uamngamsup noomz

View GitHub Profile
function state_set(state) {
var form = $('#panda-ajax-uploader');
var file = $('#panda-upload-file');
var button = $('#panda-upload-button');
var box = $('#panda-progress-box');
var bar = $('#panda-progress-bar');
var status = $('#panda-progress-status');
$('#panda-progress-box').removeClass();
switch (state) {
<?php
$cities = array(
"Bangkok" => "กรุงเทพมหานคร",
"Krabi" => "กระบี่",
"Kanchanaburi" => "กาญจนบุรี",
"Kalasin" => "กาฬสินธุ์",
"Kamphaeng Phet" => "กำแพงเพชร",
"Khon Kaen" => "ขอนแก่น",
"Chanthaburi" => "จันทบุรี",
"Chachoengsao" => "ฉะเชิงเทรา",
import csv
def clean_cells(row):
row_out = []
for cell in row:
cell = cell.strip().strip(' ').strip('-').strip()
if cell == '*': cell = ''
if cell == 'N/A': cell = ''
row_out.append(str(cell))
@noomz
noomz / gist:1094343
Created July 20, 2011 04:37
for natz
/*!
* Copyleft (c) 2011 ${name}.
* Licensed under the ${license} license.
*
* @version ${Version}
*/
var correctThaiFloatingVowel = function (text, anchor, el, options) {
/**
* @return string from character code provided.
@noomz
noomz / eventsfetch.php
Created October 22, 2011 17:17
thaiflood events fetch
<?php
error_reporting(E_ALL ^ E_NOTICE);
define('EVENTTABLE', 'events');
// Config
$dbconfig = array(
'host' => 'localhost',
'user' => 'root',
'pass' => 'qwer',
var request = require('request'),
twitter = require('twitter'),
mysql = require("mysql");
var client = mysql.createClient({
database: 'earthquake',
user: 'root'
});
twit = new twitter({
@noomz
noomz / pomodoro.rb
Created July 14, 2012 10:50 — forked from pcreux/pomodoro
Pomodoro timer for ubuntu unity
#!/usr/bin/env ruby
#
# Pomodoro script.
#
# Displays a notification after given minutes.
# Use pomodoro.rb with args 10 = 10 min, 10s = 10 seconds
#
# Don't forget to 'sudo apt-get install libnotify-bin'
#
@noomz
noomz / pyramid.js
Created November 26, 2012 10:57
Pyramid
// This require Node.js framework to complete the test case.
var pyramid = function (row, char, bg) {
if (row < 1) {
throw new Error("Row must be greater than 0.");
}
bg = bg || ' ';
var lastRowNumChar = calculateNumChar(row - 1),