Skip to content

Instantly share code, notes, and snippets.

@elyesmansour
elyesmansour / NonRecomposingSizeModifiers.kt
Created March 11, 2025 22:55
Jetpack Compose size modifiers that skip recomposition
package com.elyesmsr.sizemodifier
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.layout
import androidx.compose.ui.unit.Constraints
import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.constrain
@timvisee
timvisee / falsehoods-programming-time-list.md
Last active January 22, 2026 19:50
Falsehoods programmers believe about time, in a single list

Falsehoods programmers believe about time

This is a compiled list of falsehoods programmers tend to believe about working with time.

Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.

Falsehoods

  • There are always 24 hours in a day.
  • February is always 28 days long.
  • Any 24-hour period will always begin and end in the same day (or week, or month).
@conspect
conspect / cult_of_ignorance.md
Last active May 29, 2024 19:02
A Cult Of Ignorance, Isaac Asimov

It's hard to quarrel with that ancient justification of the free press: "America's right to know." It seems almost cruel to ask, ingeniously, "America's right to know what, please? Science? Mathematics? Economics? Foreign languages?"

None of those things, of course. In fact, one might well suppose that the popular feeling is that Americans are a lot better off without any of that tripe.

There is a cult of ignorance in the United States, and there always has been. The strain of anti-intellectualism has been a constant thread winding its way throughout political and cultural life, nurtured by the false notion that democracy means that "my ignorance is just as good as your knowledge."

Politicians have routinely striven to speak the language of Shakespeare and Milton as ungrammaticaly as possible in order to avoid offending their audiences by appearing to have gone to school. Thus, Adlai Stevenson, who incautiously allowed intelligence and learning and wit to peep out of his speeches, found the American people

@patriciogonzalezvivo
patriciogonzalezvivo / GLSL-Noise.md
Last active January 23, 2026 08:20
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);
@electronicwhisper
electronicwhisper / gist:1542452
Created December 31, 2011 01:57
Quasicrystal in Core Image
// Quasicrystal in Core Image
// port of http://mainisusuallyafunction.blogspot.com/2011/10/quasicrystals-as-sums-of-waves-in-plane.html
// HSV conversion
// adapted from http://shapeof.com/archives/2010/07/making_a_color_wheel_in_core_image.html
bool isOdd(int v) {
float dividend = float(v) / 2.0;
return dividend != floor(dividend);
}