Skip to content

Instantly share code, notes, and snippets.

@heckj
heckj / benchmark-comparison.md
Created October 10, 2024 20:17
FirebladeECS value types benchmarking

Benchmarking switching FirebladeECS to use value types

Comparing results between branch master and the first commit from fireblade-engine/ecs#47 (2b51eeea6e379d4c66e04dc9103b199886993694)

Host 'MacBookPro' with 8 'arm64' processors with 16 GB memory, running:
Darwin Kernel Version 24.0.0: Tue Sep 24 23:36:26 PDT 2024; root:xnu-11215.1.12~1/RELEASE_ARM64_T8103

ECSBenchmark

Swift Project

cd ~/src/swift-project/swift
./utils/update-checkout --clone-with-ssh --clean

Base build

sccache --start-server
@heckj
heckj / FormAndVStackExample.swift
Created July 12, 2022 20:57
SwiftUI contextual rendering example
// Content expanded from Form reference documentation at
// https://developer.apple.com/documentation/swiftui/form
import SwiftUI
enum ProfileImageSize {
case large
case medium
case small
}
Translated Report (Full Report Below)
-------------------------------------
Process: Safari [2490]
Path: /Volumes/VOLUME/*/Safari.app/Contents/MacOS/Safari
Identifier: com.apple.Safari
Version: 16.5 (18615.2.9.11.4)
Build Info: Safari-7615002009011004~2
Code Type: ARM-64 (Native)
Parent Process: launchd [1]
#! /usr/bin/swift
//
// - This is just some AppKit boilerplate to launch a window.
//
import AppKit
@available(OSX 10.15, *)
class AppDelegate: NSObject, NSApplicationDelegate {
let window = NSWindow()
let windowDelegate = WindowDelegate()
@heckj
heckj / gist:1187999
Created September 2, 2011 05:57
Get MAC addresses of all interfaces
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <net/if.h>
#include <ifaddrs.h>
#include <errno.h>
#include <net/if_dl.h>
#!/usr/bin/env python
from __future__ import with_statement # needed for python 2.5
from fabric.api import *
from fabric.contrib.console import confirm
# ================================================================
# NOTE:
# using this fabfile expects that you have the python utility
# fabric installed locally, ssh access to reamea.com, and your
# ssh public key associated with the account 'mboza@reamea.com'
Building with settings:
USD source directory /Users/heckj/src/USD
USD install directory /opt/local/USD
3rd-party source directory /opt/local/USD/src
3rd-party install directory /opt/local/USD
Build directory /opt/local/USD/build
CMake generator Default
CMake toolset Default
Downloader curl
@heckj
heckj / MetalWireFrameShader.metal
Created April 20, 2019 22:28
Wireframe Shader For An SCNBox Geometry
/*
Copyright © 2018 Apple Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,