Skip to content

Instantly share code, notes, and snippets.

View lawrencejones's full-sized avatar

Lawrence Jones lawrencejones

View GitHub Profile
@lawrencejones
lawrencejones / gist:5690791
Created June 1, 2013 15:42
A simple test for our c libraries
context 'with invalid files' do
it 'detects size above 2^16 bytes' do
file = Utilities.openFile path + 'C_large'
size = Utilities.getSize file
# invalid file, should exceed limit
size.should_not be < 65536
end
it 'detects nonexistant file' do
file = Utilities.openFile path + 'Ghost'
ITG3050 - Midrange Gyroscope
============================
Manufacturer - http://www.invensense.com/mems/gyro/itg3050.html
Purchase Link - http://uk.farnell.com/invensense/itg3050/gyro-tri-axis-2000-deg-s-24qfn/dp/2082443
Quantity 10, ppu £12.14
Total price £121.40 (minus VAT)
MPU3300 - Premium Gyroscope
===========================
Manufacturer & Supplier - http://www.invensense.com/mems/gyro/mpu3300.html
@lawrencejones
lawrencejones / gist:6042250
Created July 19, 2013 20:51
Suggested RESTFul
## EVENTS #############################################
GET /events
GET /events/:id
POST /events/:id/distribute
## USERS ##############################################
GET /users
GET /users/:id
<html>
<head>
<link rel="stylesheet" href="./style.css">
</head>
<body>
</body>
</html>
html {
var sys = require('sys')
var exec = require('child_process').exec;
function puts(error, stdout, stderr) { sys.puts(stdout) }
exec("clear; make | tail -1 && ./bin/wacc --parse-only examples/valid/array/array.wacc", puts)
WorkspaceSwitcherPopup = imports.ui.workspaceSwitcherPopup;
function init() {
}
function enable() {
if (WorkspaceSwitcherPopup.prototype == null)
WorkspaceSwitcherPopup.prototype = {};
WorkspaceSwitcherPopup.prototype['_show'] = function ( ) { };
}
function disable() {
import static org.junit.Assert.*;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.JUnit4;
import ic.doc.*;
import java.util.ArrayList;
import java.util.Arrays;
#include <stdio.h>
#include <stdlib.h>
#define MAX_BUFF_SIZE 256
int getaline(char* linebuf, int bufsize)
{
int i = -1; char c;
// While i is less than buffersize
// and the next character does not equal \n
========================================================
Bar Night @ Union - 12/11/2013
========================================================
Year | No. of Attendees | Year Pct | First Timers
--------------------------------------------------------
Yr.1 | 21 / 159 | 14% | 100%
Yr.2 | 26 / 145 | 18% | 100%
Yr.3 | 21 / 164 | 13% | 100%
Yr.4 | 10 / 145 | 7% | 100%
@lawrencejones
lawrencejones / gist:7794597
Created December 4, 2013 20:08
Pre-commit Hook to prevent bad commits
#!/usr/bin/env ruby
crrtBranch = (/(?<=\*\s).*/.match `git branch`)
user = `echo $USER`.gsub "\n", ""
if not ['lawrencejones', 'alanvey'].include? user
if crrtBranch.to_s != 'F_CodeGen'
puts 'Wrong branch!'
exit 1
end
end