This file contains 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
// work on node v10.15.3 | |
const DIGIT = 6; | |
const TIME_STEP = 30; | |
/** | |
* Calculate TOTP value defined in [RFC6238](https://tools.ietf.org/html/rfc6238) | |
* | |
* @param {Buffer} key shared secret between client and server | |
* @param {Date} date date to calculate totp value. |
This file contains 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
print([[ | |
HTTP/1.1 200 OK | |
Content-Type: image/jpeg | |
Transfer-Encoding: chunked | |
]]) | |
IMG = "/img.jpg" | |
chunk_size = 8192 | |
size = lfs.attributes(IMG).size |
This file contains 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
{{ $str := print .Inner }} | |
{{ $str := replace $str "<ul>" "<dl>"}} | |
{{ $str := replace $str "</ul>" "</dl>"}} | |
{{ $str := replace $str "<ol>\n<li>" "<dd>" }} | |
{{ $str := replace $str "</li>\n</ol>" "</dd>" }} | |
{{ $str := replace $str "<li>" "<dt>" }} | |
{{ $str := replace $str "</li>" "</dt>" }} | |
{{ markdownify $str }} |
This file contains 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
{{$api_key := "&api_key=[YOUR API KEY]"}} | |
{{$user := or (.Get "user") "[YOUR USER NAME]"}} | |
{{$api_url := "https://api.flickr.com/services/rest/?format=json&nojsoncallback=1"}} | |
{{$size := (getJSON $api_url "&method=flickr.photos.getSizes" $api_key "&photo_id=" (.Get "id")).sizes.size}} | |
{{$title := .Get "title"}} | |
{{$width := .Get "width"}} | |
{{$height:= .Get "height"}} |
This file contains 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
Option Explicit | |
If WScript.Arguments.Count = 0 Then | |
WScript.Echo "Usage: sudo program [arg1 arg2 ...]" & vbCrLf & _ | |
"Run `program` with paramators as root in new console window" | |
Else | |
Dim ShellApp, WshShell | |
Dim cmd, varg, i | |
Set WshShell = CreateObject("WScript.Shell") | |
cmd = WshShell.ExpandEnvironmentStrings("%COMSPEC%") | |
'Build paramator |