Skip to content

Instantly share code, notes, and snippets.

View jrmuizel's full-sized avatar

Jeff Muizelaar jrmuizel

View GitHub Profile
@jrmuizel
jrmuizel / gist:cc9d8d48fb79893f39b86f1488afdff2
Last active May 23, 2025 12:40
iOS browser market share
{
"success": true,
"errors": [],
"result": {
"main": {
"timestamps": [
"2025-03-10T00:00:00Z",
"2025-03-17T00:00:00Z",
"2025-03-24T00:00:00Z",
"2025-03-31T00:00:00Z",
commit 815f5a4bd71cdd73dad134125dde89c8e6ec45bd
Author: Jeff Muizelaar <[email protected]>
Date: Fri Nov 15 10:38:17 2024 +0100
Rust flow
diff --git a/netwerk/protocol/http/nsHttpTransaction.cpp b/netwerk/protocol/http/nsHttpTransaction.cpp
index e6bba66b6fff9..ee6fc53401720 100644
--- a/netwerk/protocol/http/nsHttpTransaction.cpp
+++ b/netwerk/protocol/http/nsHttpTransaction.cpp
@jrmuizel
jrmuizel / JsonWriter.java
Created May 3, 2025 01:31
Stream string values
class StringWriter extends Writer {
public StringWriter(Writer out) {
this.out = out;
}
@Override
public void write(char[] cbuf, int off, int len) throws IOException {
for (int i = 0; i < len; i++) {
char c = cbuf[i + off];
/*
import subprocess
import os
tests_with_workers = ["Air", "Basic", "ML", "Babylon", "cdjs",
"first-inspector-code-load", "multi-inspector-code-load",
"Box2D", "octane-code-load", "crypto", "delta-blue",
"earley-boyer", "gbemu", "mandreel", "navier-stokes",
"pdfjs", "raytrace", "regexp", "richards", "splay",
"typescript", "octane-zlib", "FlightPlanner", "OfflineAssembler",
"UniPoker", "async-fs", "float-mm.c", "hash-map",
This file has been truncated, but you can view the full file.
./dist/bin/libxul.so: file format elf64-little
SYMBOL TABLE:
000000000886a8d0 l .data.rel.ro 0000000000000000 $d.2
000000000886a8d0 l O .data.rel.ro 0000000000000008 .hidden __dso_handle
000000000886a8d8 l .data.rel.ro 0000000000000000 $d
000000000886aa40 l .data.rel.ro 0000000000000000 $d
000000000886b540 l .data.rel.ro 0000000000000000 $d
000000000886b610 l .data.rel.ro 0000000000000000 $d
<!doctype html>
<style>
.child {
position: absolute;
left: 10px;
width: 50px;
height: 50px;
background: lightblue;
border: 1px solid black;
@jrmuizel
jrmuizel / profiling-python-with-perf.md
Created September 27, 2024 17:42
Profiling python with perf

Get a Python that has frame pointers enabled

CFLAGS="-fno-omit-frame-pointer -mno-omit-leaf-frame-pointer" pyenv install 3.12
pyenv shell 3.12

Run python with perf support turned on

diff --git a/build/config/compiler/pgo/BUILD.gn b/build/config/compiler/pgo/BUILD.gn
index f8293b2ef03f9..97e985cecc374 100644
--- a/build/config/compiler/pgo/BUILD.gn
+++ b/build/config/compiler/pgo/BUILD.gn
@@ -127,21 +127,21 @@ config("pgo_optimization_flags") {
# and at least some profile data always ends up being considered
# out of date, so make sure we don't error for those cases.
"-Wno-profile-instr-unprofiled",
"-Wno-profile-instr-out-of-date",
@jrmuizel
jrmuizel / test.c
Last active February 9, 2024 17:25
#include <assert.h>
#include <bsm/audit.h>
#include <bsm/audit_session.h>
int main() {
auditinfo_addr_t auditInfo;
int result = getaudit_addr(&auditInfo, sizeof(auditInfo));
assert(result == 0 );
printf("got audit result: %d, uid %d\n", result, auditInfo.ai_auid);
#include <assert.h>
#include <bsm/audit.h>
#include <bsm/audit_session.h>
int main() {
auditinfo_addr_t auditInfo;
int result = getaudit_addr(&auditInfo, sizeof(auditInfo));
assert(result == 0 );
if (auditInfo.ai_flags & AU_SESSION_FLAG_IS_INITIAL) {