Skip to content

Instantly share code, notes, and snippets.

View marcedwards's full-sized avatar

Marc Edwards marcedwards

View GitHub Profile
@marcedwards
marcedwards / colourspinner.pde
Last active January 6, 2024 07:14
A colourful loading spinner for Processing 3.3.7
// A colourful loading spinner.
// By @marcedwards from @bjango.
void setup() {
size(512, 512, P2D);
frameRate(30);
smooth(8);
noFill();
strokeWeight(10);
}
@marcedwards
marcedwards / high-dpi-media.css
Last active November 19, 2023 12:56
A CSS media query that captures almost all high DPI aware devices.
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */
@marcedwards
marcedwards / displaysizes.txt
Last active November 16, 2023 06:52
iPhone, iPad, and Apple Watch display sizes
### Points and display type
PPI is points per inch below, not pixels per inch. Not all models are listed, just the first model with a new display size. Diamond, RGB Stripe and Pentile RGB refer to the subpixel patterns.
iPhone 1 = 320×480 at 163PPI sRGB IPS LCD RGB Stripe
iPhone 4 = 320×480 at 163PPI sRGB IPS LCD RGB Stripe
iPhone 5 = 320×568 at 163PPI sRGB IPS LCD RGB Stripe
iPhone 6 = 375×667 at 163PPI sRGB IPS LCD RGB Stripe
iPhone 6 Plus = 414×736 at 153.5PPI sRGB IPS LCD RGB Stripe
iPhone 7 = 375×667 at 163PPI P3 IPS LCD RGB Stripe
@marcedwards
marcedwards / circlesofdots.pde
Created June 28, 2019 10:43
Circles of dots in Processing
//
// Circles of dots.
// Created using Processing 3.5.3.
//
// Code by @marcedwards from @bjango.
//
// A GIF of this code can be seen here:
// https://twitter.com/marcedwards/status/1144236924095234053
//
@marcedwards
marcedwards / min-device-pixel-ratio.md
Last active February 23, 2023 20:00
Device pixel ratios

Devices with -webkit-min-device-pixel-ratio: 1.0

  • All non-Retina Macs
  • Apple iPhone (1st generation)
  • Apple iPhone 3G
  • Apple iPhone 3GS
  • Apple iPad (1st generation)
  • Apple iPad 2
  • Apple iPad mini (1st generation)
  • Acer Iconia A500
@marcedwards
marcedwards / zoomingspiral.pde
Last active November 16, 2022 07:39
Zooming spiral in Processing
//
// Zooming spiral.
// Created using Processing 3.5.3.
//
// Code by @marcedwards from @bjango.
//
// A GIF of this code can be seen here:
// https://twitter.com/marcedwards/status/1152906086615117824
//
@marcedwards
marcedwards / cubesanddiamonds.pde
Last active October 25, 2021 06:40
Cubes and diamonds
//
// Cubes and diamonds.
// Created using Processing 3.5.3.
//
// Code by @marcedwards from @bjango.
//
// A GIF of this code can be seen here:
// https://twitter.com/marcedwards/status/1167765622899347459
//
@marcedwards
marcedwards / accumulation.pde
Last active June 1, 2021 07:14
Perlin noise and accumulation in Processing
//
// Perlin noise and accumulation.
// Created using Processing 4.0a3.
//
// Code by @marcedwards from @bjango.
//
// A GIF of this code can be seen here:
// https://twitter.com/marcedwards/status/1370206924591960065
//
@marcedwards
marcedwards / theonlywayisup.pde
Created February 6, 2021 10:39
An animated arrow using lots of points in Processing
//
// The only way is up.
// Created using Processing 4.0a3.
//
// Code by @marcedwards from @bjango.
//
// A GIF of this code can be seen here:
// https://twitter.com/marcedwards/status/1357998635447799810
//
@marcedwards
marcedwards / twister.pde
Last active April 16, 2021 12:43
A twisty 3D effect using a 2D image, created with Processing
// A sin-y, wobbly, twisty, 3D-looking thing that slices up an image to create its effect.
// For more information and to download the image required, visit:
// https://dribbble.com/shots/5843126-Twisty-3D-effect-using-a-2D-image
//
// Place the image inside a folder called “data” alongside the Processing sketch for it to work.
// Created using Processing 3.4.
//
// Code by @marcedwards from @bjango.
PImage twist;