This file contains 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
// Order does matter | |
const units = [ | |
['second', 1], | |
['minute', 60], | |
['hour', 60 * 60], | |
['day', 24 * 60 * 60], | |
['month', 30 * 24 * 60 * 60], | |
['year', 12 * 30 * 24 * 60 * 60], | |
]; |
This file contains 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
kubectl get services # List all services | |
kubectl get pods # List all pods | |
kubectl get nodes -w # Watch nodes continuously | |
kubectl version # Get version information | |
kubectl cluster-info # Get cluster information | |
kubectl config view # Get the configuration | |
kubectl describe node <node> # Output information about a node | |
kubectl get pods # List the current pods | |
kubectl describe pod <name> # Describe pod <name> | |
kubectl get rc # List the replication controllers |
This file contains 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
# Reference: https://www.exclamationlabs.com/blog/continuous-deployment-to-npm-using-gitlab-ci/ | |
# GitLab uses docker in the background, so we need to specify the | |
# image versions. This is useful because we're freely to use | |
# multiple node versions to work with it. They come from the docker | |
# repo. | |
# Uses NodeJS V 9.4.0 | |
image: node:9.4.0 | |
# And to cache them as well. |
This file contains 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
export default [ | |
{ name: 'Afghanistan', code: 'AF', name_fa: 'افغانستان' }, | |
{ name: 'land Islands', code: 'AX', name_fa: 'جزایر الند' }, | |
{ name: 'Albania', code: 'AL', name_fa: 'آلبانی' }, | |
{ name: 'Algeria', code: 'DZ', name_fa: 'الجزایر' }, | |
{ name: 'American Samoa', code: 'AS', name_fa: 'ساموآی آمریکا' }, | |
{ name: 'AndorrA', code: 'AD', name_fa: 'آندورا' }, | |
{ name: 'Angola', code: 'AO', name_fa: 'آنگولا' }, | |
{ name: 'Anguilla', code: 'AI', name_fa: 'آنگویلا' }, | |
{ name: 'Antigua and Barbuda', code: 'AG', name_fa: 'آنتیگوآ و باربودا' }, |
This file contains 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 'isomorphic-fetch'; | |
/** | |
* | |
* Actions */ | |
export const LOGIN_REQUEST = 'LOGIN_REQUEST'; | |
export const LOGIN_SUCCESS = 'LOGIN_SUCCESS'; | |
export const LOGIN_FAILURE = 'LOGIN_FAILURE'; | |
export const LOGOUT_REQUEST = 'LOGOUT_REQUEST'; | |
export const LOGOUT_SUCCESS = 'LOGOUT_SUCCESS'; |
This file contains 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 { connect } from 'react-redux'; | |
import { Redirect } from 'react-router-dom'; | |
export default ChildComponent => { | |
class RequireAuth extends React.PureComponent { | |
render() { | |
switch (this.props.isAuthenticated) { | |
case false: | |
return <Redirect to="/login" />; |
This file contains 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
export const PrivateRoute = ({component: Component, ...rest}) => ( | |
<Route {...rest} render={props => ( | |
localStorage.getItem('token') | |
? <Component {...props}/> | |
: <Redirect to={{ pathname: '/login', state: { from: props.location } }} /> | |
)} /> | |
); |
NewerOlder