Skip to content

Instantly share code, notes, and snippets.

@MaddTheSane
MaddTheSane / XAttrEncoding.m
Last active August 29, 2015 14:08 — forked from mwaterfall/gist:543667
Get/set the NSString text encoding of a file using xattr.
//
// NSString+FileTextEncodingAttribute.h
// Adapted from http://github.com/scrod/nv/blob/master/NSString_NV.m
//
#import <Foundation/Foundation.h>
#include <sys/xattr.h>
@interface NSString (FileTextEncodingAttribute)
//
// Glob.swift
//
// Created by Brad Grzesiak on 6/25/15.
// Copyright © 2015 Bendyworks Inc.
// Released under the Apache v2 License.
//
import Foundation
@MaddTheSane
MaddTheSane / PreferencesManager.m
Last active April 15, 2019 03:32 — forked from boyvanamstel/PreferencesManager.c
Objective-C class to loop through startup items with Automatic Reference Counting (ARC) enabled
// Based on http://www.bdunagan.com/2010/09/25/cocoa-tip-enabling-launch-on-startup/
// Almost automatic convert to ARC, might need tweaking.
#import "PreferencesManager.h"
@implementation PreferencesManager
// MIT license
- (BOOL)isLaunchAtStartup {
// See if the app is currently in LoginItems.