Skip to content

Instantly share code, notes, and snippets.

View harrisg's full-sized avatar

Greg Harris harrisg

View GitHub Profile
@harrisg
harrisg / installSwift.sh
Last active August 10, 2024 22:18
Download and install new version of Swift on Ubuntu 22.04
#!/bin/bash
# Things you should know:
# 1. I'm a terrible bash programmer.
# 2. Call with sudo.
# 3. Pass in the url of the swift .tar.gz release from https://www.swift.org/download/ .
# 4. It checks for an existing file of the same name, and will skip the download if it already exists.
# 5. This will install the Swift directory under /opt/swift-x.y.z... and symlink that to /opt/swift .
# 6. Put /opt/swift/usr/bin in your path and you can easily upgrade Swift to a new release with this script.
# export PATH=/opt/swift/usr/bin:"${PATH}"
@harrisg
harrisg / NSTableView+Reordering.m
Created January 27, 2016 15:32 — forked from zpasternack/NSTableView+Reordering.m
Category on NSTableView for animating rows, using old and new sorted arrays as input. Updated to support items having been removed or added.
@implementation NSTableView (Reordering)
- (void) moveRowsWithOldObjects:(NSArray*)oldObjects newObjects:(NSArray*)newObjects
{
NSMutableArray* oldSortedArray = [oldObjects mutableCopy];
NSArray* newSortedArray = newObjects;
[self beginUpdates];