netcode.io enables a client/server architecture, handling the client/server connection handshake and encrypting the traffic between them.
- create a server instance:
class AssocPromise{ | |
constructor () { | |
this._iterable = []; | |
} | |
push (iterate) { | |
if (Boolean(iterate._label) === false) { | |
return; | |
} | |
if (Boolean(iterate._fn) === false) { | |
return; |
Increase Android AsyncStorage Size in React Native The iOS AsyncStorage implementation has an unlimited amount of space by default. This is not the case on Android, the default size of AsyncStorage is 6MB. This is generally enough for a casual application however there are many cases when you may need more, like when you are using PouchDB async adapter.
To increase the size first locate the /android/app/src/main/java/MainApplication.java
file in your React Native application.
We'll first add this import at the top of the MainApplication.java file
import com.facebook.react.modules.storage.ReactDatabaseSupplier;
Your imports may look something like.
const hasha = require('hasha'); | |
const CircularJSON = require('circular-json'); | |
let signature = hasha( | |
CircularJSON.stringify(query), | |
{ algorithm: 'sha256' } | |
); |
class Checker{ | |
constructor () { | |
this._passed = true; | |
} | |
static pairwise (list) { | |
// https://codereview.stackexchange.com/a/75667 | |
let pairs = new Array((list.length * (list.length - 1)) / 2); | |
let pos = 0; | |
for (let i = 0; i < list.length; i++) { | |
for (let j = i + 1; j < list.length; j++) { |
// only covers a small subset of the Map api! | |
// haven't debugged yet! | |
class BigMap { | |
constructor(iterable) { | |
if(iterable) throw new Error("haven't implemented construction with iterable yet"); | |
this._maps = [new Map()]; | |
this._perMapSizeLimit = 14000000; | |
this.size = 0; | |
} |
var n = new Notification('Connected', { body: 'Well done mate'} ); | |
setTimeout(() => n.close(), 3000); | |
Notification.permission; | |
Notification.requestPermission().then(console.log).catch(console.error); | |
// https://developer.mozilla.org/en-US/docs/Web/API/notification |
https://github.com/mapbox/pbf
https://developer.mozilla.org/en-US/docs/Web/API/Geolocation/getCurrentPosition
var options = {
enableHighAccuracy: true,
timeout: 5000,
maximumAge: 0
};
Summary:
.set()
, .get()
, .has()
methodspbf
.toBuffer()
and .parseBuffer()
methodsReferences: