Skip to content

Instantly share code, notes, and snippets.

View thehowl's full-sized avatar
🧙‍♂️
cooking scrambled eggs on my cpu

Morgan thehowl

🧙‍♂️
cooking scrambled eggs on my cpu
View GitHub Profile
#!/usr/bin/env python3
import requests
import sys
a = set()
def fofo(uri):
resp = requests.get(uri)
if resp.status_code != 200:
#
# Sphinx configuration file sample
#
# WARNING! While this sample file mentions all available options,
# it contains (very) short helper descriptions only. Please refer to
# doc/sphinx.html for details.
#
#############################################################################
## data source definition
package main
import (
"testing"
"encoding/json"
"encoding/gob"
"bytes"
)
// initialisation
{
"fa-500px": "icon five hundred pixels",
"fa-adjust": "icon adjust",
"fa-adn": "icon adn",
"fa-align-center": "icon align center",
"fa-align-justify": "icon align justify",
"fa-align-left": "icon align left",
"fa-align-right": "icon align right",
"fa-amazon": "icon amazon",
"fa-ambulance": "icon ambulance",
@thehowl
thehowl / ratelimit.go
Created July 6, 2016 13:06
Example of per-user rate limiting in go
package main
import (
"fmt"
"sync"
"time"
)
func main() {
rl := &specificRateLimiter{
@thehowl
thehowl / gocov
Created May 17, 2016 16:34
Script to generate a cover profile easily in go
#!/usr/bin/env bash
go test -v -bench . -cover -coverprofile=profile.out ./...
go tool cover -html=profile.out
rm profile.out
@thehowl
thehowl / cheatsheet.md
Created May 17, 2016 16:25
Go `testing` package cheatsheet

Basic file

Filename being [name]_test.go

package yourpackage

import (
	"testing"
)
// ==UserScript==
// @name m.zxq.co beatmap mirror
// @namespace https://m.zxq.co/
// @version 0.1
// @description faster osu! beatmaps downloads, yay!
// @author Howl
// @match http*://osu.ppy.sh/s/*
// @match http*://osu.ppy.sh/b/*
// @grant GM_xmlhttpRequest
// @connect m.zxq.co
body {
width: 980px;
}
#left {
float: left; width: 520px;
}
#wrapper {
width: 500px;
height: 600px;
min-height: 600px;
@thehowl
thehowl / ggd
Last active March 13, 2016 08:39
ggd - a way to easily get docs about a go package
#!/usr/bin/env bash
if [ -z ${1+x} ]; then
echo 'Usage:'
echo ' ggd [go package]'
exit 0
fi
xdg-open https://godoc.org/"$1" > /dev/null