ssh-keygen -t rsa -b 4096 -f rs256.rsa
openssl rsa -in rs256.rsa -pubout -outform PEM -out rs256.rsa.pub
cat rs256.rsa
cat rs256.rsa.pub
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
go list -f '{{ .Dir }}' ./... | grep -v 'vendor' | tail -n +2 | xargs gofumports -w |
To update the local list of remote branches
git remote update origin --prune
Listing branches with their latest author
git for-each-ref --format='%(committerdate) %09 %(authorname) %09 %(refname)'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// https://stackoverflow.com/questions/22892120/how-to-generate-a-random-string-of-a-fixed-length-in-go | |
// | |
package main | |
import ( | |
"math/rand" | |
"strings" | |
"testing" | |
"time" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Parent extends Component { | |
constructor(props) { | |
super(props); | |
this.child = React.createRef(); | |
} | |
onClick = () => { | |
this.child.current.getAlert(); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { forwardRef, useRef, useImperativeHandle } from 'react'; | |
// We need to wrap component in `forwardRef` in order to gain | |
// access to the ref object that is assigned using the `ref` prop. | |
// This ref is passed as the second parameter to the function component. | |
const Child = forwardRef((props, ref) => { | |
// The component instance will be extended | |
// with whatever you return from the callback passed | |
// as the second argument |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
OS X El Capitan 10.11.6 (15G1011) | |
Homebrew 2.0.6 | |
brew install --ignore-dependencies https://raw.githubusercontent.com/Homebrew/homebrew-core/6d98155ab46f61482f16f8bcffb378a0a71e0d15/Formula/icu4c.rb | |
brew install --ignore-dependencies https://raw.githubusercontent.com/Homebrew/homebrew-core/bb43eb1cf32ae14fc6df77c3b92adbe9a779338b/Formula/node.rb | |
node v9.11.1 | |
icu4c 61.1 | |
npm 5.6.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM grpc/php | |
RUN apt-get update && \ | |
apt-get install --yes build-essential autoconf libtool zlib1g-dev zip unzip automake libtool pkg-config && \ | |
apt-get clean && \ | |
rm -rf /var/lib/apt/lists/* | |
RUN git clone -q --depth 1 --recursive -b $(curl -L https://grpc.io/release) https://github.com/grpc/grpc /root/grpc \ | |
&& cd /root/grpc \ | |
&& make grpc_php_plugin \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// A constructor for a piece of middleware. | |
// Some middleware use this constructor out of the box, | |
// so in most cases you can just pass somepackage.New | |
type Constructor func(http.Handler) http.Handler | |
// Chain acts as a list of http.Handler constructors. | |
// Chain is effectively immutable: | |
// once created, it will always hold | |
// the same set of constructors in the same order. | |
type Chain struct { |
NewerOlder