brew update
brew install pyenv
| process.env.NODE_ENV = 'production'; | |
| const webpack = require('webpack'); | |
| const BundleAnalyzerPlugin = require('webpack-bundle-analyzer').BundleAnalyzerPlugin; | |
| const webpackConfigProd = require('react-scripts/config/webpack.config')('production'); | |
| // this one is optional, just for better feedback on build | |
| const chalk = require('chalk'); | |
| const ProgressBarPlugin = require('progress-bar-webpack-plugin'); | |
| const green = text => { |
| let UserContext = React.createContext(); | |
| class App extends React.Component { | |
| state = { | |
| user: null, | |
| setUser: user => { | |
| this.setState({ user }); | |
| } | |
| }; |
| # -*- coding: utf-8 -*- | |
| from __future__ import unicode_literals | |
| from django.db import migrations, models | |
| from django_cryptography.fields import encrypt | |
| app_with_model = 'account' | |
| model_with_column = 'User' | |
| column_to_encrypt = 'email_address' | |
| column_field_class = models.CharField |
You already know you should be making projects to learn things and potentially add to your portfolio. You've read your Malcolm Gladwell, you know that you need 10,000 hours of deliberate practice. Given you're just starting out, I have a slightly contentious suggestion for you: DON'T make anything new.
Your decision-making is a scarce resource. You start every day with a full tank, and as you make decisions through the day you gradually run low. We all know how good our late-late-night decisions are. Making a new app involves a thousand micro decisions - from what the app does, to how it should look, and everything in between. Decide now: Do you want to practice making technical decisions or product decisions?
Ok so you're coding. You know what involves making zero product decisions? Cloning things. Resist the urge to make your special snowflake (for now). Oh but then who would use yet another Hacker News clone? I've got news for you: No one was gonna use your thing anyway. You
Create a new systemd user unit, which starts ssh-agent upon login to server. Will remain resident until the final session for the user has logged out.
-
Create
/etc/systemd/user/ssh-agent.service. -
Run the following commands (under your user account, not
root) to install the systemd unit and start:
A redux app is a chicken and egg problem. Given a particular state, the app should render a certain thing. But... where does that state come from?
Given a blank state, the app needs to rely on the URL to fetch the right data to populate the state.
In a server-side app, the initial state is determined in exactly this way. Given the initial URL, populate the state, render the app, send it to the client.
In a client-side app the situation is exactly the same, except it's totally different. On the client you have way more contextual information than just the URL. Given the URL, the current app state, a components own props and its internal state... a component must decide which data it needs loaded.
| import React, { Component } from 'react' | |
| import UserDetails from './UserDetails' | |
| /** | |
| * This utility function allows function calls to be debounced. | |
| * @param {Function} func Function that requires debouncing | |
| * @param {Number} wait Wait time in milliseconds between successive invocations | |
| */ | |
| const debounce = (func, wait) => { | |
| let timeout |
| // This is an example of how to fetch external data in response to updated props, | |
| // If you are using an async mechanism that does not support cancellation (e.g. a Promise). | |
| class ExampleComponent extends React.Component { | |
| _currentId = null; | |
| state = { | |
| externalData: null | |
| }; |
For example, to override the AppBar (https://material-ui-next.com/api/app-bar/) root class we can do the following:
1 - Add the property classes in the AppBar component:
<AppBar classes={{root: 'my-root-class'}}