Skip to content

Instantly share code, notes, and snippets.

View ngerakines's full-sized avatar
🏠
Working from home

Nick Gerakines ngerakines

🏠
Working from home
View GitHub Profile
@ngerakines
ngerakines / main.cpp
Created January 16, 2013 18:07
tdd workshop stuff
// This is the test executable: where the tests will be declared and run.
#include "test.h"
#include <iostream>
#include <string>
#include <map>
#include <time.h>
using namespace std;

About

The maven-protobuff project contains a lightweight maven plugin used to compile proto files.

Features

  • Will automatically extract .proto files out of dependency jars and put them into “//target/protos”.
  • Will compile your module/project proto files into the “//src/main/java” directory for checkin.
  • Works with both standard and multi-module projects.
#include <Time.h>
int RFIDResetPin = 13;
//Register your RFID tags here
char tag1[13] = "84003378CA05";
char tag2[13] = "840033725D98";
char cat1name[5] = "Toby";
char cat2name[8] = "Biscuit";

Engineering topic: Less is more

I had a desktop wallpaper a while ago with a single quote, it read:

As a software developer, you are your own worst enemy. The sooner you realize that, the better off you'll be.

As developers, every line of code that we write increases the const of maintaining the project that the code is in. It doesn't matter how clean the code is, how well written it is, how much thought was put into it ahead of time or if it has been refactered: All code carries a debt that can only be paid in time.

The theme of this week's engineering essay: Use the least amount of code possible.

@ngerakines
ngerakines / gist:3773403
Created September 23, 2012 23:20
led dice with button
const unsigned int LED_BIT0 = 12;
const unsigned int LED_BIT1 = 11;
const unsigned int LED_BIT2 = 10;
const unsigned int SWITCH_BIT = 9;
void setup() {
pinMode(LED_BIT0, OUTPUT);
pinMode(LED_BIT1, OUTPUT);
pinMode(LED_BIT2, OUTPUT);
pinMode(SWITCH_BIT, INPUT);
package com.socklabs;
import com.lmax.disruptor.*;
import com.lmax.disruptor.dsl.Disruptor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class MultiThreaded {
package com.socklabs;
import com.lmax.disruptor.*;
import com.lmax.disruptor.dsl.Disruptor;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
/**
* Created with IntelliJ IDEA.
Helm of the Forgotten Conqueror:
Archimonde
Pauldrons of the Forgotten Conqueror:
Mother Shahraz
Chestguard of the Forgotten Conqueror:
Illidan Stormrage
Leggings of the Forgotten Conqueror:
-- MySQL dump 10.13 Distrib 5.1.49, for debian-linux-gnu (i486)
--
-- Host: localhost Database: gobook
-- ------------------------------------------------------
-- Server version 5.1.49-3
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
package main
import (
"fmt"
"tour/wc"
"strings"
)
func WordCount(s string) map[string]int {
fields := make(map[string] int)