Skip to content

Instantly share code, notes, and snippets.

View ArthurGuy's full-sized avatar

Arthur Guy ArthurGuy

View GitHub Profile
include_once 'PayPal_IPN.php';
$PayPal = new PayPal_IPN();
$PayPal->set_paypal_email('your_paypal@email_address.com');
$PayPal->get_ipn();
include_once 'PayPal_Standard.php';
$PayPal = new PayPal_Standard();
$PayPal->set_paypal_email('your_paypal@email_address.com');
$PayPal->add_row('', 'Item for Sale', 9.99);
$PayPal->generate_form(true);
@ArthurGuy
ArthurGuy / arthur_creature
Created September 8, 2011 18:31
Arthur's Creature
jj.createCreature('arthurguy', function (creature) {
// Give your creature a size.
creature.size({width: 50, height: 50});
// Center your creature in the world.
var worldCenter = jj.center();
creature.position({
<?xml version='1.0' encoding='UTF-8'?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:media='http://search.yahoo.com/mrss/' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:gd='http://schemas.google.com/g/2005' xmlns:yt='http://gdata.youtube.com/schemas/2007'><id>http://gdata.youtube.com/feeds/api/users/apguy15/uploads</id><updated>2012-01-25T16:37:06.891Z</updated><category scheme='http://schemas.google.com/g/2005#kind' term='http://gdata.youtube.com/schemas/2007#video'/><title type='text'>Uploads by apguy15</title><logo>http://www.youtube.com/img/pic_youtubelogo_123x63.gif</logo><link rel='related' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/users/apguy15'/><link rel='alternate' type='text/html' href='http://www.youtube.com/profile?user=apguy15#p/u'/><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://gdata.youtube.com/feeds/api/users/apguy15/uploads'/><link rel='http://schemas.google.com/g/2005#batch' type='application/atom+xml
@ArthurGuy
ArthurGuy / CrunchExpenseController.php
Created November 22, 2013 11:14
Crunch Expenses App
<?php
class CrunchExpenseController extends BaseController {
private $rules;
public function __construct()
{
parent::__construct();
@ArthurGuy
ArthurGuy / roomba.device.nut
Created December 14, 2013 12:12
Electric Imp device code for communicating with the roomba and reading off the sensor data
imp.configure("Roomba", [], []);
hardware.pin1.configure(DIGITAL_IN_WAKEUP);
hardware.pin2.configure(DIGITAL_OUT_OD_PULLUP);
impWakeupPin <- hardware.pin1;
roombaWakeupPin <- hardware.pin2;
roombaWakeupPin.write(1);
hardware.uart57.configure(115200, 8, PARITY_NONE, 1, NO_CTSRTS);
//Connection will be either 115200 or 57600
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x20, 2, 1, 0, 4, 5, 6, 7, 3, NEGATIVE);
void setup()
{
lcd.begin(8,2);
lcd.home();
lcd.print("Hello");
@ArthurGuy
ArthurGuy / crunch-oauth-request-example
Created September 4, 2014 11:08
An example oauth request for the Crunch API
//Create the access token
$accessToken = new \ZendOAuth\Token\Access();
$accessToken->setToken($key);
$accessToken->setSecret($secret);
$oauth_options = array(
'consumerKey' => $this->key,
'consumerSecret' => $this->secret,
int pin3 = 2; //£1
int pin4 = 3; //£2
int pin5 = 4; //input - coin return
int pin6 = 5; //high - stops money
int pin7 = 6; //5p
int pin8 = 7; //10p
int pin9 = 8; //20p
int pin10 = 9;//50p
@ArthurGuy
ArthurGuy / doctrine-multiple-objects.php
Last active August 27, 2015 12:30
Moving from Eloquent to Doctrine
<?php
/** @var \Illuminate\Http\Request $request */
$cost = new EquipmentCost($request->get('requires_induction'), $request->get('induction_category'), $request->get('access_fee'), $request->get('usage_cost'), $request->get('usage_cost_per'));
$properties = new EquipmentProperties($request->get('manufacturer'), $request->get('model_number'), $request->get('serial_number'), $request->get('colour'));
$ownership = new Ownership($request->get('managing_role_id'), $request->get('permaloan'), $request->get('permaloan_user_id'));
$device = new Device($request->get('name'), $request->get('key'), $request->get('description'), $request->get('help_text'), $properties, $cost, $ownership, $request->get('obtained_at'));