https://gyazo.com/eb5c5741b6a9a16c692170a41a49c858.png
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Transform a to another format | |
* @param {object} a - Sample data | |
* @return {object} Returns transformed a | |
*/ | |
function transform(a) { | |
var new_a = {}; | |
(function find_msg(item, str) { | |
for (var key in item) { | |
if (key === 'message') new_a[str] = item[key]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var docClient = require("../aws").docClient; | |
var co = require("co"); | |
var scanAll = co.wrap(function*( | |
tableName, | |
previousItems, | |
lastEvaluatedKey | |
) { | |
var items = previousItems || []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var docClient = require("../aws").docClient; | |
var co = require("co"); | |
var queryAll = co.wrap(function*( | |
params, | |
previousItems, | |
lastEvaluatedKey | |
) { | |
var items = previousItems || []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
/* | |
Read a text file and out put the content. | |
Example Usage: | |
var myTxt = require("./myTxt.txt"); | |
... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var scanAll = require("./scanAll"); | |
var docClient = require("../aws").docClient; | |
var co = require("co"); | |
var modifyAll = co.wrap(function*(table, action) { | |
var items = yield scanAll(table); | |
var promises = []; | |
for (var i = 0; i < items.length; i++) { | |
items[i] = action(items[i]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//// | |
import Modal from "react-native-modalbox"; | |
const { width, height } = Dimensions.get("window"); | |
//// | |
renderModal = () => { | |
let marginTop = height / 2 - 20; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var { height, width } = Dimensions.get("window"); | |
const isIpad = Platform.OS == "ios" && height / width == 4 / 3; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { MaskedViewIOS, View } from "react-native"; | |
import LinearGradient from "react-native-linear-gradient"; | |
// ... | |
const MaskedView = Platform.OS == "ios" ? MaskedViewIOS : View; | |
render = () => { | |
return ( | |
<MaskedView |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const s3 = require("../aws").s3; | |
/** | |
* List all objects in the specified S3 folder. | |
* @param {String} Bucket | |
* @param {String} Prefix | |
* @param {String} NextContinuationToken | |
* @param {Array} PreviousContents | |
* @returns {Promise<Array>} A promise containing an array of all objects in the folder | |
*/ |
OlderNewer