View k_from_p.go
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
// Leetcode: | |
// https://leetcode.com/problems/maximum-value-of-k-coins-from-piles/ | |
func maxValueOfCoins(piles [][]int, k int) int { | |
// Record the points cumulatively for taking N coins from each pile | |
for p := range piles { | |
for c := range piles[p] { | |
if c+1 >= len(piles[p]) { | |
continue | |
} |
View io_fs_write_sketch.go
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
package fs | |
import ( | |
"fmt" | |
"io" | |
"os" | |
. "io/fs" | |
) |
View linked_hash_map.go
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
// https://go2goplay.golang.org/p/MGkmOhAcV79 | |
package main | |
import ( | |
"fmt" | |
) | |
type Pair[K, V any] struct { | |
Key K |
View perfect.go
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
package main | |
import ( | |
"flag" | |
"fmt" | |
"runtime" | |
"sync" | |
"time" | |
) |
View analysis.go.patch
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
diff --git a/internal/lsp/source/analysis.go b/internal/lsp/source/analysis.go | |
index e9c9ecc1..cea1e548 100644 | |
--- a/internal/lsp/source/analysis.go | |
+++ b/internal/lsp/source/analysis.go | |
@@ -16,6 +16,7 @@ import ( | |
"strings" | |
"sync" | |
"time" | |
+ "runtime/debug" |
View gba_asm_interrupt_handler.s
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
.section .data._gba_asm_interrupt_handler | |
.global _gba_asm_interrupt_handler | |
.type _gba_asm_interrupt_handler, %function | |
.align | |
.arm | |
_gba_asm_interrupt_handler: | |
// Registers: | |
// r0 = IOREG | |
// NOTE: |
View flags.txt
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
Original: | |
-Xmx2G -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M | |
New: | |
-XX:+UseG1GC -Xmx3G -Xms1G -Dsun.rmi.dgc.server.gcInterval=2147483646 -XX:+UnlockExperimentalVMOptions -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M |
View migrate_local_repos_to_github.sh
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
#!/bin/bash | |
set -e | |
TOKEN="YOUR_GITHUB_AUTH_TOKEN_HERE" | |
USERNAME="YOUR_USERNAME" | |
mkdir -p repos published | |
for DIR in *.git; do |
View numeric_sort.go
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
package main | |
import ( | |
"fmt" | |
"sort" | |
"strings" | |
"unicode" | |
) | |
func main() { |
View race_test.go
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
package gorace // run with go test -race | |
import ( | |
"sync" | |
"testing" | |
"time" | |
) | |
var ( | |
every = 100 * time.Millisecond |
NewerOlder