Skip to content

Instantly share code, notes, and snippets.

View anthonycvella's full-sized avatar

Anthony Vella anthonycvella

View GitHub Profile
// Send HTTP Response Method
function sendResponse($status, $body = '')
{
$status_header = 'HTTP/1.1 ' . $status;
header($status_header);
header('Content-type: application/json');
echo $body;
}
// Calling the HTTP Response Method with parameters
function sendResponse($status, $body = '')
{
$status_header = 'HTTP/1.1 ' . $status;
header($status_header);
header('Content-type: application/json');
echo $body;
}
<?php
require "/classes/Database.php";
header("Content-type: text/json");
$dbinfo = array(
"host" => "127.0.0.1",
"user" => "root",
"pass" => "",
"name" => "hiskor"
<?php
require "/classes/Database.php";
header("Content-type: text/json");
$dbinfo = array(
"host" => "127.0.0.1",
"user" => "root",
"pass" => "",
"name" => "hiskor"
[NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) {
NSURL *url = [NSURL URLWithString:[receiveItem objectForKey:@"image"]];
NSData *imageData = [NSData dataWithContentsOfURL:url];
UIImage *itemImage = [UIImage imageWithData:imageData];
itemImageView = [[UIImageView alloc] initWithImage:itemImage];
[
{
"image_id":"mmwVV74",
"hits":"2",
"first_view":"1356242044"
},
{
"image_id":"jSOxa38",
"hits":"5",
"first_view":"1356245094"
{
"first":[
{
"image_id":"vNZYZ08",
"hits":"5",
"first_view":"1356184026"
},
{
"image_id":"j1QZs34",
"hits":"6",
#import "ItemsTableViewController.h"
@interface ItemsTableViewController ()
@end
@implementation ItemsTableViewController
@synthesize categoryType, image_id, dataJSON;
- (id)initWithStyle:(UITableViewStyle)style
#import "ResourcesTableViewController.h"
@interface ResourcesTableViewController ()
@end
@implementation ResourcesTableViewController
@synthesize resourceCategories;
- (id)initWithStyle:(UITableViewStyle)style