I hereby claim:
- I am ashish173 on github.
- I am ashishait (https://keybase.io/ashishait) on keybase.
- I have a public key ASBd6vMalHeeL01NO8cp45RIAF8VewFO3Gw99G-i5PuA4Ao
To claim this, I am signing this object:
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.0; | |
interface AggregatorV3Interface { | |
function decimals() external view returns (uint8); | |
function description() external view returns (string memory); | |
function version() external view returns (uint256); |
// SPDX-License-Identifier: GPL-3.0 | |
pragma solidity >=0.4.22 <0.9.0; | |
library TestsAccounts { | |
function getAccount(uint index) pure public returns (address) { | |
address[15] memory accounts; | |
accounts[0] = 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4; | |
accounts[1] = 0xAb8483F64d9C6d1EcF9b849Ae677dD3315835cb2; |
I hereby claim:
To claim this, I am signing this object:
A Pen by ashish singh on CodePen.
function flatten(arr) { | |
var i = 0; | |
while (i < arr.length) { | |
arr = arr.reduce(function (prev, curr) { | |
return prev.concat(curr); | |
}, []); | |
i++; | |
} | |
return arr; | |
} |
<div *ngIf="$userObservable | async; else loading; let user"> | |
Hello {{user.last}}, {{user.first}}! | |
</div> | |
<ng-template #loading>Fetching data...</ng-template> |
private _updateView() { | |
if (this._context.$implicit) { | |
if (!this._thenViewRef) { | |
this._viewContainer.clear(); | |
this._elseViewRef = null; | |
if (this._thenTemplateRef) { | |
this._thenViewRef = | |
this._viewContainer.createEmbeddedView(this._thenTemplateRef, this._context); | |
} | |
} |
var source = Rx.Observable | |
.range(1, 2) | |
.flatMap(function (x) { | |
return Rx.Observable.range(x, 2); | |
}); | |
var subscription = source.subscribe( | |
function (x) { console.log('Next: ' + x); }, | |
function (err) { console.log('Error: ' + err); }, | |
function () { console.log('Completed'); }); |
//emit immediately, then every 5s | |
const source = Rx.Observable.timer(0, 5000); | |
//switch to new inner observable when source emits, emit items that are emitted | |
const example = source.switchMap(() => Rx.Observable.interval(500)); | |
//output: 0,1,2,3,4,5,6,7,8,9...0,1,2,3,4,5,6,7,8 | |
const subscribe = example.subscribe(val => console.log(val)); | |
//emit every click | |
const sourceTwo = Rx.Observable.fromEvent(document, 'click'); | |
//if another click comes within 3s, message will not be emitted |
//emit (1,2,3,4,5) | |
const source = Rx.Observable.from([1,2,3,4,5]); | |
//add 10 to each value | |
const example = source.map(val => val + 10); | |
//output: 11,12,13,14,15 | |
const subscribe = example.subscribe(val => console.log(val)); | |
//emit ({name: 'Joe', age: 30}, {name: 'Frank', age: 20},{name: 'Ryan', age: 50}) | |
const sourceTwo = Rx.Observable.from([{name: 'Joe', age: 30}, {name: 'Frank', age: 20},{name: 'Ryan', age: 50}]); | |
//grab each persons name |