Skip to content

Instantly share code, notes, and snippets.

View slice's full-sized avatar
🎯
Focusing

Skip R. slice

🎯
Focusing
View GitHub Profile
@bdash
bdash / storage-classes.scm
Last active March 17, 2025 21:02
Storage classes assigned by the macOS platform sandbox policy
;; Current as of macOS 15.1
Accessibility
Accounts
AirDrop
AirPlay
AppStoreSandboxes
AppleInstallerSandboxes
AppleMediaServices
ArchiveUtility
@bdash
bdash / action-modifiers.scm
Created December 1, 2024 21:17
macOS sandbox action modifiers, filters, and operations
;; Current as of macOS 15.1
(with send-signal …)
(with errno …)
(with report)
(with no-report)
(with no-sandbox)
(with grant)
(with sip-override)
(with no-times)
@pudquick
pudquick / brew.md
Last active April 11, 2025 08:52
Lightly "sandboxed" homebrew on macOS

brew is a bad neighbor

This isn't a guide about locking down homebrew so that it can't touch the rest of your system security-wise.

This guide doesn't fix the inherent security issues of a package management system that will literally yell at you if you try to do something about "huh, maybe it's not great my executables are writeable by my account without requiring authorization first".

But it absolutely is a guide about shoving it into its own little corner so that you can take it or leave it as you see fit, instead of just letting the project do what it likes like completely taking over permissions and ownership of a directory that might be in use by other software on your Mac and stomping all over their contents.

By following this guide you will:

  • Never have to run sudo to forcefully change permissions of some directory to be owned by your account
@LyricLy
LyricLy / dpy_citizenship_test.txt
Created January 26, 2022 18:00
dpy citizenship test
accum
accumb
accumbency
accumbent
accumber
accumulable
accumulate
accumulated
accumulates
accumulating
@ibireme
ibireme / kpc_demo.c
Last active April 13, 2025 18:57
A demo shows how to read Intel or Apple M1 CPU performance counter in macOS.
// =============================================================================
// XNU kperf/kpc demo
// Available for 64-bit Intel/Apple Silicon, macOS/iOS, with root privileges
//
//
// Demo 1 (profile a function in current thread):
// 1. Open directory '/usr/share/kpep/', find your CPU PMC database.
// M1 (Pro/Max/Ultra): /usr/share/kpep/a14.plist
// M2 (Pro/Max): /usr/share/kpep/a15.plist
// M3: /usr/share/kpep/as1.plist
@IsaacXen
IsaacXen / README.md
Last active April 12, 2025 01:49
(Almost) Every WWDC videos download links for aria2c.
@mpilquist
mpilquist / predef.scala
Last active August 26, 2021 22:15
Ammonite REPL predef for use with fs2
// Save as ~/.ammonite/predef.sc
// To use fs2 from ammonite repl, type `load.fs2` from repl prompt.
// You'll get all fs2 & cats imports, ContextShift and Timer instances
// for IO, and a globalBlocker
import $plugin.$ivy.`org.typelevel:::kind-projector:0.11.0`
if (!repl.compiler.settings.isScala213)
repl.load.apply("interp.configureCompiler(_.settings.YpartialUnification.value = true)")
@JMichaelTX
JMichaelTX / JXA Resources.md
Last active April 15, 2025 04:32
JavaScript for Automation (JXA) Resources

JXA Resources

Revised: 2019-11-28 16:16 GMT-6

JXA

This is a list of the key resources I have found useful. If you know of others, please post in a comment below, and I will add to this list.

I have tried to order this list in the order that, to me, is best for learning JXA from scratch. We all learn a bit diferently, so adjust to suit your style/needs. Please post if you have suggestions on learning JXA.

@benbalter
benbalter / gist.md
Last active October 15, 2024 15:32
Example of how to embed a Gist on GitHub Pages using Jekyll.

Here's an example of how to embed a Gist on GitHub Pages:

{% gist 5555251 %}

All you need to do is copy and paste the Gist's ID from the URL (here 5555251), and add it to a gist tag surrounded by {% and %}.

@jrus
jrus / lua-uuid.lua
Created July 29, 2012 09:26
quick lua implementation of "random" UUID
local random = math.random
local function uuid()
local template ='xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'
return string.gsub(template, '[xy]', function (c)
local v = (c == 'x') and random(0, 0xf) or random(8, 0xb)
return string.format('%x', v)
end)
end