Skip to content

Instantly share code, notes, and snippets.

View Machx's full-sized avatar

Colin Wheeler Machx

View GitHub Profile
@Machx
Machx / jsondecode.swift
Created June 26, 2023 00:02
Decode Type from JSON String
import Foundation
extension Decodable {
init(_ json: String) throws {
self = try JSONDecoder().decode(Self.self, from: json.data(using: .utf8)!)
}
}
struct Thing: Codable {
let text: String
@Machx
Machx / .lldbinit
Created May 12, 2015 03:59
lldb init
command alias uikit expr @import UIKit
command alias foundation expr @import Foundation
@Machx
Machx / gist:fe8d4533afb5d9939ecb
Created April 21, 2015 17:47
Various Books I've read
Here are some of the books I've read and liked for one reason or another
Inside the Machine by Jon Stokes
The C Programming Language by Brian Kernighan & Dennis Richte
Understanding and Using C Pointers by Richard Reese
Design Patterns by Erich Gamma, Richard Helm, Ralph Johnson & John Vlissides (Gang of Four)
Cocoa Programming for Mac OS X (Big Nerd Ranch)
Advanced Mac OS X Programming (Big Nerd Ranch)
Operating Systems Design and Implementation (The MINIX book)
The Design and Implementation of the FreeBSD Operating System by Marshall Kirk McKusick, George V. Neville-Neil

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
function fish_prompt --description 'Write out the prompt'
# Just calculate these once, to save a few cycles when displaying the prompt
if not set -q __fish_prompt_hostname
set -g __fish_prompt_hostname (hostname|cut -d . -f 1)
end
if not set -q __fish_prompt_normal
set -g __fish_prompt_normal (set_color normal)
end
# Mac OS X
*.DS_Store
# Xcode
*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
*.xcuserstate
project.xcworkspace/
#include "copyfile.h"
typedef enum {
_NotStarted = 0,
_InProgress,
_Finished,
} _State;
@implementation BAVAppDelegate
{
@Machx
Machx / mvvm-reactivecocoa-links.txt
Created January 14, 2013 04:25
Some links mentioned in MVVM/ReactiveCocoa talk for Jan Des Moines Cocoaheads Meeting
@Machx
Machx / gist:4486630
Created January 8, 2013 18:40
List off all DTrace Providers available to use only
dtrace -l | tr -d '[0-9]' | tr -s ' ' | cut -d' ' -f2 | sort -u
@Machx
Machx / gist:4392987
Last active December 10, 2015 06:08 — forked from anonymous/gist:4392908
import Cocoa;
export MyFramework.DataStructures;
//Objective-C Modules
@class Queue : NSObject
//implicitly because we are exporting group names we have a "namespace" of sorts
//which is why this class doesn't have a prefix. Since we have modules now @class
//can serve a different purpose than it currently serves