npx create-react-app@next --scripts-version=@next --template=cra-template@next my-js-app
npx create-react-app@next --scripts-version=@next --template=typescript@next my-ts-app
var immer = require("immer") | |
var produce = immer.produce; | |
var patches=[]; | |
var state0 = {a:1}; | |
var state1 = produce(state0, function(draft){draft.b=9;}, function(p){patches.push(...p)}); | |
var state2 = produce(state1, function(draft){draft.a=3;}, function(p){patches.push(...p)}); | |
var state3 = produce(state2, function(draft){draft.b=99;}, function(p){patches.push(...p)}); | |
var state4 = produce(state3, function(draft){draft.a=5;}, function(p){patches.push(...p)}); |
You already know the value of a niche - you go up in market value the more specialized you are in anything. So what do you specialize in?
There are many schools of thought, including ones where you could be a generalist that doesn't specialize in anything. I find one rule to be simplest and most effective above all: Specialize in the New.
Didn't we just agree to avoid FOMO? Well yes, thats an important distinction - don't specialize in everything new. Specializing means you have to say no to a lot of things. Just pick something new that fascinates you, and hopefully many others as well. Since you're learning in public, you'll know when you hit on a real nerve. Budget in the idea that you'll fail a few times before you find Your Thing.
Then the other big objection: There are plenty of jobs/money/etc in (fill in the blank older technology) too! This is usually followed by some big numbers and anecdata. "My brother's cousin's roommate's friend took this COBOL job and now he's ear
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
All libraries have subtle rules that you have to follow for them to work well. Often these are implied and undocumented rules that you have to learn as you go. This is an attempt to document the rules of React renders. Ideally a type system could enforce it.
A number of methods in React are assumed to be "pure".
On classes that's the constructor, getDerivedStateFromProps, shouldComponentUpdate and render.
git log --graph --oneline --decorate ( git fsck --no-reflog | awk '/dangling commit/ {print $3}' )
This will show you all the commits at the tips of your commit graph which are no longer referenced from any branch or tag – every lost commit, including every stash commit you’ve ever created, will be somewhere in that graph.
Удаление коммитов до c14809fa, т.е. мы удалили просто предыдущие коммиты, но изменения в файлах, сделанные в коммитах, остались. Удалились только сами коммиты. Если мы закомиттимся(commit), то все изменения удаленных комиттов, добавятся как 1 коммит.
git reset --soft c14809fa
The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.
The correct way of creating a private frok by duplicating the repo is documented here.
For this assignment the commands are:
git clone --bare [email protected]:usi-systems/easytrace.git
var config = require('path/to/config'); | |
var mongoose = require('mongose'); | |
process.env.NODE_ENV = 'test'; | |
before(function (done) { | |
function clearCollections() { | |
for (var collection in mongoose.connection.collections) { | |
mongoose.connection.collections[collection].remove(function() {}); |