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
function getViewPercentage(element) { | |
const viewport = { | |
top: window.pageYOffset, | |
bottom: window.pageYOffset + window.innerHeight | |
}; | |
const elementBoundingRect = element.getBoundingClientRect(); | |
const elementPos = { | |
top: elementBoundingRect.y + window.pageYOffset, | |
bottom: elementBoundingRect.y + elementBoundingRect.height + window.pageYOffset |
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
/** | |
* Validates RGB(a) value | |
* @param {Number} r | |
* @param {Number} g | |
* @param {Number} b | |
* @param {Number} [a=0] | |
* @return {Boolean} | |
*/ | |
function isValidRGB(r, g, b, a) { | |
a = a || 0; |
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
/** | |
* Validates hex value | |
* @param {String} color hex color value | |
* @return {Boolean} | |
*/ | |
function isValidHex(color) { | |
if(!color || typeof color !== 'string') return false; | |
// Validate hex values | |
if(color.substring(0, 1) === '#') color = color.substring(1); |
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 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
Show hidden characters
{ | |
"$schema": "https://json.schemastore.org/tsconfig", | |
"display": "Rijk's Preferred Setup 2022", | |
"compilerOptions": { | |
"lib": ["es2022"], | |
"module": "es2022", | |
"target": "es2022", | |
"strict": true, | |
"esModuleInterop": true, | |
"skipLibCheck": true, |
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
root=true | |
[*] | |
end_of_line = lf | |
insert_final_newline = true | |
charset = utf-8 | |
indent_style = tab | |
trim_trailing_whitespace = true | |
[{package.json,*.yml,*.yaml}] |
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
/** | |
* Convert value from one range to another | |
* @param {Number} value value to convert | |
* @param {Object} oldRange min, max of values range | |
* @param {Object} newRange min, max of desired range | |
* @return {Number} value converted to other range | |
*/ | |
function convertRange(value, oldRange, newRange) { | |
return ((value - oldRange.min) * (newRange.max - newRange.min)) / (oldRange.max - oldRange.min) + newRange.min; | |
} |
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 example uses a "articles" collection with an "image" field that we only want to allow JPEGs in | |
module.exports = function registerHook({ filter, action }, { exceptions, services, logger }) { | |
const { InvalidPayloadException } = exceptions; | |
const { FilesService } = services; | |
//=============================================================================================== | |
// Make sure only JPEGs can be associated to the collection | |
const imageFieldValidator = async (payload, _meta, { database, schema }) => { | |
// Note how the "database" object is passed in from the filter handler to the service, this |
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
function debounce(callback, wait) { | |
var timeout; | |
return function() { | |
var context = this; | |
var args = arguments; | |
var later = function() { | |
timeout = null; | |
} |
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 axios = require('axios'); | |
const cache = require('memory-cache'); | |
require('dotenv').config(); | |
const api = new axios.create({ | |
baseURL: process.env.API_URL, | |
headers: { | |
'Authorization': 'Bearer ' + process.env.API_TOKEN | |
} |
NewerOlder