Skip to content

Instantly share code, notes, and snippets.

Stuart Morris StuartMorris0

View GitHub Profile
StuartMorris0 / orderHistory.json
Last active Jul 6, 2020
orderhistory example json
View orderHistory.json
"orders": [
"orderNumber": 9613869,
"orderstatusName": "Pushed",
"orderDate": "2020-03-17T12:53:49.953",
"emailAddress": "",
"eVoucher": true,
"deliveryAddress": {
"fullName": "Mr Stuart Morris",
StuartMorris0 / functions.php
Created Jul 3, 2019
Functions PHP - Example for WP Job Manager
View functions.php
* @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() {
View UIView-animateKeyframesWithDuration-example.m
[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 Mar 23, 2016
Get reference to a constraint by filtering through all constraints looking for a specific identifier in Swift
View Swift-find-constraint-by-identifier.swift
let foregroundTopConstraint = self.contentView.constraints.filter{ $0.identifier == "ForegroundViewTop"}.first
StuartMorris0 / POP-Completion-sytanx.swift
Created Mar 16, 2016
Facebook POP Completion Block Syntax Swift
View POP-Completion-sytanx.swift
myPopAnimation.completionBlock = {(animation, finished) in
//Code goes here
StuartMorris0 /
Created Aug 25, 2014
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 Dec 26, 2015
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'
You can’t perform that action at this time.