Skip to content

Instantly share code, notes, and snippets.

@coderabbi
coderabbi / git-fix.md
Last active Jan 28, 2021
Git Alias: fix
View git-fix.md

Ever wish you could add something to a prior commit, but you've committed a few times since?

Simple, right? git commit --fixup <hash-to-fix> followed by git rebase -i <last-good-hash>

I don't know about you, but that's one more hash than I want to deal with and since the --autostash option sets up the rebase properly for me, I really don't want to have to deal with my editor, either....

Consider the "git fix" alias.

Definition:

@sebmarkbage
sebmarkbage / Enhance.js
Last active Apr 22, 2021
Higher-order Components
View Enhance.js
import { Component } from "React";
export var Enhance = ComposedComponent => class extends Component {
constructor() {
this.state = { data: null };
}
componentDidMount() {
this.setState({ data: 'Hello' });
}
render() {
View gist:af32f8dff5fc59bba87a
## Color green if last command successful, red otherwise
PS1="\[\`if [[ \$? = "0" ]]; then echo '\e[32m\h\e[0m'; else echo '\e[31m\h\e[0m' ; fi\`:\w\n\$
Explore more here:
http://www.reddit.com/r/programming/comments/697cu/bash_users_what_do_you_have_for_your_ps1/