{{ message }}

Instantly share code, notes, and snippets.

🔮
It's magic

# Edgargrundmanise

🔮
It's magic
• Malta
Last active Jun 1, 2017
 function getLinkedListLength(A = [1,4,-1,3,2]) { let count = 0; let current = 0; while(current !== -1) { if (A.length < current) throw Error(`No link found for value: \${current}. Count: \${count}`); current = A[current]; count++;
Last active Jun 5, 2017
Get distance between two points (return distance in meters)
View haversine.js
 const calculateDistance = (pointA, pointB) => { // http://www.movable-type.co.uk/scripts/latlong.html const lat1 = pointA.coordinate.latitude; const lon1 = pointA.coordinate.longitude; const lat2 = pointB.coordinate.latitude; const lon2 = pointB.coordinate.longitude; const R = 6371e3; // earth radius in meters
Created Feb 12, 2018
RXJS Ajax example
View rxjs.ajax.js
 const searchEpic = (action\$, store) => action\$.ofType('SEARCH') .map(action => action.payload) .debounceTime(400) .switchMap(query => ajax.post('http://localhost:8080/search', {query}) .takeUntil(action\$.ofType('CANCEL_SEARCH'))) .map(res => ({type: 'SEARCH_DATA', result: res.response}))
Last active Nov 1, 2018
React Native + React Native Navigation: launch images setup [iOS] (iPhone)

## Personal note on how to setup launch images in RN when using RNN [iOS] (iPhone).

### Preparation

Launch image sizes:

portrait

1. Retina HD 5.5" : 1242 x 2208 px
2. Retina HD 4.7" : 750 x 1334 px
Created Dec 7, 2017
Shallow equal fbjs
View shallowEqual.js