Skip to content

Instantly share code, notes, and snippets.

How would another contributor access these branches? To get started I suppose it's git clone, but can you git clone later too when you already have and old version of the repo? Or do you manually create branches locally and then pull those?

Think about this in terms of remote vs. local. Any branch that is local can only be accessed by the person who has created it. Once that person pushes it up to the remote repository, it is now accessible by all those who can see the remote repository.

The git clone command should only be done once, at the very beginning. If you want to grab updates later, you would use the git pull command, which is a combination of git fetch and git merge.

**Why is it that you have to specify what branch you are pushing to? I mean it seems a lot safer to automatically push the current branch to the remote branch with the same name (is there any way to do that, so that when I push my feat1 branch it will be pushed to the remote feat1 branch, without risking pushing master

@zachgoll
zachgoll / map-operator.js
Created September 12, 2020 02:31
map operator
const { interval } = Rx;
const { map, take } = RxOperators;
// The input observable will emit the values 1, 2, 3
// in 1 second intervals
function inputObservable() {
const returnValues = [1, 2, 3];
return interval(1000)
.pipe(
take(returnValues.length),
const { interval } = Rx;
const { map, take } = RxOperators;
// The input observable will emit the values 1, 2, 3
// in 1 second intervals
function inputObservable() {
const returnValues = [1, 2, 3];
return interval(1000)
.pipe(
take(returnValues.length),
// Note: The "$" is a convention that is used to denote an Observable variable type and does nothing than add styling
outerObs$.pipe(switchMap(
(outerObservableValue) => {
return innerObservable$.pipe(
map((innerObservableValue) => {
return
})
);
}
))
obs1$.switchMap(
(x) => {
return obs2$.pipe(
map((y) => {
return "" + x + y;
})
);
}
);
const { interval, Observable } = Rx;
const { map, take, switchMap, startWith } = RxOperators;
// Emit value 1 at 1 second
// Emit value 3 at 4 seconds
// Emit value 5 at 5.5 seconds
// Complete at 5.5 seconds
function outerObservable() {
return new Observable(subscriber => {
setTimeout(() => {
const { interval, Observable } = Rx;
const { map, take, switchMap, startWith, mergeMapTo } = RxOperators;
function outerObservable() {
return new Observable(subscriber => {
setTimeout(() => {
subscriber.next("A");
}, 1000);
setTimeout(() => {
@zachgoll
zachgoll / incorrect-date-example.html
Last active October 2, 2020 12:42
Incorrect JS Date example
<html>
<head>
<style>
body {
padding: 20px;
}
</style>
</head>
<body>
<h2>Date example web app</h2>
@zachgoll
zachgoll / correct-date-example.html
Created October 2, 2020 12:24
Correct Date Example
<html>
<head>
<style>
body {
padding: 20px;
}
</style>
</head>
<body>
<h2>Date example web app</h2>
@zachgoll
zachgoll / asking-user-timezone.html
Created October 2, 2020 13:20
Asking user timezone
<html>
<head>
<style>
body {
padding: 20px;
}
</style>
</head>
<body>
<h2>Date example web app</h2>