Skip to content

Instantly share code, notes, and snippets.

View emmanuelvacher's full-sized avatar

Emmanuel Vacher emmanuelvacher

View GitHub Profile
@putuyoga
putuyoga / CustomStorage.js
Created July 25, 2018 03:28
React Native Custom Storage for Android
import RNFetchBlob from 'react-native-fetch-blob';
const DocumentDir = RNFetchBlob.fs.dirs.DocumentDir;
const storagePath = `${DocumentDir}/persistStore`;
const encoding = 'utf8';
const toFileName = name => (
name.split(':').join('-')
);
@jclosure
jclosure / contains_key_or_empty.txt
Created July 3, 2017 05:33
Kibana Painless scripted field checks if field exists or is empty and returns default, otherwise value
if (!doc.containsKey('myfield') || doc['myfield'].empty) { return "unavailable" } else { return doc['myfield'].value }