Skip to content

Instantly share code, notes, and snippets.

View dcaunt's full-sized avatar

David Snabel-Caunt dcaunt

View GitHub Profile
/*:
[Benjamin Encz at iOS Conf SG 2016]: https://youtu.be/4lUgNuaDTzA?t=13m55s "Leveraging Swift's Type System - iOS Conf SG 2016"
[Functional Snippet 13: Phantom Types]: https://www.objc.io/blog/2014/12/29/functional-snippet-13-phantom-types/
Further Reading
- [Benjamin Encz at iOS Conf SG 2016].
- [Functional Snippet 13: Phantom Types].
*/
@dcaunt
dcaunt / auth.php
Created October 21, 2010 21:36
auth.php gets a request token, redirects to twitter for user authentication callback.php receives a callback from Twitter and saves the accessToken in the session update.php sends a tweet using a raw OAuth HTTP client (and DOES work) zst.php attempts t
<?php
session_start();
set_include_path('../library');
require_once ('Zend/Loader/Autoloader.php');
Zend_Loader_Autoloader::getInstance();
$config = array(
'callbackUrl' => 'http://' . $_SERVER['HTTP_HOST'] . '/callback.php',
javascript:(function() {
var latest = document.getElementById('revisions').getElementsByTagName('a')[0].href;
var loc = 'http://www.gistdoit.com/' + latest.split('.com/')[1];
window.location = loc;
})();
@dcaunt
dcaunt / Firephp.php
Created December 8, 2009 12:07
Firephp resource for Zend_Application. For intialising log and profiling databases
<?php
/**
* @author David Caunt
* @link http://gist.github.com/251589 Github gist
*/
class My_Application_Resource_Firephp
extends Zend_Application_Resource_ResourceAbstract
{
const DEFAULT_REGISTRY_KEY = 'firephp';
@dcaunt
dcaunt / Mail.php
Created December 8, 2009 11:49
Mail resource for Zend_Application
<?php
/**
* Resource for initializing mail transport
*/
class My_Application_Resource_Mail extends Zend_Application_Resource_ResourceAbstract
{
/**
* Transport type