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 java.security.MessageDigest; | |
| import java.security.NoSuchAlgorithmException; | |
| public class Md5encoder | |
| { | |
| public static void main(String a[]) | |
| { | |
| String result = MD5("Hello,world!"); | |
| System.out.println(result); |
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
| function myrefresh(){ | |
| window.location.reload(); | |
| } | |
| setTimeout('myrefresh()',10000); |
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
| <![if !IE]> | |
| <script> | |
| /* | |
| * by moli | |
| */ | |
| // 用法:拷贝到对应网页底部。 | |
| $(document).ready(function(){ | |
| if(document.cookie.indexOf("lu=") == -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
| // 用法:将一下代码保存到收藏夹。在任意网页点击该收藏夹都可以high一把。 | |
| javascript: (function() { | |
| function c() { | |
| var e = document.createElement("link"); | |
| e.setAttribute("type", "text/css"); | |
| e.setAttribute("rel", "stylesheet"); | |
| e.setAttribute("href", f); | |
| e.setAttribute("class", l); | |
| document.body.appendChild(e) |
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
| //对象按照key排序 | |
| function ksort(obj) { | |
| var newkey = Object.keys(obj).sort(); | |
| var newObj = {}; | |
| for (var i = 0; i < newkey.length; i++) { | |
| newObj[newkey[i]] = obj[newkey[i]]; | |
| } | |
| return newObj; | |
| } |
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
| // \s 小写的s是,匹配任何空白字符,包括空格、制表符、换页符等等。等价于 [ \f\n\r\t\v]。 | |
| strings.replace(/(^\s*)|(\s*$)/g, "") |
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
| // https://github.com/niklasvh/html2canvas | |
| // <script src="html2canvas.min.js"></script> | |
| html2canvas(document.body, { | |
| allowTaint: true, | |
| taintTest: false, | |
| onrendered: function(canvas) { // canvas 是包含截图内容的canvas元素 | |
| document.body.appendChild(canvas); // 将截图显示出来看看效果 | |
| var dataUrl = canvas.toDataURL(); // 将canvas转换成base64编码的字符串 | |
| console.log(dataUrl); // 字符串可以通过ajax传递到后台保存了 |
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
| require 'base64' | |
| str = 'hello' | |
| result = Base64.encode64 str |
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
| require 'digest/md5' | |
| str = 'hello' | |
| md5 = Digest::MD5.hexdigest str |