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 {interval, Subscription} from 'rxjs'; | |
import {take} from 'rxjs/operators'; | |
import * as cloneDeep from 'lodash.clonedeep'; | |
import {Injectable} from '@angular/core'; | |
export interface IStoreValue { | |
_timeout?: Subscription; | |
[key: string]: any; | |
} |
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
function generatePrimeNumbers(tillNumber = 2) { | |
const primeNumbers = Array(tillNumber).fill(true); | |
for (let p = 2; p * p <= tillNumber; p++) { | |
if (primeNumbers[p]) { | |
for (let i = p * p; i <= tillNumber; i += p) { | |
primeNumbers[i] = false; | |
} | |
} | |
} | |
const _primeNumbers = []; |
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
function generatePrimeNumbers(tillNumber = 2) { | |
const primeNumbers = Array(tillNumber).fill(true); | |
for (let p = 2; p * p <= tillNumber; p++) { | |
if (primeNumbers[p]) { | |
for (let i = p * p; i <= tillNumber; i += p) { | |
primeNumbers[i] = false; | |
} | |
} | |
} |
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
class MyClass { | |
constructor(private readonly fb: FormBuilder) { } | |
/** | |
* @desc makes an form array out of deeply nested array of objects | |
*/ | |
foo(arr = []) { | |
return arr.map((val) => { | |
const newVal = JSON.parse(JSON.stringify(val)); |
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
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout cert.key -out cert.pem -config req.cnf -sha256 |
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
//////////////////////////////////////////////////////////////////////////// | |
const obj = { | |
a: 10, | |
b: { | |
c: 20, | |
d: 30, | |
e: { | |
f: 40 | |
} | |
} |
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
(function () { | |
var users = [ | |
['John Doe', 23, '9550511496'], | |
['Jane Doe', 22, '4444444444'], | |
['Jonny Doe', 24, '555599939'] | |
], | |
columnHeaders = [ | |
{ headerName: 'Name' }, | |
{ headerName: 'Age' }, |