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 BASE_URL = "https://a.klaviyo.com/api"; | |
const baseHeaders = new Headers({ | |
accept: "application/json", | |
revision: "2023-01-24", | |
Authorization: `Klaviyo-API-Key ${process.env.KLAVIYO_API_KEY}`, | |
}); | |
const getHeaders = new Headers(baseHeaders); | |
const postHeaders = new Headers(baseHeaders); | |
postHeaders.append("Content-Type", "application/json"); |
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
query SongsContainerQuery($count: Int!, $cursor: String) { | |
viewer { | |
...SongsContainer_viewer | |
} | |
} | |
fragment SongsContainer_viewer on Query { | |
id | |
songs(first: $count, after: $cursor) | |
@connection(key: "SongsContainer_songs", filters: []) { |
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
<div>?</div> | |
div { | |
position: absolute; | |
bottom: 0; | |
right: 0; | |
} | |
* { | |
cursor: none; |
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, { useState, useEffect, useReducer } from "react"; | |
import Word from "./components/Word"; | |
import wordsLibrary from "./words"; | |
const starsSpeed = { animation: "animStar 50s linear infinite" }; | |
const reducer = (state, action) => { | |
const { type, payload } = action; | |
if (type === "addWord") { |
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
/* this function process and object x of the pair in parameters, and add this data to the existing data of the current 0 to 30sec interval. | |
after the 30 sec pass, a timeout will get the bmBuffer[pair].data and send it elsewhere, there as a constant. perhaps, but bmBuffer is a global let */ | |
let bmBuffer = {}; | |
function bmProcessPayload(x, pair) { | |
if (bmCfg.consoled.trade) { | |
consoled("trade", bmAutobotPayload(x, pair)); | |
} | |
bmBuffer[pair].data.timestamp = new Date(x.timestamp); |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>MathJS</title> | |
<meta name="description" content="MathJS" /> | |
<meta name="author" content="jenskarlsen" /> | |
<script src="./js/decimal.js"></script> | |
<script> | |
Decimal.set({ precision: 30 }); |
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
"use strict"; | |
let websocket = require("websocket"); | |
let url = "ws://localhost:8080"; | |
let wsBitMex = new websocket.client(); | |
let retries = 0; | |
function retryConnection() { | |
if (retries < 3) { | |
setTimeout(() => { |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>Conversations</title> | |
<meta name="description" content="" /> | |
<meta name="author" content="" /> | |
<script src="https://unpkg.com/axios/dist/axios.min.js"></script> | |
<script | |
crossorigin |
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 express = require("express"); | |
const app = express(); | |
const bodyparser = require("body-parser"); | |
const conversations = [ | |
{ | |
id: "1e14ace4-7807-42a0-b542-9b99798526d2", | |
conversation: ["Hey man", "Hey whats up?", "Nothing much", "Oh thats cool"], | |
questions: [ | |
{ |
NewerOlder