Skip to content

Instantly share code, notes, and snippets.

@insidegui
insidegui / lsremovearchives.sh
Created December 21, 2021 18:28
Remove Xcode app archives from macOS LaunchServices database
#!/bin/bash
# Recursivelly removes all apps from your Xcode archives from the LaunchServices database, preventing them from being used for widgets, launch at login, etc.
/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/Support/lsregister -R -f -u $HOME/Library/Developer/Xcode/Archives
@ollieatkinson
ollieatkinson / FileSystemEventStream.swift
Created October 22, 2020 10:27
sane `fsevents` in Swift
import Foundation
import Combine
public struct Event: Identifiable {
public let id: FSEventStreamEventId
public let path: String
public let flags: Flags
}
public class FileSystemEventStream {
@TigerHix
TigerHix / link.xml
Created March 29, 2020 19:25
Unity link.xml for LiteDB 5.0.5
@aras-p
aras-p / DebugNode.hlsl
Created January 3, 2020 10:37
"Print a value" custom function node code for Unity ShaderGraph
// Quick try at doing a "print value" node for Unity ShaderGraph.
// Tested on Unity 2019.2.17 with ShaderGraph 6.9.2.
//
// Use with CustomFunction node, with two inputs:
// - Vector1 Value, the value to display,
// - Vector2 UV, the UVs of area to display at.
// And one output:
// - Vector4 Color, the color.
// Function name is DoDebug.
@G710
G710 / Card.jsx
Created August 15, 2018 18:59
Quick blueprint / react-dnd implementation
// Let's make <Card text='Write the docs' /> draggable!
import * as React from "react";
import { DragSource } from "react-dnd";
/**
* Implements the drag source contract.
*/
const cardSource = {
beginDrag(props) {
@LotteMakesStuff
LotteMakesStuff / 1.md
Last active January 2, 2025 21:54
UPM: How to make a custom package

UPM: How to make a custom package So, Unity has this shiny new package manager, and you have code you want to share between projects - wouldn't it be great if we could bundle up our shared code and plug it into all the projects that need it? Let's figure out how to make our own Package!


Todo

  • Modify the project manifest
  • Make a package manifest
  • Package the manifest up with some test code
  • Try it out in Unity!

@connorjan
connorjan / shairport-sync-install.md
Last active February 24, 2025 02:10
shairport-sync installation for a Raspberry Pi
@saelo
saelo / authorize.swift
Created July 6, 2017 07:31
Simple program to interact with authd via the macOS authorization API Raw
import Foundation
let rightname = "sys.openfile.readonly./tmp/cantread.txt"
var status: OSStatus
var authref: AuthorizationRef?
let flags = AuthorizationFlags([.interactionAllowed, .extendRights, .preAuthorize])
status = AuthorizationCreate(nil, nil, flags, &authref)
assert(status == errAuthorizationSuccess)
@geniikw
geniikw / CoroutineChain.cs
Last active October 18, 2022 08:00
Unity3d, CoroutineChain
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using geniikw.CChain;
using System;
using Object = UnityEngine.Object;
#region Accessor
/*
CoroutineChain (v0.2.1) author - [email protected]
@mminer
mminer / HyperlinkTextView.swift
Last active December 28, 2024 05:50
NSTextView subclass that displays and opens hyperlinks.
// You don't necessarily need this subclass if your NSTextView is selectable.
// If it isn't though, this allows you to have an uneditable, unselectable label where links work as expected.
import AppKit
class HyperlinkTextView: NSTextView {
override func mouseDown(with event: NSEvent) {
super.mouseDown(with: event)
openClickedHyperlink(with: event)