Skip to content

Instantly share code, notes, and snippets.

View webpack.config.dev.js
'use strict';
const util = require('util');
let NODE_ENV = process.env.NODE_ENV || 'development';
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const autoprefixer = require('autoprefixer');
const path = require('path');
var isDebug = true;
@wzup
wzup / webpack.config.dev.js
Created Mar 29, 2018
webpack.config.dev.js
View webpack.config.dev.js
'use strict';
const webpack = require('webpack');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const autoprefixer = require('autoprefixer');
const path = require('path');
let SpritesmithPlugin = require('webpack-spritesmith');
var isDebug = true;
@wzup
wzup / gist:b424cccea0e20a19bfb606618439a255
Created Nov 7, 2017
Pelias Build Notes for Ubuntu 14.04 (elasticsearch 1.7 - NodeJS 5)
View gist:b424cccea0e20a19bfb606618439a255
# Ubuntu 14.04 Install Steps
# This information assumes you’re storing your data in /mnt/data — both elasticsearch data and pelias map data. I chose
# to create a separate volume keeping the data from the system, separated. You can still use /mnt/data without creating
# another volume to store it.
# Default ubuntu user runs all the commands, except for elevated ones. ubuntu user will run api
# Fix hosts file (simply adding ip hostname)
sudo nano /etc/hosts
@wzup
wzup / gist:2518e33506f064c6b5e4a373ca66b35e
Created Sep 8, 2017 — forked from kitek/gist:1579117
NodeJS create md5 hash from string
View gist:2518e33506f064c6b5e4a373ca66b35e
var data = "do shash'owania";
var crypto = require('crypto');
crypto.createHash('md5').update(data).digest("hex");
View routes.js
'use strict';
const NODE_ENV = process.env.NODE_ENV || 'development';
const React = require('react');
import { BrowserRouter as Router, Route, Link, Switch } from 'react-router-dom';
const App = require('./App');
const Index = require('./Index');
const About = require('./About');
View router.js
'use strict';
const NODE_ENV = process.env.NODE_ENV || 'development';
const React = require('react');
import { StaticRouter, BrowserRouter, Route, Link } from 'react-router-dom';
import { ConnectedRouter } from 'react-router-redux';
/**
View browser.js
'use strict';
const NODE_ENV = process.env.NODE_ENV || 'development';
/* React and Redux stuff */
const React = require('react');
const ReactDOM = require('react-dom');
import { Provider } from 'react-redux';
import { createStore, applyMiddleware, combineReducers, compose } from 'redux';
import thunkMiddleware from 'redux-thunk';
View reducersFactory.js
'use strict';
/**
* I make reducersFactory a function in order to pass it an initial state as a parameter.
* Switch-case are just for example. You may have your own
*/
function reducersFactory(initialState) {
return function reducers(state = initialState, action) {
switch (action.type) {
@wzup
wzup / browser.js
Last active Nov 12, 2018
React server-side rendering with react-router 3.x
View browser.js
'use strict';
const NODE_ENV = process.env.NODE_ENV || 'development';
/* React and Redux stuff */
const React = require('react');
const ReactDOM = require('react-dom');
import { Provider } from 'react-redux';
import { createStore, applyMiddleware, combineReducers, compose } from 'redux';
import thunkMiddleware from 'redux-thunk';
@wzup
wzup / _mixins.scss
Created Feb 1, 2017 — forked from joelstein/_mixins.scss
Horizontal list mixins
View _mixins.scss
// Standard horizontal list, using word-spacing trick to remove whitespace
// between inline-block elements.
@mixin horizontal-list {
padding: 0;
text-align: center;
word-spacing: -1em;
display: table;
width: 100%;
li {
You can’t perform that action at this time.