#+HTML: <details><summary>Click me</summary>
- item1
- item2
#+HTML: </details>
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
| // ----------------------------------------------------------------------------- | |
| // Surfingkeys 功能设定 | |
| // ----------------------------------------------------------------------------- | |
| // 标签页数量超过七个时通过搜索跳转 | |
| settings.tabsThreshold = 0 | |
| // Visual 模式下拷贝文本后回到 Normal 模式 | |
| settings.modeAfterYank = "Normal" | |
| // 数字按键作为普通按键使用 | |
| settings.digitForRepeat = false |
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
| fn main() { | |
| let mut incr = make_counter(0, 2); | |
| for _ in 1..10 { | |
| println!("{}", incr()); | |
| } | |
| } | |
| fn make_counter(mut base: i32, step: i32) -> Box<dyn FnMut() -> i32> { | |
| return Box::new(move || { |
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 sync; | |
| public class Once { | |
| private boolean done; | |
| public void run(Runnable runnable) { | |
| if (!done) { | |
| slowRun(runnable); | |
| } | |
| } |
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 dsn implementation a simple dsn parser | |
| // | |
| // Example: | |
| // | |
| // func main() { | |
| // var uri = MakeDsn("uri", "[scheme://]host[:port]path[?query][#fragment]", map[string]string{ | |
| // "scheme": `\w+`, | |
| // "host": `[\w.]+`, | |
| // "port": `\d+`, | |
| // "path": `[\w/.]+`, |
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
| (defun get-org-title (fn) | |
| (let ((note-buffer (or (find-buffer-visiting fn) | |
| (find-file-noselect fn)))) | |
| (with-current-buffer note-buffer | |
| (let ((element (org-element-at-point))) | |
| (if (and (eq (org-element-type element) 'keyword) | |
| (string= (org-element-property :key element) "TITLE")) | |
| (org-element-property :value element) | |
| fn))))) |
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
| /** | |
| * Get the xpath of the target element | |
| * | |
| * @param element target dom element object | |
| * @return xpath of the target element | |
| */ | |
| function getPathTo(element) { | |
| if (element.tagName === 'HTML') { | |
| return '/HTML' | |
| } |
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
| /** | |
| * Build restful URL paths | |
| * | |
| * Use like: | |
| * rp('/user/:userId', {userId: 2}) => /users/2 | |
| * | |
| * @param pathname URL.pathname | |
| * @params path params | |
| */ | |
| function rp(pathname, params) { |
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
| # Commit message template | |
| # Header, Body, Footer | |
| # <type>(<scope>): <subject> | |
| # | |
| # <body> | |
| # | |
| # <footer> |
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
| #!/bin/bash | |
| # | |
| # VPN Server Usability Testing | |
| SERVER_NAMES="" | |
| SERVER_DOMAIN="" | |
| for SERVER_NAME in $SERVER_NAMES | |
| do | |
| SERVER=$SERVER_NAME.$SERVER_DOMAIN |
NewerOlder