Skip to content

Instantly share code, notes, and snippets.

Avatar

Mitchell Porter mitchellporter

View GitHub Profile
@mitchellporter
mitchellporter / README.md
Created May 30, 2019 — forked from acrookston/README.md
Xcode pre-action to build custom Info.plist
View README.md

Automatic build versions from git in Xcode (and other goodies)

Installation procedure for pre-build actions to automatically populate Xcode Info.plist with dynamic data.

1. Xcode Scheme pre-action

Edit Xcode Scheme and add a pre-action script. Copy the contents of preaction.sh into the pre-action script box.

@mitchellporter
mitchellporter / async-await.js
Created Jun 6, 2017
async/await IIFE snippet
View async-await.js
(async () => {
const func = () => {
return new Promise((resolve, reject) => {
setTimeout(() => {
resolve('some async result');
}, 5000);
});
}
@mitchellporter
mitchellporter / README.md
Created Jan 30, 2020 — forked from nikcub/README.md
Facebook PHP Source Code from August 2007
View README.md
@mitchellporter
mitchellporter / IAPHelper.txt
Created Mar 19, 2016 — forked from aaalveee/IAPHelper.txt
In App Purchase in Swift, with Receipt Validation
View IAPHelper.txt
import UIKit
import StoreKit
//MARK: SKProductsRequestDelegate
extension IAPHelpers : SKProductsRequestDelegate
{
func productsRequest(request: SKProductsRequest, didReceiveResponse response: SKProductsResponse)
{
View Mento.playground
//: Playground - noun: a place where people can play
import UIKit
class Mento: UIView {
// The thickness ratio of our mento, 1.0 being a perfect sphere.
let mentoThicknessScale: CGFloat = 0.60
let shape: UIView = {
@mitchellporter
mitchellporter / iterm2-solarized.md
Created Jul 22, 2019 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Source Code Pro Powerline + Font Awesome + [Powerlevel10k] - (macOS)
View iterm2-solarized.md

Default

Default

Powerlevel10k

Powerlevel10k

@mitchellporter
mitchellporter / README.md
Created Feb 20, 2019 — forked from pbojinov/README.md
Two way iframe communication- Check out working example here: http://pbojinov.github.io/iframe-communication/
View README.md

Two way iframe communication

The main difference between the two pages is the method of sending messages. Recieving messages is the same in both.

Parent

Send messages to iframe using iframeEl.contentWindow.postMessage Recieve messages using window.addEventListener('message')

iframe

@mitchellporter
mitchellporter / selectors.js
Created Nov 20, 2018 — forked from carolineschnapp/selectors.js
Shopify jQuery selectors.
View selectors.js
/*
To test things out, in your JavaScript console, use selector followed by
.css('outline','1px solid red');
to see what you get.
A sandbox to test all this:
https://shopify-selectors.myshopify.com/admin/themes
*/
/*====================================
Product Page and Quick View
@mitchellporter
mitchellporter / ad_account_campaigns_edge.js
Created Oct 17, 2018
Fetching ad account campaigns with Facebook Business Node.js SDK
View ad_account_campaigns_edge.js
/**
* Copyright (c) 2017-present, Facebook, Inc.
* All rights reserved.
*
* This source code is licensed under the license found in the
* LICENSE file in the root directory of this source tree.
* @flow
*/
const adsSdk = require('facebook-nodejs-ads-sdk');
You can’t perform that action at this time.