Skip to content

Instantly share code, notes, and snippets.

View btg5679's full-sized avatar
🎯
Focusing

Ben Garrison btg5679

🎯
Focusing
View GitHub Profile
component,design
ColonyDAO Treasury,Gnosis Safe
Governance,Emoji Votes and Gnosis Snapshot
Governance Token,WOOD
Gnosis Safe Owner,Multi-Sig
Voting, All members must vote
function Node(task) { // www.ja v a 2 s .com
this.name = task.name;
this.uri = task.uri
this.nextTask = undefined;
}
function LinkedList() {
this.head = new Node({name:"head"});
this.find = find;
this.insert = insert;
function TaskNode(task) {
this.taskName = task.name;
this.taskUri = task.id
this.nextTask = null;
this.previousTask = null;
}
function WorkflowTaskLinkedList() {
this.head = new TaskNode({name:"head",id:'http://123'});
this.find = find;
function* favBeer() {
const reply = yield "What is your favorite type of beer?";
console.log(reply);
if (reply !== "ipa") return "No soup for you!";
return "OK, soup.";
}
{
const it = favBeer();
const q = it.next().value; // Iterator asks question
function* sample() {
yield "simple";
yield "generator";
}
var it = sample();
console.log(it.next()); // {value: 'simple, done: false}
console.log(it.next()); // {value: 'generator, done: false}
console.log(it.next()); // {value: undefined, done: true}
@btg5679
btg5679 / simpleIterator.js
Created July 11, 2018 00:52
Simple Iterator
function makeIterator(array) {
var nextIndex = 0;
console.log("nextIndex =>", nextIndex);
return {
next: function() {
return nextIndex < array.length
? { value: array[nextIndex++], done: false }
: { done: true };
}
import React, { Component } from "react";
import { Image, Text, View, Button, Picker } from "react-native";
import { styles } from "../utils/styles";
import SomeCustomComponent from "./SomeCustomComponent";
// see https://github.com/necolas/react-native-web
class App extends Component {
_onButtonPress() {
//do some things
import { AppRegistry } from "react-native";
import App from "./components/App";
AppRegistry.registerComponent("App", () => App);
AppRegistry.runApplication("App", {
rootTag: document.getElementById("root")
});
//Explicit vs. Implicit Coercion in JS
let a = 100;
let b = a + ''; //IMPLICIT COERCION
console.log(b) //'100'
let c = String ( a ) //EXPLICIT COERCION
console.log(c) //'100'
function logger({ getState }) {
return (next) => (action) => {
console.log('will dispatch', action)
return returnValue
}
}
const initialState = {}
const enhancers = []
const middleware = [