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
@thehowl
thehowl / about.md
Last active March 22, 2018 22:15
Claws piping example

Claws was originally built because I had to scratch my own itch, which is to say I was implementing a WebSocket API for a project of mine, Ripple (not the cryptocurrency!) and there was no good command-line WS client that wasn't completely barebones. So that's really how the project was born.

Here's an example of the piping feature, using the Ripple WS API. It's really only to demonstrate what it can do (I needed something I could build in a reasonable amount of time and that was easily understandable :P). But, with programming, the sky is the limit, so create your own scripts to serve your purpose!

#!/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;