Skip to content

Instantly share code, notes, and snippets.

View brennanMKE's full-sized avatar

Brennan Stehling brennanMKE

View GitHub Profile
@IanKeen
IanKeen / KeyPathAccessible.swift
Last active May 8, 2021 16:39
Naive KeyPath code for dictionaries and arrays
public protocol KeyPathComponent { }
extension String: KeyPathComponent { }
extension Int: KeyPathComponent { }
public protocol KeyPathAccessible {
func value<T>(at component: KeyPathComponent) -> T?
}
extension KeyPathAccessible {
@khanlou
khanlou / CleanUpGit.md
Last active July 7, 2021 08:08
Clean up all merged branches

To clean up git, run:

git remote prune origin; git branch --merged | grep -v '^* master$' | grep -v '^  master$' | xargs git branch -d

If it doesn't like that because it thinks the repo is not there, change the remote from http://github.com to http://khanlou@github.com

@mminer
mminer / MyService.swift
Last active April 23, 2024 23:00
Components of XPC service.
import Foundation
class MyService: NSObject, MyServiceProtocol {
func upperCaseString(_ string: String, withReply reply: @escaping (String) -> Void) {
let response = string.uppercased()
reply(response)
}
}
@jonschlinkert
jonschlinkert / basic.md
Created August 25, 2013 22:49
Different Gruntfile configurations for Assemble.
module.exports = function(grunt) {
  // Project configuration.
  grunt.initConfig({
    // Build HTML from templates and data
    assemble: {
      options: {
        flatten: true,
        assets: 'dist/assets',
 partials: ['templates/includes/*.hbs'],