Skip to content

Instantly share code, notes, and snippets.

View kaidoj's full-sized avatar
😅
Trying to evolve

Kaido J. kaidoj

😅
Trying to evolve
  • Zürich, Switzerland
View GitHub Profile
@kaidoj
kaidoj / react-redux-create-action.js
Last active May 31, 2019 05:46
Reduce creating react, redux, axios actions boilerplate
'use strict';
/**
* This should reduce redux action boilerplate creation
* Usage: const fetchAction = new CreateAction(name, url)
* dispatch(fetchAction.get())
* Usage with params: dispatch(fetchAction.setParams({param: '123'}).post())
* If u have route /route/path/{param}
* You can replace {param} with dynamic value using:
* fetchAction.setParams({routeParam: 'thing'}).get()
@kaidoj
kaidoj / readme.md
Created December 1, 2018 20:16
How to use a directory outside C:\Users with Docker Toolbox/Docker for Windows
@kaidoj
kaidoj / .babelrc
Last active November 1, 2018 08:09
ReactJS and Webpack 4 config
{
"presets": [
"env",
"react"
]
}
@kaidoj
kaidoj / webpack.config.js
Created October 29, 2018 10:57
Sass webpack config
//npm commands
//npm run dev = webpack --mode development
//npm run build webpack --mode production
const path = require('path');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const webpack = require('webpack');
@kaidoj
kaidoj / webpack.config.js
Created September 11, 2018 11:05
Webpack 4 config
//npm commands
//npm run dev = webpack --mode development
//npm run build webpack --mode production
const path = require('path');
const MiniCssExtractPlugin = require("mini-css-extract-plugin");
const OptimizeCSSAssetsPlugin = require("optimize-css-assets-webpack-plugin");
const UglifyJsPlugin = require("uglifyjs-webpack-plugin");
const webpack = require('webpack');
@kaidoj
kaidoj / actions.js
Last active January 12, 2020 09:48
How to add html5 audio to mobile devices using reactjs and redux
export const REQUEST_SET_AUDIO_TICK = 'REQUEST_SET_AUDIO_TICK'
function requestSetTick(audio) {
return {
type: REQUEST_SET_AUDIO_TICK,
tick: audio
}
}
export function setAudioTick(audio) {