Skip to content

Instantly share code, notes, and snippets.

@billti
billti / favicon.js
Last active August 12, 2020 21:23
Create inline GIF favicons
/* Bill Ticehurst, 2020
Emits a minimal 16 x 16 gif suitable for use as an inline favicon
GIF spec at https://www.w3.org/Graphics/GIF/spec-gif89a.txt for the structure
Favicon formats supported at https://en.wikipedia.org/wiki/Favicon
For a transparent GIF (color_table = false, depend_on_background = true) this emits:
<link rel="icon" href="data:image/gif;base64,R0lGODlhEAAQAAAAACwAAAAAAQABAAACASgAOw==">
@billti
billti / makefile
Created February 13, 2020 20:02
nmake basics
# Set up the default build type. Build for release with: nmake build=release
!IF "$(BUILD)" == "RELEASE" || "$(build)" == "release"
_BUILD=release
!ELSE
_BUILD=debug
!ENDIF
BINDIR=bin\$(_BUILD)^\
!IF !EXIST("$(BINDIR)")
@billti
billti / defaulted-exports.cpp
Created February 6, 2020 23:59
Errors with exported defaulted class members
// Compile with: cl /std:c++17 /EHsc main.cpp
#include <list>
#include <string>
#include <memory>
#include <iostream>
#if defined(DLL_EXPORT)
#define EXPORT __declspec(dllexport)
#else
@billti
billti / arm64-on-Win10.md
Last active November 1, 2024 04:48
ARM64 Linux on Win10

Below are the steps to get an ARM64 version of Ubuntu running in the QEMU emulator on Windows 10.

Install QEMU

Install for Windows from https://qemu.weilnetz.de/w64/ (I used qemu-w64-setup-20181211.exe)

Put C:\Program Files\qemu on your PATH, and run the below to check it's working (which will list out the CPUs the AArch64 emulator can emulate):

qemu-system-aarch64 -M virt -cpu help
/*
Post-processing to allow deoptigate to work with browser collected traces.
To collect a trace from a Chromium-based browser, run with flags such as the below:
%browser_exe% --no-sandbox --disable-extensions --js-flags="--trace-ic --nologfile-per-isolate --logfile=/temp/trace/v8.log" C:\temp\trace\default.html
Rename the generated `v8.log` to `v8.pre.log`, to preserve the orignal log
before processing with the below (that specific filename is expected).