Skip to content

Instantly share code, notes, and snippets.

View lsh's full-sized avatar

Lukas Hermann lsh

View GitHub Profile
@johnhw
johnhw / umap_sparse.py
Last active January 6, 2024 16:09
1 million prime UMAP layout
### JHW 2018
import numpy as np
import umap
# This code from the excellent module at:
# https://stackoverflow.com/questions/4643647/fast-prime-factorization-module
import random

Index

Preface

Together with HellMood we won this year's (2016) JS1K competition and thought this might be a good opportunity to write about the development process and my motivation behind it. If you're already familiar with JS1K, feel free to skip the next two paragraphs.

@trungdq88
trungdq88 / Handling Page Transitions on Single Page Web Apps.md
Last active July 18, 2018 08:57
Handling Page Transitions on Single Page Web Apps

Handling Page Transitions on Single Page Web Apps

zoom

Real world application with a lot of pages (or "screens") have to deal with problem managing the pages' DOM and memory efficiently and at the same provide a nice smooth transition effect between pages. This is not a real problem when you do it in native apps since Android or iOS already handle the hard work for you, but when come to JavaScript, HTML, and CSS, running on mobile browsers, this is the real challenge.

There are 2 common approaches to solve this problem:

  • Approach 1: Keep all the pages in the DOM tree, use CSS (for example display) to transit between pages.
@nshelton
nshelton / GraphicsResources.md
Last active October 25, 2019 11:34
Graphics Programming / Demoscene Resources

I get a lot of requests for resources about how I learned about raymarching fractals or general computer graphics stuff. So I started this handy guide where I will add links and info about where I learned some things.

This is a non-exhaustive list I will probably add more in the future.

Reference

It used to be that you had to dig through FractalForums or pouet.net to find little nuggets of new techniques or ideas. But many smart people that have been doing much longer than I have condensed this knowledge into some articles. Here are a few that have helped me out on my journey.

Mercury Demogroup

Mercury.sexy demogroup has created a distance field library with some cool stuff in there. Except they said that fractals are boring.

@mattdesl
mattdesl / modular-three.md
Last active December 9, 2021 03:20
quick/easy ThreeJS hacking with npm

This isn't bullet-proof but here's how I've doing things lately:

modular ThreeJS quickie

  • npm install three --save
  • Include this in your browserify/webpack root script, typically your index.js:
global.THREE = require('three')
  • Add the "THREE" global to your linter (e.g. semistandard/eslintrc)
// Fragment shader
precision highp float;
varying vec2 UV;
varying vec3 v_position;
uniform float time;
uniform float ratio;
uniform vec2 mouse;
void main(void){
@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active June 29, 2024 13:05
GLSL Noise Algorithms

Please consider using http://lygia.xyz instead of copy/pasting this functions. It expand suport for voronoi, voronoise, fbm, noise, worley, noise, derivatives and much more, through simple file dependencies. Take a look to https://github.com/patriciogonzalezvivo/lygia/tree/main/generative

Generic 1,2,3 Noise

float rand(float n){return fract(sin(n) * 43758.5453123);}

float noise(float p){
	float fl = floor(p);
  float fc = fract(p);
@jamiebullock
jamiebullock / LiveAudioProcessing.swift
Created June 19, 2014 07:45
Live coding audio with Swift Playgrounds
import Cocoa
import AVFoundation
// Setup engine and node instances
var engine = AVAudioEngine()
var delay = AVAudioUnitDelay()
var reverb = AVAudioUnitReverb()
var mixer = engine.mainMixerNode
var input = engine.inputNode