Skip to content

Instantly share code, notes, and snippets.

View emdeeeks's full-sized avatar

Gareth Griffiths emdeeeks

View GitHub Profile
@emdeeeks
emdeeeks / FBAuth.php
Created January 7, 2018 08:32 — forked from sirricharic/FBAuth.php
Simple Facebook OAuth Thing
<?
function make_request($url) {
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$clientResponse = curl_exec($ch);
@emdeeeks
emdeeeks / FacebookAuthenticate.php
Created January 7, 2018 08:34 — forked from midorikocak/FacebookAuthenticate.php
Facebook Custom Authenticate Object for CakePHP 3.x and Facebook PHP SDK 5.
<?php
namespace App\Auth;
use Cake\Auth\BaseAuthenticate;
use Cake\Network\Request;
use Cake\Network\Response;
use Cake\Core\Configure;
use Cake\Event\Event;
use Cake\Network\Session;
<?php
$endupload = "up";
class phpVimeo
{
const API_REST_URL = 'http://vimeo.com/api/rest/v2';
const API_AUTH_URL = 'http://vimeo.com/oauth/authorize';
const API_ACCESS_TOKEN_URL = 'http://vimeo.com/oauth/access_token';
const API_REQUEST_TOKEN_URL = 'http://vimeo.com/oauth/request_token';
@emdeeeks
emdeeeks / docblock_parser.php
Created February 4, 2018 16:11 — forked from fabiocicerchia/docblock_parser.php
PHP - DocBlock Parser
<?php
/**
* Title
*
* Description
* Description
* Description
*
* @author Fabio
@emdeeeks
emdeeeks / annotation_class.php
Created February 4, 2018 16:22 — forked from nicklasos/annotation_class.php
php annotations
<?php
/**
* Class Person
* @Table people
*/
class Person
{
/**
* @Prop Yep
*/
nametrans = lambda folder: {'[Gmail]/Drafts': 'drafts',
'[Gmail]/Sent Mail': 'sent',
'[Gmail]/Starred': 'flagged',
'[Gmail]/Trash': 'trash',
'[Gmail]/All Mail': 'archive',
}.get(folder, folder)
@emdeeeks
emdeeeks / .custom-hooks pre-commit
Created April 1, 2018 00:39 — forked from Integralist/.custom-hooks pre-commit
[Python Auto Generate API Documentation] Python Auto Generate API Documentation #tags: python, git, bash, make
#!/bin/bash
set -e
err_report() {
echo "There was an issue with one of the pre-commit hooks"
echo ".git/hooks/pre-commit-*"
echo "Error on line $1"
}
trap 'err_report $LINENO' ERR
@emdeeeks
emdeeeks / gendocs.py
Created April 2, 2018 23:06 — forked from dvirsky/gendocs.py
Generate Markdown documentation from a python package
# This script generates mkdocs friendly Markdown documentation from a python package.
# It is based on the the following blog post by Christian Medina
# https://medium.com/python-pandemonium/python-introspection-with-the-inspect-module-2c85d5aa5a48#.twcmlyack
import pydoc
import os, sys
module_header = "# Package {} Documentation\n"
class_header = "## Class {}"
function_header = "### {}"
@emdeeeks
emdeeeks / oauth.php
Created April 13, 2018 18:44 — forked from AstDerek/oauth.php
Some Oauth
<?php
class Google_OAuth {
var $client_id;
var $client_secret;
var $redirect_uri;
var $scopes = array(
'userinfo' => array(