Skip to content

Instantly share code, notes, and snippets.

View maddrag0n's full-sized avatar
🇪🇺

Josh Li maddrag0n

🇪🇺
View GitHub Profile
@maddrag0n
maddrag0n / getAliasesFromBabelModuleResolver.js
Last active May 8, 2018 15:58
Reads babelrc module-resolver aliases and convert to aliases for webpack
const fs = require('fs');
const path = require('path');
/**
* Reads babelrc module-resolver aliases and convert to aliases for webpack
*
* @prop {string} babelrcPath - path to .babelrc
* @return {object} - webpack alias object
* @author maddrag0n // (https://github.com/maddrag0n)
* @license BSD-3-Clause - https://opensource.org/licenses/BSD-3-Clause
@maddrag0n
maddrag0n / react-redux-live-boilerplate.html
Last active February 24, 2018 08:56
ReactJS/Redux live boilerplate (single html with prop-types, redux-thunk, redux-logger, Immutable.js, router, react-bootstrap, Axios.js, fetch, lodash, recompose). Created for training purposes. Released under BSD-3-Clause.
<!doctype html>
<html lang="en" itemscope itemtype="http://schema.org/Product">
<head>
<title>ReactJS/Redux Live Boilerplate</title>
<meta charset="utf-8">
<meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0, width=device-width">
<link data-description="bootstrap styles" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<script src="http://unpkg.com/babel-standalone@6/babel.min.js">/* <script type='text/babel'> */</script>
<script src="http://unpkg.com/react@latest/umd/react.development.js">/* exposes React */</script>
@maddrag0n
maddrag0n / reactjs-live-boilerplate.html
Last active February 24, 2018 02:10
ReactJS live boilerplate (single html with router, react-bootstrap, fetch, lodash). Created for training purposes. Released under BSD-3-Clause.
<!doctype html>
<html lang="en" itemscope itemtype="http://schema.org/Product">
<head>
<title>ReactJS Live Boilerplate</title>
<meta charset="utf-8">
<meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0, width=device-width">
<link data-description="bootstrap styles" rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap-theme.min.css" integrity="sha384-rHyoN1iRsVXV4nD0JutlnGaslCJuC7uwjduW9SVrLvRYooPp2bWYgmgJQIXwl/Sp" crossorigin="anonymous">
<script src="http://unpkg.com/babel-standalone@6/babel.min.js">/* <script type='text/babel'> */</script>
<script src="http://unpkg.com/react@latest/umd/react.development.js">/* exposes React */</script>
@maddrag0n
maddrag0n / .eslintrc.js
Created February 23, 2018 23:44
eslint config for ReactJS
module.exports = {
"extends": [
"airbnb",
"plugin:flowtype/recommended"
],
"plugins": [
"react",
"flowtype",
"flowtype-errors"
],
@maddrag0n
maddrag0n / .babelrc
Created February 23, 2018 23:43
babel config for ReactJS
{
"presets": [
"stage-0",
"env",
"react",
"flow"
],
"plugins": [
"add-module-exports",
"lodash",
@maddrag0n
maddrag0n / StyleguidistMuiWrapper.jsx
Created February 23, 2018 23:37
react-styleguidist setup for material-ui, react-bootstrap, babel module-resolver, TapEventPlugin
// @flow
import React from 'react';
import type { Element as ReactElement } from 'react';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import getMuiTheme from 'material-ui/styles/getMuiTheme';
import RsgWrapper from 'react-styleguidist/lib/rsg-components/Wrapper';
import injectTapEventPlugin from 'react-tap-event-plugin';
import $ from 'jquery';

Keybase proof

I hereby claim:

  • I am maddrag0n on github.
  • I am maddrag0n (https://keybase.io/maddrag0n) on keybase.
  • I have a public key ASBus_z0i74h1afwAXYVElH1-qSs1IZQTmLZvn0EaWDfSgo

To claim this, I am signing this object: