Skip to content

Instantly share code, notes, and snippets.

View alexbilbie's full-sized avatar
👋

Alex Bilbie alexbilbie

👋
View GitHub Profile
@alexbilbie
alexbilbie / gist:5101426
Created March 6, 2013 17:50
Implicit grant
<?php
/**
* OAuth 2.0 implicit grant
*
* @package lncd/oauth2
* @author Alex Bilbie <hello@alexbilbie.com>
* @copyright Copyright (c) 2013 University of Lincoln
* @license http://mit-license.org/
* @link http://github.com/lncd/oauth2
*/
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
<name>Alford and Sutton ED.kml</name>
<Style id="failed">
<LineStyle>
<color>ffff0000</color>
</LineStyle>
<PolyStyle>
<color>40ff0000</color>
@alexbilbie
alexbilbie / lambda-run.js
Created November 19, 2015 11:15
Lambda run.js for local testing
// Import the Lambda function
var lambda = require('./MyModule');
// Faking the Lambda context object
var context = {
done: function (error, success) {
console.log('-------DONE--------');
if (error !== undefined && error !== null) {
console.log('Error: ' + error);
@alexbilbie
alexbilbie / gist:4171008
Created November 29, 2012 18:37
Weird ruby error
~/.rvm/gems/ruby-1.9.3-p327/gems/jekyll-0.11.2/bin/jekyll --server --no-auto
Configuration from /Users/alexbilbie/Github/alexbilbie.com/_config.yml
Building site: /Users/alexbilbie/Github/alexbilbie.com -> /Users/alexbilbie/Github/alexbilbie.com/_site
/Users/alexbilbie/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/psych.rb:203:in `parse': (<unknown>): found unknown escape character while parsing a quoted scalar at line 4 column 8 (Psych::SyntaxError)
from /Users/alexbilbie/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/psych.rb:203:in `parse_stream'
from /Users/alexbilbie/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/psych.rb:151:in `parse'
from /Users/alexbilbie/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/1.9.1/psych.rb:127:in `load'
from /Users/alexbilbie/.rvm/gems/ruby-1.9.3-p327/gems/jekyll-0.11.2/lib/jekyll/convertible.rb:33:in `read_yaml'
from /Users/alexbilbie/.rvm/gems/ruby-1.9.3-p327/gems/jekyll-0.11.2/lib/jekyll/post.rb:39:in `initialize'
@alexbilbie
alexbilbie / gist:4125156
Created November 21, 2012 14:42
Lincoln sites
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Folder>
<name>Temporary Places</name>
<open>1</open>
<Document>
<name>chad.kml</name>
<Style id="sh_ylw-pushpin">
<IconStyle>
<scale>1.3</scale>
@alexbilbie
alexbilbie / awesome-php.md
Created October 29, 2012 11:01 — forked from ziadoz/awesome-php.md
Awesome PHP Libraries
This file has been truncated, but you can view the full file.
<?xml version="1.0" encoding="UTF-8"?>
<Root>
<name>Transport for London Stations facilities</name>
<open>0</open>
<description>Transport for London Stations facilities</description>
<Header>
<Identifier>TfL | Station information</Identifier>
<DisplayTitle>TfL | Station information</DisplayTitle>
<Version>1.0</Version>
<PublishDateTime canonical="2010-02-04 11:54:08:000">Thu, 04 Feb 2010 11:54:08 +0100</PublishDateTime>
@alexbilbie
alexbilbie / composer.json
Created October 14, 2012 16:16
OAuth2 client example
{
"require": {
"lncd/oauth2-facebook": "*",
"slim/slim": "2.*"
},
"minimum-stability": "dev"
}
@alexbilbie
alexbilbie / rss-subscribers.sh
Created September 27, 2012 19:36
Bash script to parse Apache log for a count of RSS subscribers and email it to you
#!/bin/bash
# Schedule this to run once a day with cron. Doesn't matter what time since it parses yesterday's hits (by default).
# I only tested this on the Marco.org server, which runs CentOS (RHEL). No idea how it'll work on other distributions, but it's pretty basic.
# Required variables:
RSS_URI="/rss"
MAIL_TO="your@email.com"
LOG_FILE="/var/log/httpd/access_log"
@alexbilbie
alexbilbie / gist:3609857
Created September 3, 2012 14:52
Protect identifiers test
<?php
class db {
var $_protect_identifiers = FALSE;
var $_reserved_identifiers = array('*');
var $_escape_char = '`';
var $qb_aliased_tables = array();
public function escape_identifiers($item)