Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

liang wang hite

🎯
Focusing
View GitHub Profile
@hite
hite / gist:3261201
Created Aug 5, 2012 — forked from qiukun/gist:3000173
send mail to tumblr by coffeescript and nodemailer
View gist:3261201
nodemailer = require "nodemailer"
smtpTransport = nodemailer.createTransport "SMTP",
service: "Gmail"
auth:
user:
pass:
mail =
from: ""
@hite
hite / chinese word regexp
Created Mar 15, 2012
javascript验证中文的正则表达式
View chinese word regexp
var reg = /^[u4E00-u9FA5]+$/;
@hite
hite / give me the url per line
Created May 30, 2011
extract a url from a string per line
@hite
hite / decodeURI VS. decodeURIComponent.js
Created Apr 11, 2011
decodeURI() VS. decodeURIComponent()
View decodeURI VS. decodeURIComponent.js
var origin = "&callback=%3Chead%3E%3Cscript%3Ewindow.onload%3Dfunction()%7Bvar%20mailhost%3Dlocation.search.match(%2Fmailhost%3D.%2B(com%7Cnet)%26maildomain%2F)%5B0%5D.split('%3D')%5B1%5D.replace('%26maildomain'%2C'')%3Blocation.href%3D'http%3A%2F%2F'%2Bmailhost%2B'%2Fjy3%2Foptions%2Fforaddrclone.jsp'%2Blocation.search%2B'%26code%3D'%2Bdocument.body.innerHTML%3B%7D%3C%2Fscript%3E%3Chead%3E&rnd=";
//A. decodeURI(origin) = ---------------------------------------------------
var result1 = "&callback=<head><script>window.onload%3Dfunction(){var mailhost%3Dlocation.search.match(%2Fmailhost%3D.%2B(com|net)%26maildomain%2F)[0].split('%3D')[1].replace('%26maildomain'%2C'')%3Blocation.href%3D'http%3A%2F%2F'%2Bmailhost%2B'%2Fjy3%2Foptions%2Fforaddrclone.jsp'%2Blocation.search%2B'%26code%3D'%2Bdocument.body.innerHTML%3B}<%2Fscript><head>&rnd=";
//B. decodeURIComponent(origin) = ---------------------------------------------------
var result2 = "&callback=<head><script>window.onload=function(){var mailhost=location.s
View scrolling_menu.js
//animate function
var from = -627,to = 0,step = 100,duration = 50;
var flag = -1;
var timer = setInterval(function(){
if(to>from){
flag = 1;
}
from= from+flag*10;
if(flag*from>to){