Skip to content

Instantly share code, notes, and snippets.

View joshuaadickerson's full-sized avatar

Joshua Dickerson joshuaadickerson

View GitHub Profile
<?php
// you need an access token, and it might require the user_likes permission.
// see http://developers.facebook.com/docs/authentication. Just trying this
// out for yourself, grab one of your access tokens from
// http://developers.facebook.com/docs/api.
$access_token = '';
$user = '';
$api = 'https://graph.facebook.com/';
$raw_likes = json_decode(file_get_contents($api . $user . '/likes?access_token=' . $access_token), true);
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta charset="utf-8">
<link rel="canonical" href="index.php?topic=1">
<title>Curve CSS3 Test</title>
<style>
* {
border: 0 none;
SET @ItemYear = 2008,
@ItemMonth = 11,
@ItemDay = 27,
-- Try with 1409, then 1410. It breaks at 1410
@min = 1410;
SELECT CAST(CONCAT(@ItemYear,'/', @ItemMonth, '/', @ItemDay, ' ', CAST(@min / 60 as UNSIGNED INT), ':', @min % 60) as DATETIME);
@joshuaadickerson
joshuaadickerson / DataGrid.php
Created September 27, 2012 14:48
A class to represent data as a grid/spreadsheet with many forms of output
<?php
/**
* Data represented as a grid or spreadsheet
*
* A visual representation:
* [col] [col] [col]
* [row][field] [field] [field]
* [row][field] [field] [field]
* [row][field] [field] [field]
@joshuaadickerson
joshuaadickerson / DataGridSort.php
Created October 4, 2012 00:51
A class to sort data grids (arrays)
<?php
/**
* Sort a multi-dimensional array
*
* @example <code>
* $sales_headers = array(
* 'year', 'country', 'product', 'profit'
* );
*
<?php
class ParkingAuthority
{
function createParkingLots()
{
$app = Application::getInstance();
$db = $app->getService('db');
{get lots}
@joshuaadickerson
joshuaadickerson / gist:3938763
Created October 23, 2012 13:34
CSV MySQL dump to gzip
mysqldump -uroot -ppass --tab="." --fields-enclosed-by=\" --fields-terminated-by="," myschema mytable | gzip > myschema.mytable.csv.gz
<html>
<head>
<link rel="stylesheet" type="text/css" href="../Static/bootstrap/css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="../Static/index.css">
<script src="../Static/bootstrap/js/bootstrap.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
<script src="../Static/index.js"></script>
</head>
<body>
<!DOCTYPE html>
<html>
<head>
<style>
body, html
{
margin: 0;
padding: 0;
height: 100%;
location /camera/public/ {
try_files $uri $uri/ @camera;
}
location @camera {
rewrite ^/camera/public/(.*)$ /camera/public/index.php/$1 last;
}