I hereby claim:
- I am michaelwclark on github.
- I am michaelwclark (https://keybase.io/michaelwclark) on keybase.
- I have a public key ASDInzV3AK23fj-yZSl6b8f5wFesnhuZ3Nc_4jcfwPFagAo
To claim this, I am signing this object:
| const randomLetter = () => { | |
| const alphabet = 'abcdefghijklmnopqrstuvwxyz'; | |
| return alphabet[Math.floor(Math.random() * alphabet.length)]; | |
| } | |
| const randomNumber = () => { | |
| return Math.floor(Math.random() * 10); | |
| } | |
| const randomSymbol = () => { |
| //@version=5 | |
| indicator(title='EMA 8/21 Clouds [GENOME]', shorttitle='EMA_8_21_G', overlay=true) | |
| // EMA INPUTS | |
| emaShortInput = input.int(8, minval=1, title='EMA Short Period') | |
| emaLongInput = input.int(21, minval=1, title='EMA Long Period') | |
| // GENERATE EMAS | |
| emaShort = ta.ema(close, emaShortInput) |
I hereby claim:
To claim this, I am signing this object:
| const DbProvider = params => { | |
| console.log({params}) | |
| return {db :'db', ...params} | |
| } | |
| const LogProvider = params => { | |
| console.log({params}) | |
| return {logger: 'logger', ...params} | |
| } |
| const aspectRatio = (height, width, seperator=':')=> { | |
| const gcd = (a, b) => b === 0 ? a : gcd(b, a % b) | |
| const [h1, w1] = height < width ? [width, height] : [height, width] | |
| const divisor = gcd(h1, w1) | |
| return `${h1/divisor}${seperator}${w1/divisor}` | |
| } | |
| console.log(aspectRatio(549,500)) // 549:500 | |
| console.log(aspectRatio(1024,768)) // 4:3 |
| //reqs: | |
| // if task takes longer the X ms to complete then send a resposne to caller and continue to process task | |
| const delay = (ms = 500) => | |
| new Promise(resolve => setTimeout(resolve, ms)) | |
| const taskA = async () => { | |
| await delay(1200) | |
| console.log('task A complete') | |
| return 'A' | |
| } |
| import React, { Component } from 'react' | |
| import { connect } from 'react-redux' | |
| import { loadAccountGraph } from 'redux/actions' | |
| import { InlineLoader, ConditionalRender } from 'components' | |
| import { | |
| accountIdSelector, | |
| accountLoadingSelector, | |
| accountErrorSelector | |
| } from 'redux/selectors' | |
| import request from 'superagent-bluebird-promise' |
| import fs from 'fs' | |
| function reduceJsonToCSV (jsonData, prefix = '') { | |
| let parsedData = jsonData | |
| try { | |
| parsedData = JSON.parse(parsedData) | |
| } catch (e) {} | |
| const flatObj = Object.entries(parsedData).reduce((accum, [k, v]) => { | |
| const cellPrefix = prefix ? `${prefix}.${k}` : k |
| const flat = arr => arr.reduce((a, c) => [...a, ...c]) | |
| const unique = arr => | |
| arr.reduce((a, c) => (a.includes(c) ? [...a] : [...a, c]), []) | |
| const normalizeBy = (arr, key) => | |
| arr.reduce((a, c) => ({ [c[key]]: c, ...a }), {}) | |
| const normalizeByMongoId = arr => normalizeBy(arr, '_id') | |
| Object.entries({ flat, unique, normalizeByMongoId, normalizeBy }).map( | |
| arrayFunction => |
| const createUniqueCombinationsFromArrays = (head, ...tail) => | |
| tail.length | |
| ? head.reduce((a, x) => [...a, ...createUniqueCombinationsFromArrays(...tail).map(_=>x+_)],[]) | |
| : head | |
| const a1 = ['1','2','3','4'] | |
| const a2 = ['a','b'] | |
| const a3 = ['x','y'] | |
| const a4 = [':',',','?','!', '&'] |