Skip to content

Instantly share code, notes, and snippets.

View cassler's full-sized avatar

Darin Cassler cassler

View GitHub Profile
@petenelson
petenelson / page-api.php
Created February 6, 2013 19:14
WordPress: Create a REST API endpoint
<?php
/*
* Sample code for using WordPress as a REST API endpoint (vs AJAX Admin)
* Author: Pete Nelson @GunGeekATX
*
* 1) Create a page called API in WordPres
* 2) Create a file called page-api.php in your theme directory
* 3) Add code as-needed
*
*/
@padde
padde / gist:1216920
Created September 14, 2011 15:43
Rails Helper for Typekit integration
def typekit_include_tag apikey
javascript_include_tag("http://use.typekit.com/#{apikey}.js") +
javascript_tag("try{Typekit.load()}catch(e){}")
end
@robflaherty
robflaherty / csv-to-json.php
Created September 1, 2011 02:26
Convert CSV to JSON
<?php
/*
* Converts CSV to JSON
* Example uses Google Spreadsheet CSV feed
* csvToArray function I think I found on php.net
*/
header('Content-type: application/json');
// Set your CSV feed