Skip to content

Instantly share code, notes, and snippets.

View nico's full-sized avatar

Nico Weber nico

  • 03:28 (UTC -04:00)
View GitHub Profile
NEVER_INLINE static ErrorOr<void> write_image_data(LittleEndianOutputBitStream& bit_stream, Bitmap const& bitmap, bool all_pixels_are_opaque)
{
for (ARGB32 pixel : bitmap) {
u8 a = pixel >> 24;
u8 r = pixel >> 16;
u8 g = pixel >> 8;
u8 b = pixel;
// We wrote a huffman table that gives every symbol 8 bits. That means we can write the image data
// out uncompressed –- but we do need to reverse the bit order of the bytes.
NEVER_INLINE static ErrorOr<void> write_image_data(LittleEndianOutputBitStream& bit_stream, Bitmap const& bitmap, PrefixCodeGroup const& prefix_code_group)
{
// Image data.
for (ARGB32 pixel : bitmap) {
u8 a = pixel >> 24;
u8 r = pixel >> 16;
u8 g = pixel >> 8;
u8 b = pixel;
TRY(prefix_code_group[0].write_symbol(bit_stream, g));
#!/bin/bash
# Assumes:
# * you have a remote 'ladybird' pointing to
# https://github.com/LadybirdBrowser/ladybird.git"
# * both origin/master and ladybird/master are up-to-date
# * you're on a branch where you want the cherry-picked commits to appear
#
# Example invocation:
# Meta/cherry-pick-ladybird-pr.sh 242
@nico
nico / FAQ.md
Created January 28, 2025 16:15 — forked from ngxson/FAQ.md
convert ARM NEON to WASM SIMD prompt

What is your setup?

Just chat.deepseek.com with prompts adapted from this gist.

Does it work in one-shot or I have to prompt it multiple times?

  • For the qX_0 variants, they are actually quite straight-forward so deepseek can come up with a correct result in 1 shot.
  • For the qX_K it's more complicated, I would say most of the time I need to re-prompt it 4 to 8 more times.
  • The most difficult was q6_K, the code never works until I ask it to only optimize one specific part, while leaving the rest intact (so it does not mess up everything)