This file contains hidden or 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
fbDaemon = async ({ folderNames, folderPaths }) => { | |
const users = []; | |
const snapshot = await ref.once("value"); | |
snapshot.forEach(user => { | |
users.push(user); | |
}); | |
const settings = []; | |
for(const user of users) { |
This file contains hidden or 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 * as React from 'react'; | |
import { Text, View, StyleSheet, FlatList, ActivityIndicator,SectionList } from 'react-native'; | |
import { Constants } from 'expo'; | |
export default class Test extends React.Component { | |
constructor(props){ | |
super(props); | |
this.state ={ isLoading: true, dataSource : []} | |
} |
This file contains hidden or 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 myObject = [{ | |
"myItems": [{ | |
"id": 1, | |
"group": { | |
"groupId": 33 | |
}, | |
}, | |
{ | |
"id": 2, | |
"group": { |
This file contains hidden or 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
/* Enforces value type to correspond to that of key, in supplied map object */ | |
function foo<T, K extends keyof T>(map:T, key:K, value: T[K]) { | |
map[key] = value; | |
} | |
interface Apple { | |
color:string; | |
weight:number; | |
} |
This file contains hidden or 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
/* Functional component based on hooks that toggles image when button clicked */ | |
const ToggleDivImage = () => { | |
/* Setup component state that tracks visibility of the image. Initially, we'll set | |
the image to visible (toggled true) */ | |
const [toggled, setToggled] = React.useState(true); | |
/* Define a function that toggles the visibility of the image */ | |
const toggleImage = () => setToggled(!toggled); |
This file contains hidden or 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 content = editorContent.content | |
function parseContent (arr) { | |
arr.forEach((item, index, array)=>{ | |
// Check if item contains another array of items, and then iterate | |
over that one too. | |
if(item.content){ | |
parseContent(item.content) |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>SmartContract client: DacreSays</title> | |
<meta charset="utf-8" /> | |
<script src="https://cdn.jsdelivr.net/npm/web3@latest/dist/web3.min.js"></script> | |
<style> | |
label { | |
font-weight: bold; |
This file contains hidden or 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
interface Item { | |
id : string; | |
application : string; | |
type : string; | |
title : string; | |
} | |
type ResultType = { [key: string] : Array<Item> }; | |
var input : Array<Item> = [{ |