Skip to content

Instantly share code, notes, and snippets.

View belgattitude's full-sized avatar

Sébastien Vanvelthem belgattitude

View GitHub Profile
@tophtucker
tophtucker / README.md
Last active April 22, 2024 16:01
Beginning to reverse-engineer FizzyText

TOTALLY SUPER DUPER NOT MY WORK! Trying to illuminate how FizzyText (seen here, source here, isolated from dat.GUI dependency here) works. Original appears to have been written by George Michael Brower.

In the original, which I find brilliant:

  • Solid black text is drawn onto an invisible canvas, from which it gets bitmap data
  • The bitmap data is read like a collision detection array, where black means "you're on top of text" and white means "you're not"
  • Particles of size r=0 are randomly spawned on a visible canvas
  • The particles grow if they're on top of a (non-rendered) black pixel, and shrink till they disappear if not
  • When they shrink to r=0, they respawn randomly somewhere
  • The particles follow a Perlin noise flow field, a very sensible and fluid kind of random movement, in which nearby particles
@DanDiplo
DanDiplo / JS-LINQ.js
Last active April 29, 2024 10:30
JavaScript equivalents of some common C# LINQ methods. To help me remember!
// JS array equivalents to C# LINQ methods - by Dan B.
// First: This version using older JavaScript notation for universal browser support (scroll down for ES6 version):
// Here's a simple array of "person" objects
var people = [
{ name: "John", age: 20 },
{ name: "Mary", age: 35 },
{ name: "Arthur", age: 78 },
{ name: "Mike", age: 27 },
@donnierayjones
donnierayjones / LICENSE
Last active March 26, 2024 01:51
Render Bootstrap as "small" layout when printing
Copyright (C) 2016 Donnie Ray Jones
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
@ezzatron
ezzatron / num-cpus.php
Created October 28, 2011 03:53
Function to detect number of CPUs in PHP
<?php
/**
* Copyright © 2011 Erin Millard
*/
/**
* Returns the number of available CPU cores
*
* Should work for Linux, Windows, Mac & BSD