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
"use strict"; | |
import Promise from 'bluebird'; | |
import _ from 'lodash'; | |
Promise.resolve({a:'a',b:2,c:True}).then(_.values); // This will work, returning ['a',2,True] (or some permutation thereof) | |
// Now let's create our own object implementing _.values(obj). | |
class Valuator { | |
values(obj) { |
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 {taskArray,completeTasks} = this.props; // These are both arrays of task ids (and nothing else) | |
const totalTaskSize = _.size(taskArray); | |
const completeTaskSize = _.size(_.intersection(taskArray, completeTasks)) // https://lodash.com/docs/4.17.5#intersection | |
const pctComplete = (completeTaskSize*1.0)/(totalTaskSize*1.0); | |
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
// Initialize the loop variables | |
let currentLine = [] // ops making up the current line | |
const content = [] // Components that we will ultimately render | |
// Map parchment attributes to React styling object | |
const attrsToStyle = (attrs) => { | |
console.warn("Don't forget to implement styling!"); | |
return {}; | |
}; |
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
onClick=>{ | |
() => this.setState({pageNumber:this.state.pageNumber+1}) | |
} |
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
Show hidden characters
{ | |
"presets": [ | |
"react-native" | |
], | |
"plugins": [ | |
"transform-strict-mode", | |
[ "auto-import", | |
{ "declarations": [ | |
{ "default": "React", "path": "react" }, | |
{ "default": "_", "path": "lodash" }, |
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
fib :: Int -> Int | |
fib 0 = 0 | |
fib 1 = 1 | |
fib 2 = 2 | |
fib i | i < 0 = error "argument to fib must be > 0" | |
fib i = fib (i-1) + fib (i-2) |
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 Promise from "bluebird"; | |
Promise.try(() => axios.get(CAREPLAN_URL)) | |
.tap(response => console.log(CAREPLAN_URL, response)) | |
.then(response => response.data) | |
.then(data => this.ds.cloneWithRows(data)) | |
.then(dataSource => this.setState({dataSource})) | |
.catch(e => console.error("Getting careplan failed", CAREPLAN_URL, e) | |
; | |
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
.ql-editor { | |
font-family: "Museo Sans"; | |
h1 { | |
font-weight: 500; | |
font-size: 22pt; | |
color: #002F5F; | |
} | |
h2 { |
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
.ql-blank { | |
@extend .d-none; | |
} |
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 print = function() { require("console").dir(it); } |