Skip to content

Instantly share code, notes, and snippets.

View Br1an-Boyle's full-sized avatar

Brian Boyle Br1an-Boyle

  • Intercom
  • Dublin, Ireland
View GitHub Profile
{
"aps": {
"alert": {
"title": "Intercom Push",
"body": "Deep Link test"
},
"sound":"default"
},
"instance_id":"1",
"intercom_push_type":"push_only",
@Br1an-Boyle
Br1an-Boyle / step.py
Last active June 11, 2022 22:42
Stepper Motor L298n
import RPi.GPIO as GPIO
import sys
import time
GPIO.setmode(GPIO.BOARD)
flow_rate_map = dict([(1, 50), (2, 100), (3, 150), (4, 200), (5, 250)])
control_pins = [15,13,11,12]
# Load the current flow rate from the local db.txt file
db = open("db.txt","r")
current_flow_rate = int(db.read().rstrip('\n'))
- (BOOL)application:(UIApplication *)application willFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[Shine setDeveloperKey:@"<Your-Dev-Key>"];
return YES;
}
header=$SRCROOT/NamespacedDependencies.h
prefix="SIGMAPOINT"
echo "Generating $header from $CODESIGNING_FOLDER_PATH..."
echo "// Namespaced Header
#ifndef __NS_SYMBOL
// We need to have multiple levels of macros here so that __NAMESPACE_PREFIX_ is
// properly replaced by the time we concatenate the namespace prefix.
@Br1an-Boyle
Br1an-Boyle / SaveContext.m
Last active August 29, 2015 14:15
Save Context
- (void)saveTempContext:(NSManagedObjectContext *)context {
NSError *error;
[context save:&error];
if (!error) {
[self saveMainContext];
}
}
- (void)saveMainContext {
[self.mainManagedObjectContext performBlock:^{
@Br1an-Boyle
Br1an-Boyle / SolutionContext.m
Last active August 29, 2015 14:15
Solution Context
- (NSManagedObjectContext *)masterManagedObjectContext {
NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator];
if (coordinator != nil) {
_masterManagedObjectContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType];
[_masterManagedObjectContext setPersistentStoreCoordinator:coordinator];
}
return _masterManagedObjectContext;
}
@Br1an-Boyle
Br1an-Boyle / WorkerContextConfig.m
Last active August 29, 2015 14:15
Worker Context Config
+ (NSManagedObjectContext *)temporaryWorkerContext {
NSManagedObjectContext *tempMOContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType];
tempMOContext.parentContext = _mainManagedObjectContext;
return tempMOContext;
}
@Br1an-Boyle
Br1an-Boyle / MainContextConfig.m
Last active August 29, 2015 14:15
Main Context Config
- (NSManagedObjectContext *)mainManagedObjectContext {
NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator];
if (coordinator != nil) {
_mainManagedObjectContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSMainQueueConcurrencyType];
[_mainManagedObjectContext setPersistentStoreCoordinator:coordinator];
}
return _mainManagedObjectContext;
}