Skip to content

Instantly share code, notes, and snippets.

View mystroken's full-sized avatar
🍊

Mystro Ken mystroken

🍊
View GitHub Profile
@HoussemNasri
HoussemNasri / BalsamiqForever.py
Last active April 17, 2025 08:09
Extend your trial period for Balsamiq Wireframes on Windows and macOS Forever!
import json
import os
import time
import webbrowser
import sys
import re
def handleWindows(extra_seconds):
print("OS : Windows")
@SuddenDev
SuddenDev / !useLocoScroll.js
Last active October 26, 2022 10:54
React (Gatsby) + Locomotive Scroll + Greensock (Gsap) + Scrolltrigger
// <DIR>/src/hooks/useLocoScroll.js
import gsap from "gsap";
import ScrollTrigger from "gsap/ScrollTrigger";
import { useEffect } from "react";
import LocomotiveScroll from "locomotive-scroll";
// REPLACE THIS WITH YOUR STYLES
import "@styles/locomotive-scroll.scss";
@aleclarson
aleclarson / rollup-typescript.md
Last active February 28, 2025 16:13
The best Rollup config for TypeScript libraries

It's 2024. You should use tsup instead of this.


Features

🔥 Blazing fast builds
😇 CommonJS bundle
🌲 .mjs bundle
.d.ts bundle + type-checking

@slikts
slikts / react-memo-children.md
Last active November 20, 2024 15:48
Why using the `children` prop makes `React.memo()` not work

nelabs.dev

Why using the children prop makes React.memo() not work

I've recently ran into a pitfall of [React.memo()][memo] that seems generally overlooked; skimming over the top results in Google just finds it mentioned in passing in a [React issue][regit], but not in the [FAQ] or API [overview][react-api], and not in the articles that set out to explain React.memo() (at least the ones I looked at). The issue is specifically that nesting children defeats memoization, unless the children are just plain text. To give a simplified code example:

const Memoized = React.memo(({ children }) => (<div>{children}</div>));
// Won't ever re-render
<Memoized>bar</Memoized>
// Will re-render every time; the memoization does nothing
Chapter 02. Your First Step with WebGL<br>
ch02/HelloCanvas: https://jsfiddle.net/8Observer8/2gky294r/<br>
ch02/HelloPoint1: https://jsfiddle.net/8Observer8/cc72u1u5/<br>
ch02/HelloPoint2: https://jsfiddle.net/8Observer8/uxw657ud/<br>
ch02/ClickedPoints: https://jsfiddle.net/8Observer8/xf4fnc0o/<br>
ch02/ColoredPoints: https://jsfiddle.net/8Observer8/gkkmnpga/<br>
Chapter 03. Drawing and Transforming Triangles<br>
ch03/MultiPoint: https://jsfiddle.net/8Observer8/cty1120m/<br>
ch03/HelloTriangle: https://jsfiddle.net/8Observer8/wk4sksnw/<br>
@teoyoung
teoyoung / must-see
Last active September 30, 2024 09:00
WebGl courses + tutorials
---------------------------------------
1. Great GLSL course
https://thebookofshaders.com/
https://thebookofshaders.com/?lan=ru (russian language)
2. WebGl basics
https://webglfundamentals.org
https://webglfundamentals.org/webgl/lessons/ru (russian language)
@luruke
luruke / PostFX.js
Last active January 13, 2024 09:05
Simple example of postprocessing in three.js
/*
To use it, simply declare:
`const post = new PostFX(rendering);`
Then on update, instead of:
`rendering.render(scene, camera);`
replace with:
`post.render(scene, camera);`
*/
import {
@felipenmoura
felipenmoura / animatedScrollTo.js
Last active February 20, 2025 20:31 — forked from joshbeckman/animatedScrollTo.js
ScrollTo animation using pure javascript and no jquery
/**
* Will gracefuly scroll the page
* This function will scroll the page using
* an `ease-in-out` effect.
*
* You can use it to scroll to a given element, as well.
* To do so, pass the element instead of a number as the position.
* Optionally, you can pass a `queryString` for an element selector.
*
* The default duration is half a second (500ms)
@remarkablemark
remarkablemark / spy-resize-event.test.js
Created June 13, 2018 19:20
How to spy on window resize event in test.
const spy = jest.fn(); // or `jasmine.createSpy()`
const testWidth = 420;
beforeAll(() => {
window.addEventListener('resize', spy);
});
it('does not fire resize event by default', () => {
expect(spy).not.toHaveBeenCalled();
expect(window.innerWidth).not.toBe(testWidth);
@HoldOffHunger
HoldOffHunger / bradvin.social.share.urls.txt
Last active April 16, 2025 06:44
Social Share URL's (Summary)
https://www.facebook.com/sharer.php?u={url}
https://www.facebook.com/dialog/share?app_id={app_id}&display={page_type}&href={url}&redirect_uri={redirect_url}
https://reddit.com/submit?url={url}&title={title}
https://twitter.com/intent/tweet?url={url}&text={title}&via={user_id}&hashtags={hash_tags}
https://www.linkedin.com/sharing/share-offsite/?url={url}
https://api.whatsapp.com/send?phone={phone_number}&text={title}%20{url}
https://www.tumblr.com/widgets/share/tool?canonicalUrl={url}&title={title}&caption={text}&tags={hash_tags}
http://pinterest.com/pin/create/button/?url={url}
https://www.blogger.com/blog-this.g?u={url}&n={title}&t={text}
https://www.evernote.com/clip.action?url={url}&title={title}