Skip to content

Instantly share code, notes, and snippets.

View davidcoallier's full-sized avatar

David Coallier davidcoallier

View GitHub Profile

Meta

     API Documentation, generated 2011-06-23T18:10:05+01:00
     Actions      : 7
     Errors       : 4
     Output Types : 8

Actions

Meta

     API Documentation, generated 2011-06-22T16:54:50+01:00
     Actions      : 6
     Errors       : 4
     Output Types : 8

Actions

<?php
$users = array(
'f884624f' => 'Jonathan',
);
if (!isset($_GET['tag'])) {
echo '0:No';
die();
}
<?php
$users = array(
'f884624f' => 'Jonathan',
);
$received = $_GET['tag'];
if (array_key_exists($received, $users)) {
echo 'Hi ' . $users[$received];
<?php
$cacheDir = sys_get_temp_dir();
echo 'Cache Dir: ' . $cacheDir . '<br />';
$newCacheDir = $cacheDir . DIRECTORY_SEPARATOR . 'cache';
echo 'New Cache Dir: ' . $newCacheDir . '<br />';
if (!is_dir($newCacheDir)) {
mkdir($newCacheDir, 0777);
@davidcoallier
davidcoallier / tenderapp-prepopulate.php
Created March 4, 2011 18:46
How to prepopulate a link to tenderapp.
<?php
$query = http_build_query(array(
'discussion' => array(
'user_name' => 'Firstname Surname',
'user_email' => 'david@orchestra.io',
'title' => 'Some subject',
'body' => 'The description of the discussion.',
'private' => 1
)
import datetime
import os
import sys
from boto.exception import BotoServerError
import boto.ec2.cloudwatch.metric
import boto
AWS_ACCESS_KEY = "XXX"
@davidcoallier
davidcoallier / frapi.diff
Created January 17, 2011 20:44
FRAPI modifications for implementing rest
Index: RESTFrameworks.wiki
===================================================================
--- RESTFrameworks.wiki (revision 293)
+++ RESTFrameworks.wiki (working copy)
@@ -7,6 +7,7 @@
* [ActiveResource] [http://api.rubyonrails.org/classes/ActiveResource/Base.html http://www.gstatic.com/codesite/ph/images/tearoff_icon.gif] (Ruby on Rails)
* [compojureREST Compjure-REST] [http://github.com/ordnungswidrig/compojure-rest http://www.gstatic.com/codesite/ph/images/tearoff_icon.gif]
* [Exyus] [http://www.exyus.org/ http://www.gstatic.com/codesite/ph/images/tearoff_icon.gif]
+ * [FRAPI] [http://getfrapi.com http://www.gstatic.com/codesite/ph/images/tearoff_icon.gif]
* [Jersey] [http://wikis.sun.com/display/Jersey/Main http://www.gstatic.com/codesite/ph/images/tearoff_icon.gif]
@davidcoallier
davidcoallier / xss.js
Created December 7, 2010 15:48
IMG Out.
$.each($('a'), function(i, item) {
$(this).attr('href', 'http://en.wikipedia.org/wiki/Irish_Declaration_of_Independence');
});
@davidcoallier
davidcoallier / custom-back-button.m
Created November 11, 2010 13:14
A custom back button with a dismiss.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
AppListingAppDelegate *appDel = (AppListingAppDelegate *)[[UIApplication sharedApplication] delegate];
User *user = (User *)[appDel.users objectAtIndex:indexPath.row];
if (self.userView == nil) {
UserViewController *viewController = [
[UserViewController alloc]
initWithNibName:@"UserViewController" bundle:[NSBundle mainBundle]
];