Skip to content

Instantly share code, notes, and snippets.

View gminova's full-sized avatar
:octocat:
Focusing

Gergana ゲルガナ gminova

:octocat:
Focusing
View GitHub Profile
@gminova
gminova / show-branch.md
Created March 15, 2019 19:35 — forked from githubteacher/show-branch.md
Adding your Git branch to your command prompt

To show your active Git branch in your command prompt, you will need to do the following:

  • If you are on a Mac, you can add the code shown below to your .bash_profile file.
  • If you are on Linux, you will add the code shown below to your .bashrc file.
  • If you are on Windows, you probably aren't reading this because Windows provides this behavior by default.

The Script

parse_git_branch() {
@gminova
gminova / gist:9e3a8a506cca901f9d4617082d443816
Created October 29, 2019 16:24 — forked from CristinaSolana/gist:1885435
Keeping a fork up to date

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@gminova
gminova / controlled_input.jsx
Created November 22, 2019 10:42
FCC - React Create a Controlled Input
class ControlledInput extends React.Component {
constructor(props) {
super(props);
this.state = {
input: ''
};
// change code below this line
this.handleChange = this.handleChange.bind(this)
// change code above this line
}
@gminova
gminova / controlled_form.jsx
Created November 22, 2019 16:02
FCC - React Create Controlled Form
class MyForm extends React.Component {
constructor(props) {
super(props);
this.state = {
input: '',
submit: ''
};
this.handleChange = this.handleChange.bind(this);
this.handleSubmit = this.handleSubmit.bind(this);
}
@gminova
gminova / state_as_prop.jsx
Created November 22, 2019 16:17
FCC - React Pass State as a Prop to Child Components
class MyApp extends React.Component {
constructor(props) {
super(props);
this.state = {
name: 'Gigi'
}
}
render() {
return (
<div>
@gminova
gminova / callback_as_props.jsx
Created November 22, 2019 16:40
FCC - React Pass a Callback as Props
class MyApp extends React.Component {
constructor(props) {
super(props);
this.state = {
inputValue: ''
}
this.handleChange = this.handleChange.bind(this);
}
handleChange(event) {
this.setState({
@gminova
gminova / componentWillMount.jsx
Created November 22, 2019 16:57
FCC - React componentWillMount()
class MyComponent extends React.Component {
constructor(props) {
super(props);
this.state = {
activeUsers: null
};
}
componentDidMount() {
setTimeout( () => {
this.setState({
@gminova
gminova / event_listeners.jsx
Created November 23, 2019 18:19
FCC - React Event Listeners
class MyComponent extends React.Component {
constructor(props) {
super(props);
this.state = {
message: ''
};
this.handleEnter = this.handleEnter.bind(this);
this.handleKeyPress = this.handleKeyPress.bind(this);
}
// change code below this line
@gminova
gminova / event_listeners.jsx
Created November 23, 2019 18:19
FCC - React Event Listeners
class MyComponent extends React.Component {
constructor(props) {
super(props);
this.state = {
message: ''
};
this.handleEnter = this.handleEnter.bind(this);
this.handleKeyPress = this.handleKeyPress.bind(this);
}
// change code below this line
@gminova
gminova / styles.jsx
Created November 23, 2019 22:05
FCC - React Styles
const styles = {
color: "purple",
fontSize: 40,
border: "2px solid purple"
}
// change code above this line
class Colorful extends React.Component {
render() {
// change code below this line
return (