Skip to content

Instantly share code, notes, and snippets.

View johnaoss's full-sized avatar
go

John johnaoss

go
View GitHub Profile
@johnaoss
johnaoss / permconv.go
Created October 18, 2019 19:03
Snippet to convert the Unix file permission bits as a string to the native type in Go.
package permconv
import (
"os"
"fmt"
)
func parsePerms(s string) (os.FileMode, error) {
if len(s) != len("drwxr-xr-x") {
return 0, fmt.Errorf("invalid len of given string")
@johnaoss
johnaoss / conv.go
Last active September 28, 2019 22:13
Float64->String Conversions in Go
package vals
import (
"strings"
"strconv"
"fmt"
)
// SprintValues is a set of float64 values that implements Buckets.
@johnaoss
johnaoss / bot.md
Created August 8, 2019 21:02
Slack Bot Idea

Slack bot that just publically flames people if they do bad code / infra changes

let bad = require('crypto');
const fizz = sha256("3");
const buzz = sha256("5");
const fizzbuzz = sha256("15");
function sha256(string) {
return bad.createHash('sha256').update(string).digest('hex');
}
function in_array(arr, n) {

Keybase proof

I hereby claim:

  • I am johnaoss on github.
  • I am johna (https://keybase.io/johna) on keybase.
  • I have a public key ASD1pSKx1JlxxP5AOmNZfWGpUQFzwI0oGpJHEuu8cRa87wo

To claim this, I am signing this object: