Skip to content

Instantly share code, notes, and snippets.

View sketchpunk's full-sized avatar
🏠
Working from home

Pedro sketchpunk

🏠
Working from home
View GitHub Profile
@sketchpunk
sketchpunk / shopify_os_alt.md
Last active January 8, 2026 23:19
Shopify Opensource Alternatives

Shopify Open Source Alternatives

General Idea

Find & Pick an opensource project that provides same or similar features to shopify. Learn the method of how to self host which ever solution is picked. Be it regular web hosting or some sort of docker hosting.

Some of these projects also provide a hosting service. They just setup a server with the project preconfigured & ready for use. At that point you are on your own on how use the web app, they will only handle the hosting side of things. This might be a good option as long as its a good hosting service.

@sketchpunk
sketchpunk / __usage.js
Last active December 29, 2025 18:31
ThreeJS GLTFLoader - Parse out skeleton & clips
// let [clips, aSkel, aGrp] = await loadAnimations( `${url}/anim/source-animation.glb` );
// let aHelper = new THREE.SkeletonHelper( aSkel.bones[0] );
// App.scene.add( aGrp || aSkel.bones[0], aHelper );
// const mixer = new THREE.AnimationMixer( new THREE.Object3D() );
// const action = this.mixer.clipAction( clips[0], aSkel.bones[0] );
// action.play();
async function loadAnimations( url ){
const tf = await new GLTFLoader().loadAsync( url );

GIST

  • Search, user:@me searchTerm
@sketchpunk
sketchpunk / hotkeys.js
Created October 16, 2025 02:27
HotKeys
// new HotKeys().reg( 'ctrl+s', e=>console.log( 'woot' ) );
export default class HotKeys{
items = [];
constructor(){ window.addEventListener( 'keydown', this.onKeyDown ); }
dispose(){ window.removeEventListener( 'keydown', this.onKeyDown ); }
reg( str, fn ){
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
import * as THREE from 'three';
export default class SkyGradientMaterial extends THREE.RawShaderMaterial {
static createBox(scl = 1): THREE.Mesh {
const geo = new THREE.BoxGeometry(2, 2, 2);
const mesh = new THREE.Mesh(geo, new SkyGradientMaterial());
mesh.scale.setScalar(scl);
return mesh;
}
@sketchpunk
sketchpunk / download.js
Created September 12, 2025 04:06
Download Text / Image
function downloadText(fName: string, txt: string) {
const blob = new Blob([txt], { type: 'text/plain;charset=utf-8;' });
const url = window.URL.createObjectURL(blob);
const link = document.createElement('a');
link.href = url;
link.download = fName;
link.target = '_blank';
// link.click();
link.dispatchEvent(new MouseEvent('click'));
@sketchpunk
sketchpunk / CustomMaterial.js
Created April 9, 2025 16:29
Raw Shader Template for Threejs
import * as THREE from 'three';
class CustomMaterial extends THREE.RawShaderMaterial {
constructor( props={} ){
super();
// Merge custom props with default options
const opts = Object.assign(
{
offset : [ 0, 1, 0 ],
@sketchpunk
sketchpunk / clone_and_dispatch_events.js
Created April 2, 2025 20:14
Clone and Dispatch Events
// Clone an event then dispatch it to an HTML Element
function dispatchClonedEvent( e: Event, elm:HTMLElement ){
if( e.type.startsWith( 'pointer' ) ){
const evt = e as PointerEvent;
elm.dispatchEvent( new PointerEvent( evt.type, {
bubbles : evt.bubbles,
cancelable : evt.cancelable,
clientX : evt.clientX,
clientY : evt.clientY,
button : evt.button,
@sketchpunk
sketchpunk / NOAAColorRamp.ts
Created February 25, 2025 13:00 — forked from kenjinp/NOAAColorRamp.ts
This is the color schema I use in https://geomancer.kenny.wtf/
export const noaaRamp = [
{ color: "#ffffff", elevation: 8000 },
{ color: "#E0D7D0", elevation: 4000 },
{ color: "#CDB99C", elevation: 2000 },
{ color: "#BA9468", elevation: 1000 },
{ color: "#9B7E43", elevation: 500 },
{ color: "#75752D", elevation: 250 },
{ color: "#456C18", elevation: 50 },
{ color: "#175515", elevation: 10 },
{ color: "#004023", elevation: 0.1 },
@sketchpunk
sketchpunk / settings.json
Last active November 26, 2025 23:54
VSCODE SETTINGS.JSON
{
"editor.tokenColorCustomizations": {
"comments": "#606060"
}
// Disable copilot
"github.copilot.enable": {
"*": false,
"plaintext": false,
"markdown": false,