Skip to content

Instantly share code, notes, and snippets.

View AtkinsSJ's full-sized avatar
🦡
That's the badger!

Sam Atkins AtkinsSJ

🦡
That's the badger!
View GitHub Profile
@AtkinsSJ
AtkinsSJ / log.txt
Created December 2, 2024 16:59
LeakSanitizer output on Ladybird CI
This file has been truncated, but you can view the full file.
=================================================================
==18523==ERROR: LeakSanitizer: detected memory leaks
Indirect leak of 243501360 byte(s) in 122 object(s) allocated from:
#0 0x7f42c64fd340 in calloc ../../../../src/libsanitizer/asan/asan_malloc_linux.cpp:77
#1 0x7f42c3fd9b18 in Gfx::Bitmap::allocate_backing_store(Gfx::BitmapFormat, Gfx::Size<int>) /home/runner/work/ladybird/ladybird/Libraries/LibGfx/Bitmap.cpp:225
#2 0x7f42c3fe8fa7 in Gfx::Bitmap::create(Gfx::BitmapFormat, Gfx::AlphaType, Gfx::Size<int>) /home/runner/work/ladybird/ladybird/Libraries/LibGfx/Bitmap.cpp:60
#3 0x7f42c46429c9 in Gfx::PNGLoadingContext::read_frames(png_struct_def*, png_info_def*) /home/runner/work/ladybird/ladybird/Libraries/LibGfx/ImageFormats/PNGLoader.cpp:278
#4 0x7f42c464c660 in Gfx::PNGImageDecoderPlugin::initialize() /home/runner/work/ladybird/ladybird/Libraries/LibGfx/ImageFormats/PNGLoader.cpp:147
#5 0x7f42c465069f in Gfx::PNGImageDecoderPlugin::create(AK::Span<unsigned char const>)
@AtkinsSJ
AtkinsSJ / Ladybird-GTK-icon.svg
Created August 24, 2023 15:53
Ladybird-GTK-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

New Path class

Paths may be arbitrary sequences of bytes, so we cannot guarantee that they are utf8 or even convertible to utf8 and back. However, we do want to be able to convert the path to utf8, and vice versa.

  • LexicalPath currently deals with manipulating paths and getting their parts. Do we roll this into Path?
  • Core::Directory deals with iteration, stat and open. Do we roll this into Path?
  • Core::DeprecatedFile has methods for other filesystem checks and operations. Do we roll this into Path?
  • Core::StandardPaths provides getters for the home directory path, and friends. Do we roll this into Path?

Rust has a Path class for a path, allowing you to access its components and query if it's a directory etc; and PathBuf class as a kind of StringBuilder thing?

@AtkinsSJ
AtkinsSJ / .gitconfig
Last active March 3, 2025 03:15
My Git settings and aliases
[user]
# ...
[alias]
# Note: This assumes two remotes:
# - origin: My fork
# - upstream: The "main" repo
#
# Also, the name of the main branch (usually "master" or "main") is read from the `var.master-branch` git config var.
# It defaults to "master". Change it for the current repo with `git config --local var.master-branch BRANCH_NAME_HERE`.
@AtkinsSJ
AtkinsSJ / DatabaseInfo.java
Last active October 6, 2016 11:03
Java code generation attempt
package uk.co.samatkins.windowcleaningassistant;
import android.content.ContentValues;
import android.database.Cursor;
import android.net.Uri;
import android.os.Parcel;
import android.os.Parcelable;
import android.provider.BaseColumns;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
@AtkinsSJ
AtkinsSJ / export_icons.bat
Last active August 29, 2015 14:27
Windows Batch File for generating drawable PNGs from SVG files using Inkscape.
setlocal EnableDelayedExpansion
@echo off
set sizes[m]=24
set sizes[h]=36
set sizes[xh]=48
set sizes[xxh]=72
set sizes[xxxh]=96
for %%f in (.\svg\*.svg) do (
@AtkinsSJ
AtkinsSJ / night.fragment.glsl
Created September 18, 2014 15:07
Problematic shader code
#ifdef GL_ES
precision mediump float;
#endif
varying vec4 v_color;
varying vec2 v_texCoords;
uniform sampler2D u_texture;
uniform vec3 u_playerPosition;
uniform float u_playerLightRangeScaled;
@AtkinsSJ
AtkinsSJ / Alternative, for ShaderToy.
Last active August 29, 2015 14:06
Basic shader that makes things dark and blueish. The Vertex shader is just a generic one. The fragment shader gets the lightness of the pixel at the right place on the texture, darkens it, and gives it a blue tint.
float lightDistance = 100.0;
void main(void)
{
vec2 uv = gl_FragCoord.xy / iResolution.xy;
uv.y = iResolution.y - uv.y;
vec4 tex = texture2D(iChannel0, uv);
// How far are we from the mouse?
float mouseDist = distance(gl_FragCoord.xy, iMouse.xy);
@AtkinsSJ
AtkinsSJ / MapGenerator.java
Created July 1, 2013 21:04
The map generation code from Beard of Bees.
package uk.co.samatkins.beebeard;
import java.util.List;
import com.badlogic.gdx.math.MathUtils;
import com.badlogic.gdx.math.Rectangle;
import uk.co.samatkins.Tilemap;
import uk.co.samatkins.beebeard.PlayScene.Tile;
private HashMap<String, String> tracks;
// ...
tracks = new HashMap<String, String>();
tracks.put("Dumb Loop", "track1.svg");
tracks.put("Dumb Loop 2", "track1.svg");
tracks.put("Dumb Loop 3", "track1.svg");
tracks.put("All these are the same", "track1.svg");