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 getParameter(name) { | |
| name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]"); | |
| var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"), | |
| results = regex.exec(location.search); | |
| return results === null ? "" : decodeURIComponent(results[1].replace(/\+/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
| function parseJwt (token) { | |
| var base64Url = token.split('.')[1]; | |
| var base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/'); | |
| var jsonPayload = decodeURIComponent(atob(base64).split('').map(function(c) { | |
| return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2); | |
| }).join('')); | |
| return JSON.parse(jsonPayload); | |
| }; |
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
| // included this js | |
| // <script src="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.9.1/showdown.min.js"></script> | |
| function md_to_html(text) { | |
| var converter = new showdown.Converter(), | |
| html = converter.makeHtml(text); | |
| 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
| // Included this js | |
| // <script src="https://cdn.jsdelivr.net/npm/[email protected]/lib/darkmode-js.min.js"></script> | |
| const options = { | |
| bottom: '64px', // default: '32px' | |
| right: 'unset', // default: '32px' | |
| left: '32px', // default: 'unset' | |
| time: '0.5s', // default: '0.3s' | |
| mixColor: '#fff', // default: '#fff' | |
| backgroundColor: '#fff', // default: '#fff' |
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
| [data-tooltip-text]:hover { | |
| position: relative; | |
| } | |
| [data-tooltip-text]:after { | |
| -webkit-transition: bottom .3s ease-in-out, opacity .3s ease-in-out; | |
| -moz-transition: bottom .3s ease-in-out, opacity .3s ease-in-out; | |
| transition: bottom .3s ease-in-out, opacity .3s ease-in-out; | |
| background-color: rgba(0, 0, 0, 0.8); |
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" | |
| "strconv" | |
| "sync" | |
| ) | |
| func main() { | |
| fmt.Println("vim-go") |
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 ( | |
| "net/http" | |
| "github.com/labstack/echo/v4/middleware" | |
| "github.com/labstack/echo/v4" | |
| "github.com/tylerb/graceful" | |
| ) |
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
| func MakeToken(url string) string { | |
| now := time.Now() | |
| nanos := now.UnixNano() | |
| sum := sha256.Sum256([]byte(strconv.FormatInt(nanos,10)+url)) | |
| data := fmt.Sprintf("%x",string(sum[:])) | |
| return data | |
| } |
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
| tree -f | cut -d "." -f 2-99 | sort -u | tee paths |
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 ( | |
| "flag" | |
| "fmt" | |
| ) | |
| func main() { | |
| flag.String("a", "", "flag 1") | |
| flag.String("b", "", "flag 2") | |
| flag.String("c", "", "flag 3") |
OlderNewer