This file contains 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
{ | |
"$schema": "http://json-schema.org/draft-07/schema#", | |
"title": "MessageCard", | |
"type": "object", | |
"required": [ | |
"@type", | |
"@context" | |
], | |
"properties": { | |
"@type": { |
This file contains 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
#!/bin/bash | |
# region Load environment variables from .env file | |
if [ -f .env ]; then | |
set -a | |
source .env | |
set +a | |
fi | |
# endregion |
This file contains 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
.rotatedTooltip { | |
display: none; | |
&.show { | |
display: block; | |
} | |
.arrow { | |
position: absolute; | |
display: block; |
This file contains 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, { useContext, useRef, useState } from 'react' | |
import { DatePicker, MuiPickersContext } from '@material-ui/pickers' | |
import withStyles from '@material-ui/core/styles/withStyles' | |
import clsx from "clsx"; | |
import { useStyles as dayStyles } from '@material-ui/pickers/views/Calendar/Day'; | |
function DateRangePicker({ | |
classes, | |
value, | |
onChange, |
This file contains 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
-- 60 * 60 * 24 = 86400 // number of seconds in day | |
WITH range AS (SELECT *, | |
EXTRACT(EPOCH FROM min) min_e, | |
EXTRACT(EPOCH FROM max) max_e | |
FROM | |
(SELECT min(date) AS min, max(date) AS max FROM prices) s) | |
SELECT | |
CASE WHEN prev_d <> min_e AND date <> g | |
THEN ROUND((m * g + ((price + prev_p) - m * (date + prev_d)) / 2)::NUMERIC, 2) | |
ELSE price END price, |
This file contains 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
/* DOCUMENT INFORMATION | |
- Author: Dominik Maszczyk | |
- Email: Skitionek@gmail.com | |
- Created: 2019-09-10 | |
- Adapted from: https://bost.ocks.org/mike/simplify/ | |
*/ | |
const simplify = function( | |
points, | |
{ accessor_x = d => d.x, accessor_y = d => d.y, number_of_samples = 100 } = {} |
This file contains 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
#!/usr/bin/env bash | |
#source :https://stackoverflow.com/questions/57006043/get-the-git-commit-hash-of-the-last-commit-which-affected-files-not-listed-in-a | |
#maintain :Dominik Maszczyk | |
#date :2019-07-31 | |
#email :Skitionek@gmail.com | |
#============================================================================== | |
DIR=$(mktemp -d) | |
pushd $DIR > /dev/null | |
# Set up a temporary git repository so we can use | |
# git check-ignore with .dockerignore |
This file contains 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
function traverseSchema(node) { | |
// schema.getQueryType().getFields().Stock.type.getFields().data.type.ofType.getFields().adjustedClose.type.name | |
if (node instanceof GraphQLSchema) { | |
return { | |
query: traverseSchema(node.getQueryType()) | |
} | |
} | |
if (node instanceof GraphQLList) { | |
const check = traverseSchema(node.ofType); | |
// console.log(check); |
This file contains 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 { spawn } = require('child_process'); | |
const args = process.argv.slice(2); | |
const child = spawn('tree',['-f', '--', args[0] || '.']); | |
child.stdout.setEncoding('utf8'); | |
child.stdout.on('data', (chunk) => { | |
const lines = chunk.split(/\n/g).filter(line=>line!==''&&!line.match(/^\d/)); | |
lines.forEach(line=>console.log(line.replace(/([^ \n]*?)([^ /\n]*)$/,'[$2]($1$2)'))); | |
}); | |
/* |
NewerOlder