Skip to content

Instantly share code, notes, and snippets.

View GerardSmit's full-sized avatar

Gerard Smit GerardSmit

View GitHub Profile
@SingleAccretion
SingleAccretion / MallocProfiling.md
Last active September 7, 2025 11:21
[NativeAOT-LLVM] WASI SDK malloc profiling with stack traces

!!!WARNING!!! FOR DEMOSTRATION PURPOSES ONLY !!!WARNING!!!

The idea is to leverage the fact the linker will NOT error out with duplicate symbol definition if it doesn't need to touch the libc's dlmalloc.o.

Csproj:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>exe</OutputType>
    <TargetFramework>net10.0</TargetFramework>

State management

Use mobx in strict mode for state management and follow the flux architecture. This yields a unidirectional data flow:

state -> view -> action -> state

This creates a natural separation between view and state, which simplifies testing and makes the flow of code easier to follow.

Using state

@stuart11n
stuart11n / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
@eligrey
eligrey / README.md
Last active September 2, 2019 20:34
Get the current script URL
@elidupuis
elidupuis / handlebars-helpers.js
Last active December 7, 2021 02:24
Simple Handlebars.js helpers
/*! ******************************
Handlebars helpers
*******************************/
// debug helper
// usage: {{debug}} or {{debug someValue}}
// from: @commondream (http://thinkvitamin.com/code/handlebars-js-part-3-tips-and-tricks/)
Handlebars.registerHelper("debug", function(optionalValue) {
console.log("Current Context");
console.log("====================");