git clone: Clone a repository into a new directory.git pull: Fetch and integrate changes from a remote repository.git push: Update the remote repository with local changes.git commit: Record changes to the repository.git status: Show the working tree status.git add: Add file contents to the index (staging area).git branch: List, create, or delete branches.git merge: Join two or more development histories together.
This file contains hidden or 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
| // use Prompt like normal... magic happens in getUserConfirmation | |
| class App extends Component { | |
| render () { | |
| return ( | |
| <Router getUserConfirmation={getUserConfirmation}> | |
| {...} | |
| <Prompt | |
| when={formIsHalfFilledOut} | |
| message="Are you sure you want to leave?" | |
| /> |
using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies
When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:
var Article = require('../../../models/article');Those suck for maintenance and they're ugly.
This file contains hidden or 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
| //This gist will show you just two files, the add.js file, and the test.js file | |
| //This is a file called add.js | |
| //It just has one addItem function that takes a new to do "task" like "go to the store" and it makes | |
| //one call inside of it to a third party- queries.addNew function to add said task to an SQL database. | |
| //We ofcourse do not want to depend on the database in our test-so we are going to stub this queries.addNew out... | |
| const queries = require("../queries") |