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 (ev, obj) { | |
| var w = obj.offsetWidth, | |
| h = obj.offsetHeight, | |
| x = (ev.pageX - obj.offsetLeft - (w / 2) * (w > h ? (h / w) : 1)), | |
| y = (ev.pageY - obj.offsetTop - (h / 2) * (h > w ? (w / h) : 1)), | |
| d = Math.round( Math.atan2(y, x) / 1.57079633 + 5 ) % 4; | |
| return d; | |
| }; |
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 (!window.localStorage) { | |
| Object.defineProperty(window, "localStorage", new (function () { | |
| var aKeys = [], oStorage = {}; | |
| Object.defineProperty(oStorage, "getItem", { | |
| value: function (sKey) { return sKey ? this[sKey] : null; }, | |
| writable: false, | |
| configurable: false, | |
| enumerable: false | |
| }); | |
| Object.defineProperty(oStorage, "key", { |
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() { //去除字符串首尾空白 | |
| if (typeof String.trim == "undefined") { | |
| String.prototype.trim = function() { | |
| return this.replace(/(^\s*)|(\s*$)/g, "") | |
| } | |
| } | |
| if (!Function.bind) { | |
| Function.prototype.bind = function(obj) { | |
| var _func = this; | |
| console.log(_func); |
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
| $(document).bind("keydown", disableF5); | |
| function disableF5(e) { | |
| if ((e.which || e.keyCode) == 116) { | |
| if(confirm("Are you sure you want to continue? You will loose some of the filled information!")){ | |
| return true; | |
| } | |
| else{ | |
| e.preventDefault(); | |
| } |
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
| // ---------------------------------------------------------- | |
| // A short snippet for detecting versions of IE in JavaScript | |
| // without resorting to user-agent sniffing | |
| // ---------------------------------------------------------- | |
| // If you're not in IE (or IE version is less than 5) then: | |
| // ie === undefined | |
| // If you're in IE (>=5) then you can determine which version: | |
| // ie === 7; // IE7 | |
| // Thus, to detect IE: | |
| // if (ie) {} |
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 DeCasteljauBezier(points, density, step){ | |
| //if (points.length < 3) return null; | |
| console.time('bezier'); | |
| var ps = points.map(function(p){ | |
| return { | |
| x: p.x, | |
| y: p.y | |
| }; | |
| }), | |
| results = [], |
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
| $.datepicker.formatDate('yy-mm-dd', new Date()) |
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
| mvn archetype:create-from-project | |
| cd target/generated-sources/archetype/ | |
| mvn install | |
| mvn archetype:generate -DarchetypeCatalog=local | |
| <distributionManagement> | |
| <repository> | |
| <id>209-release</id> | |
| <name>209-release</name> | |
| <url>http://192.168.163.209/nexus/content/repositories/releases/</url> | |
| </repository> |
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
| JAVA_OPTS="-Xms512m -Xmx1024m -XX:PermSize=256M -XX:MaxPermSize=512M -Djava.awt.headless=true" |
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
| final Random r = new SecureRandom(); | |
| byte[] salt = new byte[32]; | |
| r.nextBytes(salt); | |
| String encodedSalt = Base64.encodeBase64String(salt); |