Skip to content

Instantly share code, notes, and snippets.

@ericmulder
ericmulder / gist:3897504
Created October 16, 2012 06:19
NSSortDescriptor
//How to sort the following list?
//Array with NSStrings:
[NSArray arrayWithObjects:@"0.0 Title", @"1.1 Title", @"1.10 Title", @"1.11 Title", @"1.12 Title", @"1.2 Title", @"10.1 Title",@"10.11 Title",@"10.2 Title",@"2.1 Title", nil];
Solution:
NSSortDescriptor *sortDescriptor;
@ericmulder
ericmulder / fileupload.api.php
Created September 23, 2015 15:27
Wordpress JSON API Controller for media upload
<?php
/**
* Plugin Name: JSON API - Media Controller
* Version: 0.0.1
* Author: Eric Mulder
* Author URI: https://emdevelopment.nl
* Plugin URI: https://emdevelopment.nl
* Description: Extensions to the JSON API plugin, to enable file upload
* Licence: GPLv2+
*/
<?php
class BetterXMLElement extends SimpleXMLElement {
//appends this xml to a parent
public function appendToSimpleXML(SimpleXMLElement $parent) {
$toDom = dom_import_simplexml($parent);
$fromDom = dom_import_simplexml($this);
$toDom->appendChild($toDom->ownerDocument->importNode($fromDom, true));
}
@ericmulder
ericmulder / businesses.json
Last active March 25, 2024 14:08 — forked from zross/businesses.json
Leaflet.js Tips, Step 3 (markers and fitBounds)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.