Skip to content

Instantly share code, notes, and snippets.

View StuartMorris0's full-sized avatar

Stuart Morris StuartMorris0

View GitHub Profile
StuartMorris0 / emptyOrderHistory.json
Last active March 10, 2020 22:25
"orders": []
StuartMorris0 / functions.php
Created July 3, 2019 20:16
Functions PHP - Example for WP Job Manager
* @author Divi Space
* @copyright 2017
if (!defined('ABSPATH')) die();
function ds_ct_enqueue_parent() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); }
function ds_ct_loadjs() {
[UIView animateKeyframesWithDuration:5.0 delay:0.0 options:0 animations:^{
[UIView addKeyframeWithRelativeStartTime:0.0 relativeDuration:0.5 animations:^{
self.verticalPosition.constant = 200.0;
[self.view layoutIfNeeded];
[UIView addKeyframeWithRelativeStartTime:0.5 relativeDuration:0.25 animations:^{
self.verticalPosition.constant = 50.0;
[self.view layoutIfNeeded];
[UIView addKeyframeWithRelativeStartTime:0.75 relativeDuration:0.125 animations:^{
StuartMorris0 / Swift-find-constraint-by-identifier.swift
Created March 23, 2016 16:29
Get reference to a constraint by filtering through all constraints looking for a specific identifier in Swift
let foregroundTopConstraint = self.contentView.constraints.filter{ $0.identifier == "ForegroundViewTop"}.first
StuartMorris0 / POP-Completion-sytanx.swift
Created March 16, 2016 19:46
Facebook POP Completion Block Syntax Swift
myPopAnimation.completionBlock = {(animation, finished) in
//Code goes here
StuartMorris0 /
Created August 25, 2014 18:26
Hiding Selector Warnings for methods declared up the chain of responders.

With button selectors you can implement the @selector but might choose to implement the method in the View Controller and not the button subclass for example. You will receive an undeclared selector warning for this to let you know the method is not implemented but this is acceptable behaviour, so you can use the following to hide the warnings.

// Ignore undeclared selector warnings as this method is implemented in the VC
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wundeclared-selector"
[moreButton addTarget:nil action: @selector(userPressedShareBasementButton:) forControlEvents: UIControlEventTouchUpInside];

#pragma clang diagnostic pop

StuartMorris0 /
Last active December 26, 2015 02:49
CocoaPods Cheat Sheet

Cocoa Pods Cocoapods Basic Cheat Sheet

Create a Podfile at the root of your project

platform :ios, '5.0'

pod 'AFNetworking'
pod 'OHAttributedLabel'