Skip to content

Instantly share code, notes, and snippets.

var promisify = require("promisify-node");
const fseAirports = require("./icaodata-with-zones.json")
const fs = require('fs')
const sqlite = require('sqlite')
const sqlite3 = require('sqlite3')
const dbPromise = sqlite.open({
filename: 'little_navmap_navigraph.sqlite',
driver: sqlite3.Database
})
import Autocomplete from 'react-autocomplete';
import { rankWith, scopeEndsWith } from '@jsonforms/core';
import { JsonForms, withJsonFormsControlProps } from '@jsonforms/react';
import { materialCells, materialRenderers } from '@jsonforms/material-renderers';
import React from "react"
const schema = {
"type": "object",
"title": "The Root Schema",
"description": "The root schema comprises the entire JSON document.",
const Ajv = require("ajv");
const pack = require("ajv-pack");
const ajv = new Ajv({
sourceCode: true,
schemaId: "auto",
allErrors: true,
jsonPointers: true,
errorDataPath: "property",
verbose: true
});
/*
The MIT License
Copyright (c) 2017-2019 EclipseSource Munich
https://github.com/eclipsesource/jsonforms
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
import {
rankWith,
scopeEndsWith
} from '@jsonforms/core';
export default rankWith(
Number.MAX_VALUE,
(x) => {
if(!x.elements) {
return false
import * as React from 'react'
import { connect } from 'react-redux';
import { MaterialHorizontalLayout } from '@jsonforms/material-renderers'
import {
mapStateToLayoutProps
} from '@jsonforms/core';
const WithUnit = (props) => {
let uiSchema = props.uischema
uiSchema.type = "HorizontalLayout"
<Grid item key={`${path}-${index}`} xs={12} lg={6}>
<ResolvedJsonForms
uischema={child}
schema={schema}
path={path}
renderers={renderers}
/>
</Grid>
@Lily418
Lily418 / gut.sh
Last active June 20, 2019 00:13
Check the status of your gut health
#!/usr/bin/env bash
if [ "$1" = "status" ]; then
printf "Your gut seems to be healthy"
elif [ "$1" = "reset" ]; then
printf "Cleaning out your gut..."
sleep 1
printf "Please wait..."
sleep 1
printf "Please wait..."
sleep 1
@Lily418
Lily418 / get_video_times.py
Last active November 9, 2018 12:04
Python 3 script for OSX and using mediainfo to get duration and assuming file creation time is the same as the video's end date calculates the time a video was recorded.
import os
import subprocess
import sys
import datetime
filePath = sys.argv[1]
print(filePath)
# Assume file creation date is video start time, this may not be true for all platforms
# and won't be true if file had been transfered in a way which loses this infomation
videoStartTime = datetime.datetime.fromtimestamp(os.stat(sys.argv[1]).st_birthtime)