Skip to content

Instantly share code, notes, and snippets.

@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,
<unknown>:0: error: fatal error encountered while reading from module 'OrderedCollections'; please file a bug report with your project and the crash log
<unknown>:0: note: module 'OrderedCollections' full misc version is '5.3.2(5.3.2)/Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)'
*** DESERIALIZATION FAILURE (please include this section in any bug report) ***
result not found
Cross-reference to module 'OrderedCollections'
... OrderedSet
... in an extension in module 'OrderedCollections'
... Element
@heckj
heckj / script for enabling Cocoa debugging options.
Created December 7, 2010 05:20
@schwa’s script for enabling Cocoa debugging options.
-- Script to turn on Cocoa debugging options for a the active executable of an XCode project. See <Foundation/NSDebug.h>
-- For extra points change "project document 1" to whatever the right specifier for front most project document.
on createvariable(inName, inValue)
tell application "Xcode"
set theExecutable to active executable of project document 1 of application "Xcode"
if (every environment variable of theExecutable where name is inName) is {} then
make new environment variable at end of theExecutable with properties {name:inName, value:inValue, active:true}
end if
end tell