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
// 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
SetEnvIf Request_URI "^.*/([^/]*)$" FILENAME=$1 | |
Header set "Content-disposition" "attachment; filename=%{FILENAME}e" | |
UnsetEnv FILENAME |
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
as=document.getElementsByTagName('a');for(i in as){if(as[i] && as[i].href && as[i].href.match(/tua\.sarocha$/)){as[i].remove();}} |
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>x</title> | |
<link rel="stylesheet" type="text/css" href="main.css"> | |
<script type="text/javascript" src="http://code.jquery.com/jquery-1.10.2.min.js"></script> | |
<script type="text/javascript" src="main.js"></script> | |
</head> | |
<body> | |
<div id="x"> |
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
set shiftwidth=2 | |
set tabstop=2 | |
set expandtab | |
set nu | |
set ai | |
set smartindent | |
map! <F2> <C-x><C-p> | |
if has("autocmd") | |
" Drupal *.module and *.install files. |
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
# Install apache2 via tasksel | |
sudo tasksel install lamp-server | |
# Add user | |
adduser noomz | |
# Add user to admin (sudo-able) group | |
usermod -a -G adm,sudo,www-data noomz | |
# Logout from root and login as user we have just created |
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
<VirtualHost *:80> | |
ServerName noomz.in.th | |
DocumentRoot /var/www/noomz.in.th/html/ | |
<Directory /var/www/noomz.in.th/html/> | |
Options -Indexes FollowSymLinks MultiViews | |
AllowOverride All | |
Order allow,deny | |
allow from all | |
</Directory> |
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
# reg-exp | |
import re | |
# use pyserial | |
import serial | |
from time import sleep | |
def checkOK(): | |
isOK = False | |
lines = ser.readlines() | |
for line in lines: |
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
// async | |
var async = require('async'); | |
async.parallel([ | |
function(callback) { | |
Check.find({ status: 1 }).exec(callback); | |
}, | |
function(callback) { | |
Check.find({ status: 2 }).exec(callback); | |
} |