View get-elem-coords.js
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
export default function getElemCoords(elem) { | |
var box = elem.getBoundingClientRect(); | |
var body = document.body; | |
var docEl = document.documentElement; | |
var scrollTop = window.pageYOffset || docEl.scrollTop || body.scrollTop; | |
var scrollLeft = window.pageXOffset || docEl.scrollLeft || body.scrollLeft; | |
var clientTop = docEl.clientTop || body.clientTop || 0; |
View randomIntFromInterval.js
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
export default function randomIntFromInterval(min, max) { | |
return Math.floor(Math.random() * (max - min + 1) + min) | |
} |
View delay.js
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 delay = (ms) => new Promise((r) => setTimeout(r, ms)); | |
export default delay; |
View json-to-csv.js
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
/*----------------------- | |
Imports | |
-----------------------*/ | |
import fs from "fs"; | |
import csv from "csvtojson"; | |
import path from "path"; | |
import { fileURLToPath } from "url"; | |
import { stringify } from "csv"; | |
/*----------------------- |
View recursive-api-call.js
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
// Data | |
const data = []; | |
// Recursive function to call the api in paginated batches. Depending on the api may need a limiter. | |
async function getDataRecursive(page) { | |
// Query for assets at a certain page. | |
const response = await axios.get( | |
`${apiUrl}?page=${page}&limit=250`, | |
{ | |
headers: { |
View csv-to-json.js
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
/*----------------------- | |
Imports | |
-----------------------*/ | |
import fs from "fs"; | |
import glob from "glob"; | |
import csv from "csvtojson"; | |
/*----------------------- | |
Script | |
-----------------------*/ |
View example-cart.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
{ | |
"id": 32608807518292, | |
"properties": { | |
"_version": 3, | |
"_Style": "fpg1001", | |
"_isTrackInventory": false, | |
"_trackInventoryOptions": [ | |
], | |
"_price_additional": 3000, |
View wave.vue
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
<template> | |
<div class="character-screen__vertical-wave"> | |
<svg | |
viewBox="0 0 202 1449" | |
version="1.1" | |
xmlns="http://www.w3.org/2000/svg" | |
xmlns:xlink="http://www.w3.org/1999/xlink" | |
> | |
<g | |
id="Page-1" |
View marquee.html
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 class="hero__marquee marquee"> | |
<div class="marquee__text"> | |
<!-- HTML Markup --> | |
</div> | |
<div class="marquee__text"> | |
<!-- HTML Markup --> | |
</div> | |
<div class="marquee__text"> | |
<!-- HTML Markup --> | |
</div> |
NewerOlder