Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Phil Sturgeon philsturgeon

🏠
Working from home
View GitHub Profile
View REST_Controller.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class REST_Controller extends Controller {
private $method;
private $format;
private $get_args;
private $put_args;
private $args;
View example_api.php
<?php
require(APPPATH.'/libraries/REST_Controller.php');
class Example_api extends REST_Controller {
function user_get()
{
//$user = $this->some_model->getSomething( $this->get('id') );
$user = array('id' => $this->get('id'), 'name' => 'Some Guy', 'email' => 'example@example.com');
View REST.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* @author Philip Sturgeon
* @created 04/06/2009
*/
class REST {
private $CI; // CodeIgniter instance
View Rest_test.php
<?php
class Rest_test extends Controller {
function __construct() {
parent::Controller();
$this->load->library('rest', array('server' => 'http://localhost/codeigniter/index.php/example_api/'));
}
function user_list()
View jquery.cycle.js
/*
* jQuery Cycle plugin v0.2
* Philip Sturgeon [http://philsturgeon.co.uk]
*
* Licensed under the WTFPL License
* http://sam.zoy.org/wtfpl/
*/
(function($)
{
View Matxhbox with Library Subfolders
<?php
/**
* Matchbox Loader class
*
* This file is part of Matchbox
*
* Matchbox is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
View [OLD] Video convertion library
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
* CodeIgniter
*
* An open source application development framework for PHP 4.3.2 or newer
*
* @package CodeIgniter
* @author Rick Ellis
* @copyright Copyright (c) 2006, EllisLab, Inc.
* @license http://www.codeignitor.com/user_guide/license.html
View ExternalCMS.php
<?php
/*
* ExternalCMS Class
*
* This class abstracts the functionality of intergrating HL cms based sites with external CMS's
* How did this happen? Were there no other options? WHY AM I WRITING THIS?!
*
* @author Phil Sturgeon
*/
View REST Client
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
/**
* @author Philip Sturgeon
* @created 04/06/2009
*/
class REST {
private $CI; // CodeIgniter instance
View ridiculous "day of the month" JavaScript.js
function getCorrectIndex(i, date)
{
// find out what day of the week it is
var day_of_the_week = date.substr(0,3);
// define what days correspond to which array indices
var days = new Object();
days.Mon = [0,5,10,15,20];
days.Tue = [1,6,11,16,21];
days.Wed = [2,7,12,17,22];
You can’t perform that action at this time.