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 serialize(form, hashmode) { | |
| if (!form || form.nodeName !== "FORM") { | |
| return | |
| } | |
| var i, j, q = []; | |
| var hashmap = {}; | |
| for (i = form.elements.length - 1; i >= 0; i = i - 1) { | |
| if (form.elements[i].name === "") { | |
| continue | |
| } |
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 changepic(obj) { | |
| //console.log(obj.files[0]);//这里可以获取上传文件的name | |
| var newsrc = getObjectURL(obj.files[0]); | |
| document.getElementById('show').src = newsrc; | |
| } | |
| //建立一個可存取到該file的url | |
| function getObjectURL(file) { | |
| var url = null; | |
| // 下面函数执行的效果是一样的,只是需要针对不同的浏览器执行不同的 js 函数而已 | |
| if (window.createObjectURL != undefined) { // basic |
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
| # Using interactive mode, like `yarn upgrade-interactive` | |
| npx npm-check -u |
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
| var threedTheme = document.createElement('style') | |
| threedTheme.innerHTML = "* {text-overflow: clip;letter-spacing: 3px;text-shadow: -3px 0 1px cyan, 3px 0 1px red;}" | |
| document.head.append(threedTheme) |
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 isSafeParentDomain(url, safeDomains) { | |
| try { | |
| // Using polyfill for String.prototype.endsWith | |
| if (!String.prototype.endsWith) { | |
| String.prototype.endsWith = function(search, this_len) { | |
| if (this_len === undefined || this_len > this.length) { | |
| this_len = this.length; | |
| } | |
| return this.substring(this_len - search.length, this_len) === search; | |
| }; |
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
| package main | |
| import ( | |
| "fmt" | |
| "runtime" | |
| "time" | |
| ) | |
| func main() { | |
| ticker := time.NewTicker(200 * time.Millisecond) |
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
| package main | |
| import ( | |
| "fmt" | |
| "sync" | |
| "time" | |
| ) | |
| const concurrency = 3 |
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 ( | |
| "crypto/tls" | |
| "encoding/base64" | |
| "fmt" | |
| "log" | |
| "net" | |
| "net/smtp" | |
| "strings" | |
| ) |
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
| ## Office E5 mail | |
| relayhost = [smtp.office365.com]:587 | |
| smtp_sasl_auth_enable = yes | |
| smtp_sasl_security_options = noanonymous | |
| smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd | |
| smtp_sender_dependent_authentication = yes | |
| smtp_generic_maps = hash:/etc/postfix/generic | |
| # STARTTLS in my case, this can solve SSL handshake error. | |
| smtp_tls_security_level = may | |
| # If your network cannot access IPv6. |
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
| <style> | |
| /* | |
| CSS for the main interaction | |
| */ | |
| .tabset > input[type="radio"] { | |
| position: absolute; | |
| left: -200vw; | |
| } | |
| .tabset .tab-panel { |