Skip to content

Instantly share code, notes, and snippets.

View markogresak's full-sized avatar

Marko Grešak markogresak

View GitHub Profile
@markogresak
markogresak / url-from-template.js
Created July 24, 2018 08:35
url-from-template.js
import isProduction from './is-production';
const placeholderRe = /:([A-Za-z0-9_]+)\??/;
const allPlaceholdersRe = new RegExp(placeholderRe, 'g');
function getType(val) {
return Array.isArray(val) ? 'array' : typeof val;
}
/**
/* eslint-disable no-console */
// "babel-core": "^6.24.1",
// "glob": "^7.1.2",
// "lodash": "^4.17.4",
// "babel-plugin-syntax-dynamic-import": "^6.18.0",
// "babel-plugin-transform-class-properties": "^6.24.1",
// "babel-plugin-syntax-decorators": "^6.13.0",
// "babel-preset-es2015": "^6.24.1",
// "babel-preset-react": "^6.24.1",

Setup

Copy contents of prepare-commit-msg to .git/hooks/prepare-commit-msg.

This has to be configured for each project.

Requirements:

  • grep with extended regex (-E) support, it should already be preinstalled on macOS and Linux
import {Provider} from 'react-redux';
// ... rest of imports
const RootContainer = ({store, history}) => {
return (
<Provider store={store}>
<Routes history={history} />
</Provider>
);
};

Spell check:

  • z=: show suggestions
@markogresak
markogresak / machine-config.md
Created June 27, 2016 07:48
Config for development (git, github, etc.)
@markogresak
markogresak / IntelliJ Snippets OS X.md
Created May 31, 2016 00:51
IntelliJ Snippets OS X
  • Go to class: + n

  • Go to file: + + n

  • Search everywhere: + p

  • Recent fiels: + e

  • Go to symbol (above + any props or method): + + + n

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Color Wars</title>
<style>
body {
font-family: sans-serif;
}