git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
{ | |
"extends": "./tsconfig.json", | |
"compilerOptions": { | |
"jsx": "react" | |
} | |
} |
module.exports = { | |
"testEnvironment": "node", | |
"roots": [ | |
"<rootDir>/components" | |
], | |
"preset": "ts-jest", | |
"setupFilesAfterEnv": ["<rootDir>/tests/setupTests.ts"], | |
"transform": { | |
"^.+\\.tsx?$": "ts-jest" | |
}, |
import Enzyme from 'enzyme'; | |
import Adapter from 'enzyme-adapter-react-16'; | |
// Configure Enzyme with React 16 adapter | |
Enzyme.configure({ adapter: new Adapter() }); |
{ | |
"name": "our-cool-nextjs-app", | |
"version": "0.1.0", | |
"dependencies": { | |
"next": "^9.1.1", | |
"react": "^16.10.2", | |
"react-dom": "^16.10.2", | |
"tslib": "^1.10.0" | |
}, | |
"scripts": { |
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git
cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
/** | |
* MISSING INTEGER | |
* --- | |
* Write a function: | |
* function solution(A); | |
* that, given an array A of N integers, returns the smallest positive integer (greater than 0) that does not occur in A. | |
* For example, given A = [1, 3, 6, 4, 1, 2], the function should return 5. | |
* Given A = [1, 2, 3], the function should return 4. | |
* Given A = [−1, −3], the function should return 1. | |
* |
Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.
git revert {commit_id}'
Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:
/* | |
Algorithmic task | |
Given a string of length 1048576, | |
find the position of the longest substring made from identical characters. | |
It is guaranteed that there is only one such substring and its length is 8192. | |
You are not allowed to peek inside the string, however you can call an external | |
function "getMaxLength(int startPosition, int endPosition)" which will return | |
the longest number of identical consecutive characters found within the interval. |