Skip to content

Instantly share code, notes, and snippets.

View abrightwell's full-sized avatar

Adam Brightwell abrightwell

  • Crunchy Data Solutions
  • St. Johns, FL
View GitHub Profile
###############################################################################
# Building Go on the Raspberry Pi
###############################################################################
# Based on the work of Dave Cheney
# http://dave.cheney.net/2015/09/04/building-go-1-5-on-the-raspberry-pi
# Also info in the docs:
# https://github.com/golang/go/blob/master/src/make.bash
###############################################################################
### Set project area
@abrightwell
abrightwell / add.sh
Created November 7, 2016 18:24 — forked from sdoro/add.sh
Howto add/remove in VirtualBox a fifth NIC (without GUI) in hostonly networking
VBoxManage modifyvm "vm" --hostonlyadapter5 vboxnetX
VBoxManage modifyvm "vm" --nic5 hostonly
SET SESSION AUTHORIZATION rls_regress_user0;
CREATE TABLE z1 (a int, b text) WITH OIDS;
GRANT SELECT ON z1 TO rls_regress_group1, rls_regress_group2;
COPY z1 FROM STDIN WITH (OIDS);
101 1 aaa
102 2 bbb
103 3 ccc
104 4 ddd
RESET SESSION AUTHORIZATION;
DROP TABLE IF EXISTS s1, s2 CASCADE;
DROP VIEW IF EXISTS v2;
DROP ROLE IF EXISTS user1;
CREATE ROLE user1;
CREATE TABLE s1 (a int, b text);
INSERT INTO s1 (SELECT x, md5(x::text) FROM generate_series(-10,10) x);
CREATE TABLE s2 (x int, y text);
public class FCHS extends SimpleRobot {
// Create robot drive.
private RobotDrive chassis = new RobotDrive(1, 2);
private Joystick leftStick = new Joystick(1);
private Joystick rightStick = new Joystick(2);
public FCHS() {
// Invert Motors here... In your current code you are trying to invert them
// before the chassis has been "created". Therefore, you will have an error.
@abrightwell
abrightwell / gist:2876676
Created June 5, 2012 18:18
NullPointerException Null Check
// Bad
try {
this.someProperty = someObject.getValue();
} catch (NullPointerException e) {
this.someProperty = someDefaultValue;
}
// Better
interface Foo {
public void update();
}
class abstract Bar {
private List<Foo> listeners;
...
@abrightwell
abrightwell / gist:2024655
Created March 12, 2012 20:59
Dual Camera Code
package org.first.team342.smartdashboard.camera;
import edu.wpi.first.smartdashboard.gui.DashboardFrame;
import edu.wpi.first.smartdashboard.gui.DashboardPrefs;
import edu.wpi.first.smartdashboard.gui.StaticWidget;
import edu.wpi.first.smartdashboard.properties.IPAddressProperty;
import edu.wpi.first.smartdashboard.properties.Property;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics;