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
// Browse to yammer company's home page, then click inbox (mail) link, | |
// after that run this script in javascript console | |
var clearYammer = function (interval) { | |
jQuery('.yj-inbox-list-item').eq(0).trigger('click'); | |
setTimeout(function () { | |
history.back(); | |
clearYammer(interval); | |
}, interval); |
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
SimpleBroadcast = (function () { | |
var sub = {}; | |
return { | |
publish: function (topic, data) { | |
data = data || {}; | |
(sub[topic] || []).forEach(function (func) { | |
func(data); | |
}); |
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), |
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
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
<?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
/*! | |
* 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
<!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
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
<?php | |
$cities = array( | |
"Bangkok" => "กรุงเทพมหานคร", | |
"Krabi" => "กระบี่", | |
"Kanchanaburi" => "กาญจนบุรี", | |
"Kalasin" => "กาฬสินธุ์", | |
"Kamphaeng Phet" => "กำแพงเพชร", | |
"Khon Kaen" => "ขอนแก่น", | |
"Chanthaburi" => "จันทบุรี", | |
"Chachoengsao" => "ฉะเชิงเทรา", |