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 {withRouter} from 'react-router-dom'; | |
class App extends React.Component { | |
constructor() { | |
super(); | |
this.state = {path: ''} | |
} | |
componentDidMount() { | |
let pathName = this.props.location.pathname; |
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 Counter extends React.Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
count: 0, | |
}; | |
} | |
increment = () => { | |
this.setState(prevState => { |
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
package main | |
import ( | |
"fmt" | |
) | |
/* | |
Question: | |
What will be printed by this program? |
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
function makePropertyMapper<T>(prototype: any, key: string, mapper: (value: any) => T) { | |
const values = new Map<any, T>(); | |
Object.defineProperty(prototype, key, { | |
set(firstValue: any) { | |
Object.defineProperty(this, key, { | |
get() { | |
return values.get(this); | |
}, | |
set(value: any) { | |
values.set(this, mapper(value)); |
npm list -g --depth=0
Install HomeBrew first
brew update
brew tap caskroom/cask
brew install brew-cask
If you get the error "already installed", follow the instructions to unlink it, then install again:
Install cask
that extends the brew
command :
brew install phinze/cask/brew-cask
Install calibre
using cask
:
brew cask install calibre
WARNING: This gist was created in 2013 and targets the legacy GOPATH mode. If you're reading this in 2021 or later, you're likely better served by reading https://tip.golang.org/cmd/go/#hdr-Configuration_for_downloading_non_public_code and https://golang.org/ref/mod#private-modules.
$ ssh -A vm
$ git config --global url."git@github.com:".insteadOf "https://github.com/"
$ cat ~/.gitconfig
[url "git@github.com:"]
insteadOf = https://github.com/
$ go get github.com/private/repo && echo Success!
Success!
OlderNewer