Skip to content

Instantly share code, notes, and snippets.

View kmwarter's full-sized avatar
🎯
Focusing

Keith Warter kmwarter

🎯
Focusing
View GitHub Profile
@kmwarter
kmwarter / Git.md
Last active October 23, 2024 03:29

Most Used Git Commands

  1. git clone: Clone a repository into a new directory.
  2. git pull: Fetch and integrate changes from a remote repository.
  3. git push: Update the remote repository with local changes.
  4. git commit: Record changes to the repository.
  5. git status: Show the working tree status.
  6. git add: Add file contents to the index (staging area).
  7. git branch: List, create, or delete branches.
  8. git merge: Join two or more development histories together.
@kmwarter
kmwarter / App.jsx
Created June 18, 2019 23:57 — forked from robertgonzales/App.jsx
How to make a custom Prompt (using getUserConfirmation) for React Router v4
// 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?"
/>
@kmwarter
kmwarter / ultimate-ut-cheat-sheet.md
Created December 7, 2017 22:47 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


@kmwarter
kmwarter / better-nodejs-require-paths.md
Created September 20, 2017 22:03 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

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.

Possible solutions

@kmwarter
kmwarter / Proxywhat?
Last active September 20, 2017 05:06
//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")