Skip to content

Instantly share code, notes, and snippets.

@docherty
docherty / keybase.md
Created February 23, 2018 15:55
Keybase proof

Keybase proof

I hereby claim:

  • I am docherty on github.
  • I am jamesdocherty (https://keybase.io/jamesdocherty) on keybase.
  • I have a public key ASAO8N_p_rlB6j6lZUvYedNsLa7XMQgx5nXNjCtfCZIMUQo

To claim this, I am signing this object:

@docherty
docherty / content-create.php
Created February 20, 2018 16:50 — forked from norcross/content-create.php
Functionality pieces for the NextDraft build
<?php
/**
* AJAX call for parsing HTML
*
*/
public function parse_html() {
// get content from textarea
$text = $_POST['content'];
@docherty
docherty / css-spinner.html
Last active October 20, 2017 16:52
A simple CSS spinner
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>CSS spinner</title>
<style>
.wrapper{
background-color: #000;
display: flex;
align-items: center;
@docherty
docherty / ViewController.swift
Created June 17, 2016 18:58
Adjust the size UIView to accommodate the size of its content in Swift
//
// ViewController.swift
// sizingTest
//
// A Swift version of John Erck's SO answer:
// http://stackoverflow.com/a/30511982/131385
//
import UIKit
@docherty
docherty / wordpress-firebase.php
Created May 19, 2016 19:11 — forked from derekconjar/wordpress-firebase.php
An example of using Firebase and WordPress together. The idea is to use WP's custom post types and metaboxes to make content management easy, and sync with Firebase so that your websites have access to a real-time JSON feed of your custom data.
<?php
/**
* All custom functions should be defined in this class
* and tied to WP hooks/filters w/in the constructor method
*/
class Custom_Functions {
// Custom metaboxes and fields configuration
@docherty
docherty / ionic-cli-ios-simulator-versions.md
Last active February 3, 2016 22:46
Ionic CLI commands for targeting different ios simulator versions

Should be self explanatory - stored here for easy copy and paste

ios-sim showdevicetypes

ionic run ios -lc --target="iPhone-4s, 8.1"

ionic run ios -lc --target="iPhone-6, 9.2"

@docherty
docherty / build-extra.gradle
Last active August 28, 2015 09:03
Fix for Cordova android release build translation errors
// JMD addition to stop release build errors caused by missing translations when running this command:
// $ ionic build --release android or $ cordova build --release android
android {
lintOptions {
disable 'MissingTranslation'
disable 'ExtraTranslation'
}
}
@docherty
docherty / iBeacon test controller.js
Created August 26, 2015 20:54
A test Ionic controller to check Cordova iBeacon plugin performance on Android
// JMD iBeacon test
angular.module('beacon-test.controllers',[])
.controller('MainCtrl', ['$scope', '$window', 'localNotification', function ($scope, $window, localNotification){
//console.log('MainCtrl is loaded.');
$scope.ifurl = "";
// functions called by UI buttons
$scope.startMonitoring = function () {
for(i=0; i< $scope.beaconRegions.length; i++){
var beaconRegion = $window.cordova.plugins.locationManager.Regions.fromJson($scope.beaconRegions[i]);

With the parse.com cordova plugin installed there is an error in Xcode

If you're not using a library which requires the -ObjC linker flag, you can remove -ObjC from your project: Build Settings > Other Linker Flags > remove -ObjC or if you are using a library which requires that flag, you can add the Facebook SDK.

In addition: There is a problem if you remove the -ObjC linker switch. The libCordova.a library specifies some categories on NSString which will not get loaded if -ObjC is removed. A work around is to remove libCordova.a from the linked frameworks and add this to the Other Linker Flags build setting: