create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
| package main | |
| import ( | |
| "bytes" | |
| "crypto/rand" | |
| "crypto/rsa" | |
| "crypto/tls" | |
| "crypto/x509" | |
| "crypto/x509/pkix" | |
| "encoding/pem" |
| // Tar takes a source and variable writers and walks 'source' writing each file | |
| // found to the tar writer; the purpose for accepting multiple writers is to allow | |
| // for multiple outputs (for example a file, or md5 hash) | |
| func Tar(src string, writers ...io.Writer) error { | |
| // ensure the src actually exists before trying to tar it | |
| if _, err := os.Stat(src); err != nil { | |
| return fmt.Errorf("Unable to tar files - %v", err.Error()) | |
| } |
| // Untar takes a destination path and a reader; a tar reader loops over the tarfile | |
| // creating the file structure at 'dst' along the way, and writing any files | |
| func Untar(dst string, r io.Reader) error { | |
| gzr, err := gzip.NewReader(r) | |
| if err != nil { | |
| return err | |
| } | |
| defer gzr.Close() |
| /* MIT License | |
| * | |
| * Copyright (c) 2017 Roland Singer [[email protected]] | |
| * | |
| * Permission is hereby granted, free of charge, to any person obtaining a copy | |
| * of this software and associated documentation files (the "Software"), to deal | |
| * in the Software without restriction, including without limitation the rights | |
| * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
| * copies of the Software, and to permit persons to whom the Software is | |
| * furnished to do so, subject to the following conditions: |
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
| # Set variables in .bashrc file | |
| # don't forget to change your path correctly! | |
| export GOPATH=$HOME/golang | |
| export GOROOT=/usr/local/opt/go/libexec | |
| export PATH=$PATH:$GOPATH/bin | |
| export PATH=$PATH:$GOROOT/bin |
| // By @coderitual | |
| // https://twitter.com/coderitual/status/1112297299307384833 | |
| // Remove any duplicates from an array of primitives. | |
| const unique = [...new Set(arr)] | |
| // Sleep in async functions. Use: await sleep(2000). | |
| const sleep = (ms) => (new Promise(resolve => setTimeout(resolve, ms))); | |
| // Type this in your code to break chrome debugger in that line. |
| var str = 'class ಠ_ಠ extends Array {constructor(j = "a", ...c) {const q = (({u: e}) => {return { [`s${c}`]: Symbol(j) };})({});super(j, q, ...c);}}' + | |
| 'new Promise((f) => {const a = function* (){return "\u{20BB7}".match(/./u)[0].length === 2 || true;};for (let vre of a()) {' + | |
| 'const [uw, as, he, re] = [new Set(), new WeakSet(), new Map(), new WeakMap()];break;}f(new Proxy({}, {get: (han, h) => h in han ? han[h] ' + | |
| ': "42".repeat(0o10)}));}).then(bi => new ಠ_ಠ(bi.rd));'; | |
| try { | |
| eval(str); | |
| } catch(e) { | |
| alert('Your browser does not support ES6!') | |
| } |
| package main | |
| import ( | |
| "log" | |
| "math" | |
| ) | |
| func Round(val float64, roundOn float64, places int ) (newVal float64) { | |
| var round float64 | |
| pow := math.Pow(10, float64(places)) |
| curl --include \ | |
| --no-buffer \ | |
| --header "Connection: Upgrade" \ | |
| --header "Upgrade: websocket" \ | |
| --header "Host: example.com:80" \ | |
| --header "Origin: http://example.com:80" \ | |
| --header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \ | |
| --header "Sec-WebSocket-Version: 13" \ | |
| http://example.com:80/ |