Skip to content

Instantly share code, notes, and snippets.

View dglowinski's full-sized avatar

Dariusz Glowinski dglowinski

View GitHub Profile
@dglowinski
dglowinski / hide_component.js
Created July 14, 2017 08:42
React - hide component
function WarningBanner(props) {
if (!props.warn) {
return null;
}
return (
<div className="warning">
Warning!
</div>
);
@dglowinski
dglowinski / thunk_inputs.js
Created July 13, 2017 12:31
React - Thunk inputs
inputOnChange = propName => ev => this.setState({ [propName] : ev.target.value })
render () {
return (
<form onSubmit={this.handleLogin} >
<input
type='input'
value={this.state.user}
placeholder='username'
className='header-login-input'
@dglowinski
dglowinski / git pretty logs
Created April 3, 2017 09:54
git pretty logs
[alias]
lg1 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n'' %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lg = !"git lg1"