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 from 'react'; | |
import ReactDOM from 'react-dom'; | |
import App from './App'; | |
import registerServiceWorker from './registerServiceWorker'; | |
import { combineReducers, createStore } from 'redux' | |
import { Provider } from 'react-redux'; | |
import todoReducer from './reducer/todoReducer' | |
import throttle from 'lodash/throttle' |
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 myPromise() { | |
return new Promise((resolve, reject) => { | |
setTimeout(() => { | |
resolve('Stack Overflow'); | |
// reject('Some Error') | |
}, 2000); | |
}); | |
} | |
function showSpinner() { |
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
// XORCipher - Super simple encryption using XOR and Base64 | |
// | |
// Depends on [Underscore](http://underscorejs.org/). | |
// | |
// As a warning, this is **not** a secure encryption algorythm. It uses a very | |
// simplistic keystore and will be easy to crack. | |
// | |
// The Base64 algorythm is a modification of the one used in phpjs.org | |
// * http://phpjs.org/functions/base64_encode/ | |
// * http://phpjs.org/functions/base64_decode/ |
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 nFormatter(num, digits) { | |
var si = [ | |
{ value: 1, symbol: "" }, | |
{ value: 1E3, symbol: "K" }, | |
{ value: 1E6, symbol: "M" }, | |
{ value: 1E9, symbol: "G" }, | |
{ value: 1E12, symbol: "T" }, | |
{ value: 1E15, symbol: "P" }, | |
{ value: 1E18, symbol: "E" } | |
]; |
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
<?php | |
function kembalian($jumlah){ | |
$kembali = []; | |
$total = 0; | |
$obj = array( | |
[ | |
'name' => 'G2', | |
'val' => 200, | |
], | |
[ |
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 makeChange = function(amount) { | |
var change = [], | |
total = 0; | |
[25, 10, 5, 1].forEach(function(coin) { | |
while (total + coin <= amount) { | |
change.push(coin); | |
total += coin; | |
} | |
}); | |
return change; |
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
let pOC = [ | |
{ | |
fullName: '', | |
type: { | |
name: '' | |
}, | |
email: '', | |
mobileNo: '', | |
officeNo: '', | |
}, |
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
//npm install --save-dev simple-autoreload-server | |
var launcher = require('simple-autoreload-server'); | |
var server = launcher({ | |
port: 8008, | |
path: './dist/html/', | |
}); | |
module.exports = server; |
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
const path = require('path'); | |
const webpack = require('webpack') | |
const HtmlWebpackPlugin = require('html-webpack-plugin') | |
const pug = { | |
test: /\.pug$/, | |
use: [ | |
'html-loader?attrs=false', | |
'pug-html-loader' | |
] |
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
const path = require('path'); | |
module.exports = { | |
entry: './assets/js/dev/index.js', | |
output: { | |
filename: 'bundle.js', | |
// __dirname is a function that npm itself have in the library | |
path: path.resolve(__dirname, './assets/js/dist') | |
}, | |
module: { |