Skip to content

Instantly share code, notes, and snippets.

View huanglong-zz's full-sized avatar
🎯
Focusing

Scott Dong huanglong-zz

🎯
Focusing
View GitHub Profile
public class MD5Util {
// 全局数组
private final static String[] strDigits = { "0", "1", "2", "3", "4", "5",
"6", "7", "8", "9", "a", "b", "c", "d", "e", "f" };
public MD5Util() {
}
// 返回形式为数字跟字符串
[].forEach.call(document.querySelectorAll("*"),function(a){a.style.outline="1px solid #"+(~~(Math.random()*(1<<24))).toString(16)})
http://devstreaming.apple.com/videos/wwdc/2014/403xxksrj0qs8c0/403/403_hd_intermediate_swift.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2014/403xxksrj0qs8c0/403/403_sd_intermediate_swift.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2014/403xxksrj0qs8c0/403/403_intermediate_swift.pdf?dl=1
http://devstreaming.apple.com/videos/wwdc/2014/419xxli6f60a6bs/419/419_hd_advanced_graphics_and_animation_performance.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2014/419xxli6f60a6bs/419/419_sd_advanced_graphics_and_animation_performance.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2014/419xxli6f60a6bs/419/419_advanced_graphics_and_animation_performance.pdf?dl=1
http://devstreaming.apple.com/videos/wwdc/2014/101xx36lr6smzjo/101/101_hd.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2014/101xx36lr6smzjo/101/101_sd.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2014/236xxwk3fv82sx2/236/236_hd_building_interruptible_and_responsive_interactions.mov?dl=1
http://devstreaming.apple.com/videos/wwdc/2
String.prototype.format = function() {
var formatted = this;
var arg = arguments[0];
var regexp = null;
var key = null;
if(arg === Object(arg) && arg instanceof Array !== true) {
for(key in arg) {
if(arg.hasOwnProperty(key)) {
regexp = new RegExp('\\{{' + key + '\\}}', 'gi');
formatted = formatted.replace(regexp, arg[key]);
// 判断各种浏览器,找到正确的方法
function launchFullscreen(element) {
if(element.requestFullscreen) {
element.requestFullscreen();
} else if(element.mozRequestFullScreen) {
element.mozRequestFullScreen();
} else if(element.webkitRequestFullscreen) {
element.webkitRequestFullscreen();
} else if(element.msRequestFullscreen) {
element.msRequestFullscreen();
(function(angular) {
angular.module('analytics', ['ng']).service('analytics', [
'$rootScope', '$window', '$location', function($rootScope, $window, $location) {
var track = function() {
$window._gaq.push(['_trackPageview', $location.path()]);
};
$rootScope.$on('$viewContentLoaded', track);
}
]);
// drop indexes
db.accounts.dropIndex( { "tax-id": 1 } )
db.collection.dropIndexes()
KISSY.use("dom, node, event, ajax, promise", function(S, DOM, Node, Event, IO, Promise) {
function setGamesNumber(deferred) {
var dataFetch = new IO({
dataType: 'jsonp',
url: 'http://display.taobao.com/common/addSignIn.htm?app=duli&sequency=1&signType=1',
jsonp: 'callback',
jsonpCallback: "handleResponse"
})
# Sometimes, you just have to shutdown and reboot your linode. Then all the services running on your linode should be booted again:
1. Shundown/reboot linode
2. Stop the httpd service by default: service httpd stop
3. Repair your mongodb for some reasons:
a. Find out and kill all the process:
ps -ef | grep mongo*
ps -ef | grep mongod
kill -9 pid
#If it doesn't work, then you can pkill -9 mongod once for all.
1. Session err for req.logIn
a. Make sure you pass user to logIn:
req.logIn(user, function(err) {
if (err) return next(err)
mail.sendActiveMail(user.email, user.token, user.username)
return res.json({
success: 1
})
})