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" | |
| "log" | |
| "os/exec" | |
| "strings" | |
| "syscall" | |
| ) |
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" | |
| "os" | |
| ) | |
| func f() (ret int) { | |
| defer func() { ret = 10 }() | |
| return ret |
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
| shader_string = [[ | |
| extern number scale; | |
| extern number speed; | |
| extern number timer; | |
| extern number angle; | |
| extern vec2 resolution; | |
| extern vec4 color1; | |
| extern vec4 color2; | |
| vec4 effect(vec4 color, Image text, vec2 texture_coords, vec2 screen_coords) |
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
| type SemiGroup<T> = { | |
| append: (a: T, b: T) => T | |
| } | |
| class IntAdd implements SemiGroup<number> { | |
| append(a: number, b: number) { | |
| return a + b | |
| } | |
| } |
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" | |
| "time" | |
| ) | |
| func collatz(seed int32) int32 { | |
| var steps int32 = 0 | |
| for seed > 1 { |
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
| const table = ["0x20", "0x21", "0x2c", "0x48", "0x57", "0x64", "0x65", "0x6c", "0x6f", "0x72"] | |
| let idx = [3,6,7,7,8,2,0,4,8,9,7,5,1] | |
| let mount = [] | |
| for(let i = 0;i < idx.length;++i) { | |
| const char = String.fromCharCode(parseInt(table[idx[i]], 16)) | |
| mount.push(char) | |
| } |
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" | |
| ) | |
| func main() { | |
| start := time.Now() |
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" | |
| ) | |
| func main() { | |
| c := "早上好, I'm The Most Human Person In THis PLanet!!11 😧" | |
| for _, rune := range c { |
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 toPretty(seconds) { | |
| const f = { | |
| "week": 60*60*7*24, | |
| "day": 60*60*24, | |
| "hour": 60*60, | |
| "minute": 60, | |
| "second": 1, | |
| } | |
| if(seconds <= 0) return 'just now' |
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 sectSort(arr, start, length) { | |
| const sorting = (a, b) => a - b | |
| const begin = arr.slice(0, start) | |
| let slice = arr.slice(start) | |
| if(length && length >= 0) { | |
| slice = slice.slice(0, length) | |
| } | |