Skip to content

Instantly share code, notes, and snippets.

View melophonic's full-sized avatar

Christopher McMahon melophonic

View GitHub Profile
@melophonic
melophonic / APIManager.m
Last active July 8, 2021 19:45
Objective C APIManager singleton with sample post
#import "APIManager.h"
@implementation APIManager
+ (instancetype)shared {
static APIManager *sharedManager = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
sharedManager = [[self alloc] init];
});
@melophonic
melophonic / APIManager.h
Created July 8, 2021 19:37
Objective C APIManager singleton pattern
// APIManager.h
#import <Foundation/Foundation.h>
@interface APIManager : NSObject
+ (instancetype) shared;
@end
@melophonic
melophonic / gist:31e6d39a7bdd7950601fffc5d725a8f8
Created May 14, 2018 20:39
VBox - Unable to lock the administration directory (/var/lib/dpkg/)
sudo rm /var/lib/apt/lists/lock
sudo rm /var/lib/dpkg/lock
sudo rm /var/cache/apt/archives/lock