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
openapi: 3.0.3 | |
info: | |
title: GuestJourneyAI REST API | |
version: 0.0.1 | |
description: Developer facing REST API for the hotel recommender system, ready to be integrated into your application | |
servers: | |
- url: https://journey.yanovis.com | |
description: Production Deployment | |
- url: https://journey-staging.yanovis.com |
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
function executeAlarm() { | |
// Create new audio context | |
var audioContext = new (window.AudioContext || window.webkitAudioContext)(); | |
// Create OscillatorNode to represent the tone | |
var oscillator = audioContext.createOscillator(); | |
// Define the type of wave the oscillator will output | |
oscillator.type = 'square'; |
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
interface ExecutionTime { | |
fnName: string; | |
totalTime: number; | |
hitCount: number; | |
} | |
const executionTimes: ExecutionTime[] = []; | |
async function measureExecutionTime<T>( | |
fn: (...args: any[]) => Promise<T>, |
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 { CmsEditorFieldTypePlugin } from "@webiny/app-headless-cms/types"; | |
import { Grid, Cell } from "@webiny/ui/Grid"; | |
import { Typography } from "@webiny/ui/Typography"; | |
import { Select } from "@webiny/ui/Select"; | |
import { Input } from "@webiny/ui/Input"; | |
import { i18n } from "@webiny/app/i18n"; | |
const t = i18n.ns("app-headless-cms/admin/fields"); | |
import { ReactComponent as TextIcon } from "./round-text_fields-24px.svg"; |
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 { CmsEditorFieldTypePlugin } from "@webiny/app-headless-cms/types"; | |
import { Grid, Cell } from "@webiny/ui/Grid"; | |
import { Typography } from "@webiny/ui/Typography"; | |
import { Select } from "@webiny/ui/Select"; | |
import { Input } from "@webiny/ui/Input"; | |
import { i18n } from "@webiny/app/i18n"; | |
const t = i18n.ns("app-headless-cms/admin/fields"); | |
import { ReactComponent as TextIcon } from "./round-text_fields-24px.svg"; |
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
/** Play around and try to convert a website into re-usable React components */ | |
// Code from https://github.com/scriptify/statikk-converter/ | |
(() => { | |
const $ = document.querySelectorAll.bind(document); | |
function extractElements() { | |
const allElements = $('body *'); | |
const allStatikkElements = []; | |
for (const elem of allElements) { | |
allStatikkElements.push(domToStatikk(elem)); |
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 audioCtx = new (window.AudioContext || window.webkitAudioContext || window.audioContext); | |
function beep(duration, frequency, volume, type, callback) { | |
const oscillator = audioCtx.createOscillator(); | |
const gainNode = audioCtx.createGain(); | |
oscillator.connect(gainNode); | |
gainNode.connect(audioCtx.destination); |
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 defaultArea = [ | |
{ x: 1.51, y: 0, z: -1.98 }, | |
{ x: -0.17, y: 0, z: -1.96 }, | |
{ x: -0.06, y: 0, z: 0.06 }, | |
{ x: 1.36, y: 0, z: 0.73 } | |
]; | |
//determinant of matrix a | |
function det(a) { | |
return ( |
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
function waitUntilValueChanges(domElem) { | |
return new Promise(resolve => { | |
let prevVal = domElem.value; | |
const inter = setInterval(() => { | |
if (domElem.value !== prevVal) { | |
clearInterval(inter); | |
return resolve(); | |
} | |
prevVal = domElem.value + ''; | |
}, 100); |
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
//determinant of matrix a | |
function det(a) { | |
return ( | |
a[0][0] * a[1][1] * a[2][2] + | |
a[0][1] * a[1][2] * a[2][0] + | |
a[0][2] * a[1][0] * a[2][1] - | |
a[0][2] * a[1][1] * a[2][0] - | |
a[0][1] * a[1][0] * a[2][2] - | |
a[0][0] * a[1][2] * a[2][1] | |
); |
NewerOlder