- feat: A new feature
- fix: A bug fix
- docs: Documentation only changes
- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
- refactor: A code change that neither fixes a bug or adds a feature
- perf: A code change that improves performance
- test: Adding missing tests
- chore: Changes to the build process or auxiliary tools and libraries such as documentation generation
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
| // create a React context Provider/Consumer pair that | |
| // validates the consumer is rendered within a provider | |
| function createRequiredContext(name) { | |
| const Context = React.createContext() | |
| function Consumer(props) { | |
| return ( | |
| <Context.Consumer {...props}> | |
| {val => { | |
| if (!val) { |
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
| import React, { Component } from "react" | |
| import { Machine } from "xstate" | |
| import * as PropTypes from "prop-types" | |
| class FiniteMachine extends Component { | |
| machine = Machine(this.props.chart) | |
| state = { | |
| data: this.props.reducer(undefined, { type: "@init" }), | |
| machineState: this.machine.getInitialState() |
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
| // makeRouteComponent.js | |
| import { compile } from 'path-to-regexp' | |
| import { Route } from 'react-router' | |
| export const makeRouteComponent = config => Comp => { | |
| Comp.__toPath = compile(config.path) | |
| return <Route {...config} component={Comp}/> | |
| } | |
| export const pathTo = (Comp, params) => ( |
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
| function pickProps(res = {}, props = []) { | |
| return props.reduce((acc, prop) => ({ ...acc, [prop]: res[prop] }), {}); | |
| } | |
| export default pickProps; |
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
| git branch -m old_branch new_branch # Rename branch locally | |
| git push origin :old_branch # Delete the old branch | |
| git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
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
| ##Folder structure | |
| /backbone | |
| app.js | |
| /apps | |
| /entities | |
| /lib | |
| ##Inside Apps | |
| /apps |
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
| * create a new repo on github (CLI) | |
| git init | |
| git config user.name "myName" (use the --global option to set has a global parameter) | |
| git config user.email "myEmail@to.to" | |
| git add . | |
| git commit -m "first commit" | |
| git remote add origin git@github.com:Shaltz/myRepo.git | |
| git push -u origin master | |
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
| @import compass | |
| $icons: sprite-map("icons/*.png") | |
| $icons-hd: sprite-map("icons-hd/*.png") | |
| i | |
| background: $icons | |
| display: inline-block | |
| @media (-webkit-min-device-pixel-ratio: 1.5), (min-resolution: 144dpi) | |
| background: $icons-hd |
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
| var application_root = __dirname, | |
| express = require("express"), | |
| path = require("path"), | |
| mongoose = require('mongoose'); | |
| var app = express.createServer(); | |
| // database | |
| mongoose.connect('mongodb://localhost/ecomm_database'); |