Skip to content

Instantly share code, notes, and snippets.

View ArthurGuy's full-sized avatar

Arthur Guy ArthurGuy

View GitHub Profile
@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'));
#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
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

####Accessing an active container docker exec -t -i [container-id] /bin/bash

####Running an image docker run -v ~/Code/BBMS/:/var/www:rw -p 80:80 -d [image name] /sbin/my_init --enable-insecure-key

####Images

@ArthurGuy
ArthurGuy / member-agreement.md
Last active November 27, 2015 11:23
Build Brighton Member Agreement

There are a few things we ask members to remember. This helps keep the space and our equipment easy for all members to use, and promotes harmony among members.

  • Please return all tools and stuff you’ve used back to their proper places when done.
  • Please keep all of the space clean and tidy by cleaning up any mess such as sawdust, putting things away, clearing/washing dirty dishes and throwing scrap in the bin.
  • If you find a mess, it is a big help to everyone to clean and tidy. Just occasionally, someone forgets to tidy something or clean up.
  • Please leave the space tidier than it was when you started work
  • Before using tools, make sure you understand how to use them. Ask someone if unsure. Instruction manuals are online under each tool in "Tools and Equipment".
  • Read the hazard warning notices on tools and other Build Brighton notices and heed them - they are there for a reason. Re-read them from time to time. The hazard warning notices and risk assessments are online in "Tools and Equipment".
  • Some