- Download as zip
yarn
parcel index.html
- Open browser http://localhost:1234
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 { Parser } from 'expr-eval' | |
import toposort from 'toposort' | |
const parser = new Parser() | |
const get_deps = expr => expr.symbols({ withMembers: true }) | |
.filter(dep => dep.startsWith('collections.')) | |
.map(dep => dep.slice('collections.'.length)) | |
const check = (manual, dynamic) => { |
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 uuid = require('uuid') | |
const guid_space = s => | |
`${s.substr(0,8)}-${s.substr(8,4)}-${s.substr(12,4)}-${s.substr(16,4)}-${s.substr(20)}` | |
module.exports = { | |
all: async (notion, url) => { | |
const [id, collectionViewId] = url.split('/').slice(-1)[0].split('?v=') | |
.map(guid_space) | |
const collectionId = (await notion.getRecordValues({ |
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 an ssh public key to encrypt content that can only be unencrypted with the ssh private key | |
// Internally shares an AES key for the main content. | |
const sshpk = require('sshpk') | |
const fs = require('fs').promises | |
const { | |
publicEncrypt, | |
privateDecrypt, | |
generateKeySync, | |
randomFillSync, | |
createCipheriv, |
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
// Open Office365 Admin https://admin.microsoft.com/ | |
// On the left hand menu click show all and click Azure Active Directory | |
// On the left hand menu click Azure Active Directory then click App registrations. | |
// Click New registration and type MSAL Demo for the name. Make sure Accounts in this organizational directory only is selected. | |
// Click Register and record the following: | |
// Application (client) ID | |
// Directory (tenant) ID | |
// In the left hand sub menu click Expose an API then click Add a scope | |
// Click Save and continue with the default Application ID URI | |
// In Scope name type "access_as_user" |
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/RCTBridgeModule.h> | |
#import <React/RCTLog.h> | |
@interface RCT_EXTERN_MODULE(CallSwift, NSObject) | |
RCT_EXTERN_METHOD(setUserId:(NSString *)userId token:(NSString *)token) | |
@end |
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 dc = require('discovery-channel') | |
const tls = require('tls') | |
const EventEmitter = require('events') | |
// const server1 = discovery({ | |
// id: 'server1', | |
// port: 19898, | |
// channel: 'test channel', | |
// key: fs.readFileSync('../tls/key.pem'), | |
// cert: fs.readFileSync('../tls/cert.pem'), |
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 serialport = require('serialport') | |
const bytelength = require('@serialport/parser-byte-length') | |
const delimiter = require('@serialport/parser-delimiter') | |
// serialport.list((err, ports) => { | |
// ports.forEach((port) => { | |
// console.log(port.comName) | |
// }) | |
// }) |
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
diskutil list | |
diskutil unmountDisk /dev/disk2 | |
sudo dd if=/file/path.iso of=/dev/disk2 bs=1m | |
diskutil eject /dev/disk2 |
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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<script src="https://www.webglearth.com/v2/api.js"></script> | |
<script> | |
function init() { | |
WE | |
.tileLayer('https://gist.githubusercontent.com/tcoats/87aab39d4f0e3bab2dac0f5a3eaeecef/raw/da04047425662ac94a134da1ff9914bc64fe17c5/tile{z}{x}{y}.png', { maxZoom: 0, tms: true }) | |
.addTo(new WE.map('earth', { center: [-34.26828811505704,178.0706979131573], zoom: 2 })); | |
} |