This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Word to Link mapping</title> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script> | |
</head> | |
<body> | |
<table id="mapping"> | |
<tr> | |
<td>bangkok</td> | |
<td>http://wikipedia.org/wiki/Thailand</td> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$cities = array( | |
"Bangkok" => "กรุงเทพมหานคร", | |
"Krabi" => "กระบี่", | |
"Kanchanaburi" => "กาญจนบุรี", | |
"Kalasin" => "กาฬสินธุ์", | |
"Kamphaeng Phet" => "กำแพงเพชร", | |
"Khon Kaen" => "ขอนแก่น", | |
"Chanthaburi" => "จันทบุรี", | |
"Chachoengsao" => "ฉะเชิงเทรา", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html> | |
<html> | |
<head> | |
<title>Test :visited</title> | |
<style> | |
a:link { color: blue } | |
a:visited { color: red } | |
</style> | |
</head> | |
<body> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*! | |
* Copyleft (c) 2011 ${name}. | |
* Licensed under the ${license} license. | |
* | |
* @version ${Version} | |
*/ | |
var correctThaiFloatingVowel = function (text, anchor, el, options) { | |
/** | |
* @return string from character code provided. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
error_reporting(E_ALL ^ E_NOTICE); | |
define('EVENTTABLE', 'events'); | |
// Config | |
$dbconfig = array( | |
'host' => 'localhost', | |
'user' => 'root', | |
'pass' => 'qwer', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var request = require('request'), | |
twitter = require('twitter'), | |
mysql = require("mysql"); | |
var client = mysql.createClient({ | |
database: 'earthquake', | |
user: 'root' | |
}); | |
twit = new twitter({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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' | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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), |
OlderNewer