Skip to content

Instantly share code, notes, and snippets.

View PeterJCLaw's full-sized avatar

Peter Law PeterJCLaw

View GitHub Profile
int main() {
int i = 57005;
printf("I see %x people.", i);
rerturn 0;
}
str = "this is a string."
num = 4 # that's a number, this is a comment
# python - high level
print "I like bacon"
// C - low level
#include <stdio.h>
void main(void)
{
printf("I like bacon");
}
@PeterJCLaw
PeterJCLaw / Output!
Created January 14, 2012 22:56
Testing PHP's touch and fileXtime functions
int(9)
atime: string(31) "January 14 2012 22:57:01.000000"
ctime: string(31) "January 14 2012 22:57:01.000000"
mtime: string(31) "January 14 2012 22:57:01.000000"
touch Time: January 14 2012 01:01:01.000000
bool(true)
atime: string(31) "January 14 2012 22:57:01.000000"
ctime: string(31) "January 14 2012 22:57:01.000000"
mtime: string(31) "January 14 2012 22:57:01.000000"
@PeterJCLaw
PeterJCLaw / lock-hanlder.php
Created January 22, 2012 18:57
PHP Lock Handler
<?php
/**
* A helper class for file locking stuff.
* Locks obtained through this class are shared with the entire request,
* allowing multiple objects to get their own locks on the same file
* without deadlocking internally.
*/
class LockHandler
{
@PeterJCLaw
PeterJCLaw / analyse.py
Created May 13, 2012 13:22
Student Robotics' Priate Plunder Results Analyser
#!/usr/bin/env python
import json
import numpy
with open('dump.json') as f:
data = json.load(f)
BASE = 'org.srobo'
@PeterJCLaw
PeterJCLaw / hex-add.php
Created May 20, 2012 21:56
PHP addition things.
<?php
$hex = 0x0;
$int = 2;
var_dump($hex); # int(0)
var_dump($int); # int(2)
var_dump($hex + $int); # int(2)
var_dump(0x0 + 2); # int(2)
@PeterJCLaw
PeterJCLaw / goo.cs
Created May 21, 2012 20:04
C# protected and an assault
using System;
namespace Bacon
{
class Victim
{
protected int money = 100;
public override string ToString() {
@PeterJCLaw
PeterJCLaw / score.py
Created July 24, 2012 19:19
great balls of SR scoring script
OTHER_ZONE = -4
LEAVE_ZONE = 6
OWN_ZONE = -2
OPPONENT_BALLS = 10
SUPER_BALL = 100
OWN_BALLS = -0.2
from math import floor
@PeterJCLaw
PeterJCLaw / gist:3700283
Created September 11, 2012 17:55 — forked from fables-tales/gist:3665072
Response

Hi Georgina,

It's great to have a potential sponsor interested, we're always excited when people want to back our project. Student Robotics is an exciting robotics competition for sixth formers that takes place across many parts of Europe. We have branches in Bristol, Southampton, Munich and Grenoble with the majority of the competitors coming from the Southampton and Bristol areas. We go to the participating schools on a weekly basis to mentor them in the construction of their robots, giving them help will all kinds of technical issues from programming to electronics.

The Bristol branch is currently looking for sponsorship for mentoring transport back and forth to Cheltenham and Poole on a regular basis, based on the fact that the union can only provide us with a limited budget to get people around. We currently have 10 university students involved at the moment, and are looking to expand heavily in the coming year, as we have more than doubled the number of schools involved at the Bristol branch.