Inspired by Maya Angelou's Still I Rise
You may walk through my GitHub history,
With it’s non idiomatic and fragal lines,
You may value me less than dirt,
But still, like dust, I’ll rise.
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "net" | |
| "net/http" | |
| "os" | |
| "syscall" |
| # This will sort go test -v output in ascending order of time to complete the test | |
| $ go test -v | sed -n 's#.*PASS: \([^ ]*\) (\([0-9]*\.[0-9]\{2\}\)s)#\2 \1#p' | sort -g | |
| # Add this to e.g. ~/.bashrc, ~/.zshrc, then you can pipe to it: `go test -v | goslowtests` | |
| function goslowtests { | |
| sed -n 's#.*PASS: \([^ ]*\) (\([0-9]*\.[0-9]\{2\}\)s)#\2 \1#p' | sort -g | |
| } |
| server { | |
| .... | |
| location ~ ^/x/(.*) { | |
| if ($args = "go-get=1") { | |
| add_header Content-Type text/html; | |
| return 200 '<meta name="go-import" content="$host/x/$1 git https://github.com/jessfraz/$1.git">'; | |
| } | |
| return 302 https://github.com/jessfraz/$1; | |
| } |
| { | |
| "Version": "2012-10-17", | |
| "Statement": [ | |
| { | |
| "Action": "sts:AssumeRole", | |
| "Principal": { | |
| "Service": "ec2.amazonaws.com" | |
| }, | |
| "Effect": "Allow", | |
| "Sid": "" |
| type roundTripFunc func (r *http.Request) (*http.Response, error) | |
| func (s roundTripFunc) RoundTrip(r *http.Request) (*http.Response, error) { | |
| return s(r) | |
| } | |
| func TestSword(t *testing.T) { | |
| var c Client | |
| c.Client.Transport = roundTripFunc(func(r *http.Request) (*http.Response, error) { | |
| assert.Equal(t, r.URL.Path, "/v1/item/sword") |
| import ( | |
| "fmt" | |
| "strings" | |
| "regexp" | |
| ) | |
| var matchFirstCap = regexp.MustCompile("(.)([A-Z][a-z]+)") | |
| var matchAllCap = regexp.MustCompile("([a-z0-9])([A-Z])") |
| #!/bin/bash | |
| # | |
| # Copyright 2014 Hewlett-Packard Development Company, L.P. | |
| # All Rights Reserved. | |
| # Authored by Yazz D. Atlas <[email protected]> | |
| # | |
| # Licensed under the Apache License, Version 2.0 (the "License"); you may | |
| # not use this file except in compliance with the License. You may obtain | |
| # a copy of the License at | |
| # |
| package main | |
| import ( | |
| "crypto/tls" | |
| "crypto/x509" | |
| "flag" | |
| "io/ioutil" | |
| "log" | |
| "net/http" | |
| ) |
| # How to throttle the FCC to dial up modem speeds on your website using Apache. | |
| # Ported from https://gist.github.com/kyledrake/e6046644115f185f7af0 | |
| ## The blog post that started it all: https://neocities.org/blog/the-fcc-is-now-rate-limited | |
| ## | |
| ## Current known FCC address ranges: | |
| ## https://news.ycombinator.com/item?id=7716915 | |
| ## | |
| ## Confirm/locate FCC IP ranges with this: http://whois.arin.net/rest/net/NET-165-135-0-0-1/pft |