This file contains 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
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() { | |
} | |
// 返回形式为数字跟字符串 |
This file contains 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
[].forEach.call(document.querySelectorAll("*"),function(a){a.style.outline="1px solid #"+(~~(Math.random()*(1<<24))).toString(16)}) |
This file contains 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
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 |
This file contains 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
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]); |
This file contains 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 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(); |
This file contains 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(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); | |
} | |
]); |
This file contains 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
// drop indexes | |
db.accounts.dropIndex( { "tax-id": 1 } ) | |
db.collection.dropIndexes() |
This file contains 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
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" | |
}) |
This file contains 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
# 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. |
This file contains 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
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 | |
}) | |
}) |
NewerOlder