Skip to content

Instantly share code, notes, and snippets.

Joshua Nozzi jnozzi

View GitHub Profile
@jnozzi
jnozzi / StringMatrix.swift
Created May 1, 2019
Handy utility for turning a collection of strings into a characterwise matrix for comparison within columns and retrieval of substrings from column ranges. Handles simple Range<Int> <---> Range<String.Index> conversions.
View StringMatrix.swift
//
// Created by Joshua Nozzi on 4/29/19.
// Copyright © 2019 Joshua Nozzi. All rights reserved.
//
import Foundation
struct StringMatrix {
View keybase.md

Keybase proof

I hereby claim:

  • I am jnozzi on github.
  • I am joshuanozzi (https://keybase.io/joshuanozzi) on keybase.
  • I have a public key ASDSgMVGwJ2khInZwiyT7nDRGj-f4R8tuD8U3KofxgS8vQo

To claim this, I am signing this object:

@jnozzi
jnozzi / SomeObject.m
Created Jul 22, 2015
A simple test if a mounted volume or device at a given path is a disk image (DMG).
View SomeObject.m
#import <DiskArbitration/DiskArbitration.h>
// ...
- (BOOL)isDMGVolumeAtURL:(NSURL *)url
{
BOOL isDMG = NO;
if (url.isFileURL) {
DASessionRef session = DASessionCreate(kCFAllocatorDefault);
@jnozzi
jnozzi / NSURL+FavoritesList.h
Last active Jul 11, 2016
NSURL category that provides a simple way to append a fileURL to the end of favorite items or favorite volumes list used in the side bars seen in Finder and the open and save dialog boxes.
View NSURL+FavoritesList.h
//
// NSURL+FavoritesList.h
// FavoritesListTester
//
// Appends the URL to the end of the Favorite Items or Favorite Volumes list
// (found in the side bar of Finder windows and open/save dialogs, etc.)
//
// Notes:
//
// 1. Must be a file URL.
You can’t perform that action at this time.