Skip to content

Instantly share code, notes, and snippets.

package com.n1nja.utils;
/**
* Useful classes for manipulating {@link java.lang.String String}s.
* @author Colin Haber
* @version 0.0.0
*/
public class Strings {
/**
* The default {@code char} used for padding
* {@link java.lang.String String}s.
package com.n1nja.utils;
import java.util.Iterator;
/**
* Allows for Python-like {@code foreach} loop iteration with
* {@link java.lang.Integer Integer}s. Use as follows.
* <pre>
* for ({@link java.lang.Integer Integer} l : new Range());
* </pre>
* @author Colin Haber
* @version 0.1.0
@colin-haber
colin-haber / Test.java
Created April 28, 2012 21:22
Any ideas why Line 18 doesn't execute properly? Java 7u4 x64, Windows 8 x64.
package com.n1nja;
import java.util.logging.*;
public class Test {
public static void main(String[] args) {
new Test();
}
private Logger logger = Logger.getLogger(this.getClass().getCanonicalName());
private Test() {
System.out.println("System.out functional");
System.err.println("System.err functional");
@colin-haber
colin-haber / Test.java
Created April 28, 2012 00:43
Any ideas why this doesn't work?
package com.n1nja;
import java.util.logging.*;
public class Test {
public static void main(String[] args) {
new Test();
}
private Logger logger = Logger.getLogger(this.getClass().getCanonicalName());
{
System.err.println("errcheck");
this.logger.addHandler(new ConsoleHandler());
/**
* This file is part of CHAT - The stupid messaging protocol.
* Copyright (C) 2012 Jon Stevens and Colin Haber
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
/**
* CHAT - CHAT Has Acronym Troubles - The stupid messaging protocol.
* Copyright (C) 2012 Jon Stevens and Colin Haber
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
package com.n1nja.networking;
import java.io.*;
import java.net.*;
import java.util.Arrays;
public abstract class Client {
private final Socket socket;
private BufferedReader netReader;
private BufferedWriter netWriter;
public Client() {
socket = new Socket();
import java.net.*;
import java.io.*;
public class Client {
public static void main(String[] args) {
new Client();
}
private final InetAddress host;
private final Socket port;
private final PrintStream out;
private final BufferedReader in;
.background-color-shift (@color, @amount: 10%) when (lightness(@color) > 50%) {
background-color: darken(@color, @amount);
}
.background-color-shift (@color, @amount: 10%) when (lightness(@color) <= 50%) {
background-color: lighten(@color, @amount);
}
.text-color-shift (@color, @amount: 10%) when (lightness(@color) > 50%) {
color: darken(@color, @amount);
}
.text-color-shift (@color, @amount: 10%) when (lightness(@color) <= 50%) {
@colin-haber
colin-haber / metro.css
Created February 23, 2012 22:24
Metro UI-inspired CSS.
@charset "UTF-8";
@import url(http://fonts.googleapis.com/css?family=Lato:400);
* {
margin: 0;
padding: 0;
}
body {
background-color: black;
}
div.tile {