Skip to content

Instantly share code, notes, and snippets.

reusee

Block or report user

Report or block reusee

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View a.go
package main
import "fmt"
func cached(
fn func(int) int,
) (
decorated func(int) int,
) {
cache := make(map[int]int)
View foo.go
package main
import (
"crypto/md5"
"encoding/binary"
"runtime"
"sync"
)
func main() {
View foo.go
package main
import (
"encoding/json"
"fmt"
)
type Item struct {
Raw json.RawMessage
Values map[string][]int
@reusee
reusee / a.js
Created Jun 9, 2019
batch delete zhihu answers
View a.js
fetch('/api/v4/members/aaaaaaa/answers').then(resp => { return resp.json() }).then(j => { for (const row of j.data) { fetch('/api/v4/answers/' + row.id, { method: 'DELETE', credentials: 'same-origin' } ).then(resp => { console.log(resp) }) } })
View a.go
package main
import (
"fmt"
)
func main() {
run := func(str string, wait chan struct{}, sig chan struct{}) {
for i := 0; i < 10; i++ {
<-wait
View a.go
var data struct {
Status int
Content string
Data struct {
Seats map[int]struct{
NickName string
Avatar string
UID int
}
}
@reusee
reusee / malformed.go
Last active Nov 15, 2018
malformed.go
View malformed.go
package main
import (
"encoding/json"
"fmt"
"strings"
)
func main() {
j := `
View report.html
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script src="report.js"></script>
<script src="system-production.js"></script>
<script src="aff.js"></script>
</head>
View priority.go
package main
import (
"fmt"
"sync"
"time"
)
func main() {
pt := fmt.Printf
View a.py
import itertools
def l():
while True:
for e in ['a', 'b', 'c', 'd']:
yield e
print(list(itertools.islice(l(), 7)))
You can’t perform that action at this time.