Skip to content

Instantly share code, notes, and snippets.

View YuryScript's full-sized avatar
🎯
Focusing

Yury Petrov YuryScript

🎯
Focusing
View GitHub Profile
@YuryScript
YuryScript / mix.js
Last active April 11, 2021 16:39
[JS] Mix (or lerp) function
function mix(a, b, amount) {
return a + amount * (b - a)
}
@YuryScript
YuryScript / smoothstep.js
Last active April 11, 2021 16:42
[JS] Smoothstep function
function smoothstep(edgeA, edgeB, x) {
// Scale, bias and saturate x to 0..1 range
x = clamp((x - edgeA) / (edgeB - edgeA), 0, 1);
// Evaluate polynomial
return x * x * (3 - 2 * x);
}
function clamp(x, min, max) {
if (x < min)
return min
@YuryScript
YuryScript / smootherstep.js
Created April 11, 2021 16:44
[JS] Smootherstep function
function smootherstep(edgeA, edgeB, x) {
// Scale, bias and saturate x to 0..1 range
x = clamp((x - edgeA) / (edgeB - edgeA), 0, 1)
// Evaluate polynomial
return x * x * x * (x * (x * 6 - 15) + 10)
}
function clamp(x, min, max) {
if (x < min)
return min
// twitter.com | x.com member user list scapper
let tweets = []; // Initialize an empty array to hold all tweet elements
const scrollInterval = 2000;
const scrollStep = 5000; // Pixels to scroll on each step
let previousTweetCount = 0;
let unchangedCount = 0;
const scrollToEndIntervalID = setInterval(() => {
$roguerooms_zoomable $mol_view
zoom? 1
position? /
0
0
event *
wheel? <=> event_wheel? null
keypress? <=> event_key? null
mousedown? <=> event_mouse_down? null
mousemove? <=> event_mouse_move? null