Skip to content

Instantly share code, notes, and snippets.

View voxpelli's full-sized avatar

Pelle Wessman voxpelli

View GitHub Profile
@JakeChampion
JakeChampion / results.md
Last active April 27, 2022 16:07
c@e js perf

Here are some results on the bench-v8 version 7 benchmark.

We did not run Splay as that uses more memory than c@e permits.

The programs were executed using Viceroy. They were run on a MacBook Pro 13inch, 2019, Core i7 @ 2.8GHz, 16 GB 2133 MHz LPDDR3.

Engine QuickJS C@E SpiderMonkey C@E
Executable size 3.9M 9.4M
Richards 112 36.8
@osy
osy / README.md
Last active August 9, 2023 12:58
UTM on Apple M1 Guides

Thanks to the work of @agraf, @KhaosT, @imbushuo, and others, we have Virtualization.framework working on M1 Macs. These [changes][1] have been merged with QEMU v5.2.0 RC3 (will rebase once the final release is out) and integrated with UTM, a brand new QEMU frontend designed in SwiftUI for iOS 14 and macOS 11.

Screenshot

Downloads

@brunobord
brunobord / _readme.md
Last active December 27, 2020 01:16
Various Digirule programs

Various Digirule 2U programs

  • d6.asm a six-sided dice roller
  • k2000.asm K2000-like flash-light.
  • k2000-loop.asm same as above, with 2 loops (This version is stored in fewer RAM slots, but it's slower because of an extra instruction).
  • fibonacci.asm a basic Fibonacci series computation, displayed on the Data LEDs. The maximum result will be 233, and then it "crashes", all Data LEDs will blink as if it was an error signal.
  • christmas.asm a XMas light using RANDA for the data LEDs + Speed for blinking delay.
  • christmas-advanced.asm Expanded version, still using a random SPEED + blinking both DATA & ADR LEDs.

How can I use this?

@voxpelli
voxpelli / template-tag-factory.js
Created January 22, 2020 14:58
A small little helper for creating a template tag where one can modify the static strings, the values and/or the final output in some way. Eg. trim some whitespaces?
/**
* @template T
* @param {T} value
* @returns {T}
*/
const passthrough = value => value;
/**
* @param {object} [options]
* @param {(value: string) => string} [options.staticCallback]
// Used in real world eg. here: https://github.com/voxpelli/node-format-microformat/blob/5381268dbcdb1aef6a5757758710e4b9f75cbea3/index.js#L72-L78
// Works
/** @typedef {null|undefined|boolean|string|number|Array} NonObject */
/**
* @template T
* @typedef {T|Promise<T>} MaybePromised
@marcedwards
marcedwards / perlintextdisplacement.pde
Created April 9, 2019 12:18
Perlin noise text displacement
//
// Perlin noise text displacement.
// Created using Processing 3.5.3.
//
// Code by @marcedwards from @bjango.
//
PGraphics textbuffer;
void setup() {

Fixing macOS 10.14, 10.15, 12

Dark main menu without the rest of dark mode

  1. Set Light mode
  2. defaults write -g NSRequiresAquaSystemAppearance -bool Yes
  3. Log out and log back in
  4. Set Dark mode
@Andarist
Andarist / cherry-pick_tree_example.md
Last active June 7, 2018 08:39
cherry-pick tree example
Input:                 Output:

.                      .
├── es                 ├── effects
│   ├── effects.js     │   └── package.json
│   ├── index.js       ├── es
│   └── utils.js       │   ├── effects.js
├── lib                │   ├── index.js
│   ├── effects.js │   └── utils.js
{
"title": "Asset Metadata",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Identifies the asset to which this NFT represents",
},
"description": {
"type": "string",
@leebyron
leebyron / PriorityQueue.js
Last active January 28, 2019 05:08
PriorityQueue.js uses a binary heap to ensure the highest priority item is always available to dequeue, and sorts on enqueue. A dynamically resizing Array can be used to model the binary heap, for a simpler and more efficient implementation.
/**
* For compare function return:
* - Less than zero: item1 has higher priority than item2.
* - Zero: same.
* - Greater than zero: item1 has lower priority than item2.
*/
export type CompareFunction<T> = (item1: T, item2: T) => number;
export class PriorityQueue<T> {
_items: Array<T>;