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
| // @flow | |
| let { uniq, flatten } = require('lodash'); | |
| let chalk = require('chalk'); | |
| let dedent = require('dedent'); | |
| let { isEqual, padStart, padEnd, trimEnd } = require('lodash'); | |
| let fs = require('fs'); | |
| // NOTE CLASSIC | |
| const indent = indentLevel => (...args) => { |
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 React from 'react'; | |
| export class Form extends React.Component { | |
| state = { | |
| has_submitted: false, | |
| submit_error: null, | |
| }; | |
| render() { | |
| let { children, onSubmit, conditions } = this.props; |
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 React from 'react'; | |
| import immutagen from 'immutagen'; | |
| export let generator_render = (generator_fn) => { | |
| let { Provider, Consumer } = React.createContext(); | |
| let render_subchild = (generator, value) => { | |
| let { value: element, next: next_generator } = generator(value); | |
| return <Provider value={{ generator: next_generator }}>{element}</Provider>; | |
| }; |
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 React, { Component } from 'react'; | |
| import { isEqual, debounce } from 'lodash'; | |
| import yaml from 'js-yaml'; | |
| import Measure from 'react-measure'; | |
| import styled from 'styled-components'; | |
| import uuid from 'uuid/v1'; | |
| import md5 from 'md5'; | |
| import { Transformation2DMatrix } from './TransformationMatrix.js'; | |
| import { DocumentEvent, Absolute, Whitespace, Layer } from './Elements.js'; |
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 React from 'react'; | |
| /* | |
| Simple component that will not render anything. | |
| On mount it will bind to a document event, and it will clean up on unmount | |
| <DocumentEvent | |
| name="scroll" | |
| handler={updateScrollPosition} | |
| /> | |
| */ |
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
| 'atom-text-editor': | |
| 'cmd-;': 'editor:fold-current-row' | |
| 'cmd-\'': 'tabs:close-other-tabs' |
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
| //let REPORT_TO_PDF_URL = 'http://localhost:5000'; // For testing locally | |
| let REPORT_TO_PDF_URL = 'https://report-to-pdf.herokuapp.com'; | |
| let download_pdf_from_html = async ({ html_body, pdf_options, filename }) => { | |
| let resp = await fetch(`${REPORT_TO_PDF_URL}/request_pdf_path`, { | |
| method: 'POST', | |
| headers: { | |
| 'Content-Type': 'application/json', | |
| }, | |
| body: JSON.stringify({ html_body, pdf_options, filename }), |
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
| // @flow | |
| import React from 'react'; | |
| import shallowEqual from 'shallowequal'; | |
| /* | |
| // Weird example, but I hope you get the point | |
| <Compose | |
| toggle={fn => | |
| <State initialValue={false} children={(value, change) => ({ value, change })} /> |
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
| // @flow | |
| const useful_times = { | |
| ten_am_monday: 1500884100000, | |
| }; | |
| // '2017-07-27T21:29:45.301' | |
| const base_time_timestamp = useful_times.ten_am_monday; | |
| const Original_Date = Date; |
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 React from 'react'; | |
| import RNFetchBlob from 'react-native-fetch-blob'; | |
| import { EmptyC, Lifecycle } from '@ubutler/utils/MetaComponents'; | |
| import { RemoteMethod } from '../../MeteorComponents'; | |
| const chatapp_get_jpeg_upload_method = { | |
| remote: (meteor, token) => { | |
| return meteor.method({ | |
| name: 'chatapp_get_jpeg_upload', |