Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View roblav96's full-sized avatar

Robert Laverty roblav96

View GitHub Profile
I/TSLocationManager(16259): ***
D/TSLocationManager(16259): - Unlock uuid: 5783cee6-fc86-40d3-805f-8acbd5b5508c
I/TSLocationManager(16259): - Pending sync requests: 0
I/TSLocationManager(16259): - schedulePostLocations (pending-requests: 0)
I/TSLocationManager(16259): Locked 1 records
I/TSLocationManager(16259): - createRequest: 5783cee6-fc86-40d3-805f-8acbd5b5508c
I/TSLocationManager(16259):
I/TSLocationManager(16259): ***
I/TSLocationManager(16259): * HTTP ERROR: 500
I/TSLocationManager(16259): * com.android.volley.ServerError
self.doit = function ( pos, acc ) {
var points = {
"type": "FeatureCollection",
"features": [ {
"type": "Feature",
"properties": {},
"geometry": {
"type": "Point",
"coordinates": [ -71.16437494754791,
@roblav96
roblav96 / angular-questionnaire.js
Created July 22, 2016 12:01
Robert Laverty - Angular Questionnaire
/**
*
* List three ways to communicate between modules in your Angular app. Which do you prefer and why?
*
*/
// THESE ARE NOT ORDERED FROM FAVORITE TO WORST
// I don't really have a preference to the following methods, (except factory & service) because each method has its own unique functionality.
/*=====================================
/// <reference path="./_helpers.d.ts" />
/// <reference path="./bolts.CancellationToken.d.ts" />
/// <reference path="./bolts.Continuation.d.ts" />
/// <reference path="./bolts.Task.d.ts" />
/// <reference path="./bolts.UnobservedTaskException.d.ts" />
/// <reference path="./java.lang.Exception.d.ts" />
/// <reference path="./java.lang.Object.d.ts" />
/// <reference path="./java.util.Collection.d.ts" />
/// <reference path="./java.util.concurrent.Callable.d.ts" />
/// <reference path="./java.util.concurrent.Executor.d.ts" />
NSMutableURLRequest *request = [[AFHTTPRequestSerializer serializer] multipartFormRequestWithMethod:@"POST" URLString:@"http://example.com/upload" parameters:nil constructingBodyWithBlock:^(id<AFMultipartFormData> formData) {
[formData appendPartWithFileURL:[NSURL fileURLWithPath:@"file://path/to/image.jpg"] name:@"file" fileName:@"filename.jpg" mimeType:@"image/jpeg" error:nil];
} error:nil];
AFURLSessionManager *manager = [[AFURLSessionManager alloc] initWithSessionConfiguration:[NSURLSessionConfiguration defaultSessionConfiguration]];
NSURLSessionUploadTask *uploadTask;
uploadTask = [manager
uploadTaskWithStreamedRequest:request
progress:^(NSProgress * _Nonnull uploadProgress) {
@roblav96
roblav96 / definitions.ts
Created September 9, 2016 06:43
How do I work with delegates?
declare class SSZipArchive extends NSObject {
static alloc(): SSZipArchive; // inherited from NSObject
static createZipFileAtPathWithContentsOfDirectory(path: string, directoryPath: string): boolean;
static createZipFileAtPathWithContentsOfDirectoryKeepParentDirectory(path: string, directoryPath: string, keepParentDirectory: boolean): boolean;
static createZipFileAtPathWithContentsOfDirectoryKeepParentDirectoryWithPassword(path: string, directoryPath: string, keepParentDirectory: boolean, password: string): boolean;
export class ZipDelegate
extends NSObject
implements SSZipArchiveDelegate {
static ObjCProtocols = [SSZipArchiveDelegate]
init(): ZipDelegate {
return <ZipDelegate>super.init()
}
loadImages(): Promise<any> {
let smart: PHFetchResult = PHAssetCollection.fetchAssetCollectionsWithTypeSubtypeOptions(
PHAssetCollectionType.PHAssetCollectionTypeSmartAlbum,
PHAssetCollectionSubtype.PHAssetCollectionSubtypeSmartAlbumScreenshots,
null
)
let collection: PHAssetCollection = smart.firstObject
if (!collection) {
global.tnsconsole.error('!collection')
Tesseract.tess = G8Tesseract.new()
Tesseract.tess.initWithLanguageConfigDictionaryConfigFileNamesCachesRelatedDataPathEngineMode(
'eng',
null,
null,
'',
G8OCREngineMode.TesseractOnly
)
Tesseract.tess.delegate = ZipDelegate.new()
//
import {Injectable} from "@angular/core"
import {confirm} from "ui/dialogs"
@Injectable()
export class Permissions {