Skip to content

Instantly share code, notes, and snippets.

View jlott1's full-sized avatar

Jonathan Lott jlott1

View GitHub Profile
@jlott1
jlott1 / get_title_and_url.applescript
Created April 28, 2016 04:24 — forked from vitorgalvao/Get Title and URL.applescript
Applescript to get frontmost tab’s url and title of various browsers.
# Keep in mind that when asking for a `return` after another, only the first one will be output.
# This example is meant as a simple starting point, to show how to get the information in the simplest available way.
# Google Chrome
tell application "Google Chrome" to return URL of active tab of front window
tell application "Google Chrome" to return title of active tab of front window
# Google Chrome Canary
tell application "Google Chrome Canary" to return URL of active tab of front window
tell application "Google Chrome Canary" to return title of active tab of front window
# Chromium
@jlott1
jlott1 / NSString+StringContents.h
Created August 6, 2015 07:02
NSString Category for search string contents
//NOTE: containsString is implemented in iOS 8 and later by Apple
// Please use this version if trying to support iOS 7 and below
@interface NSString (StringContents)
- (BOOL)containsString:(NSString*)substring;
- (BOOL)containsString:(NSString*)substring ignoreCase:(BOOL)ignoreCase;
- (BOOL)containsFormat:(NSString*)regex;
@end
@jlott1
jlott1 / UIView+FindUIViewController.h
Created June 30, 2015 16:17
UIView Category for locating the UIViewController container for a UIView AND also getting the property name for a UIView....VERY VERY Useful
//
// UIView+FindUIViewController.h
//
// Created by Jonathan Lott on 6/30/15.
// Copyright (c) 2015 A Lott Of Ideas. All rights reserved.
//
@interface ClassProperty : NSObject
@property (nonatomic, strong) NSString* name;
@property (nonatomic, strong) NSString* type;
//
// AppDelegate.m
// AnimationExamplesiPhone
//
// Created by Eric Allam on 10/05/2014.
#import "AppDelegate.h"
#pragma mark - UIColor Additions
#import <UIKit/UIKit.h>
#import <ImageIO/ImageIO.h>
#import <MobileCoreServices/MobileCoreServices.h>
- (void)exportAnimatedGif
{
UIImage *shacho = [UIImage imageNamed:@"shacho.png"];
UIImage *bucho = [UIImage imageNamed:@"bucho.jpeg"];
NSString *path = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:@"animated.gif"];