Skip to content

Instantly share code, notes, and snippets.

View yairopro's full-sized avatar

Yair yairopro

View GitHub Profile
@lmzach09
lmzach09 / json-stringify-formatted-tabs.js
Created July 27, 2019 04:21
Stringify a JS object to JSON string with tab formatting
let obj = { "key": "value" };
let myString = JSON.stringify(obj, null, '\t'); // tab
console.log(myString);
// {
// "key": "value"
// }
@yairopro
yairopro / Storage.js
Last active July 10, 2018 12:20
Modules to store in DB or as key-value for react-native.
import SQLite from 'react-native-sqlite-2'
import {Platform} from "react-native";
const openedDb = {};
/**
* Wrapper for react-native-sqlite-2.
* Methods:
* <ul>
* <li>Promise<Array<Object>> {@link execute}(statement, ...variables) : Execute a statement. Variables will be binded into the statement. It returns the list of items matching the statement.</li>