Skip to content

Instantly share code, notes, and snippets.

View eman41's full-sized avatar
👨‍💻

Eric P. eman41

👨‍💻
View GitHub Profile
@eman41
eman41 / PlatformController.cs
Last active December 16, 2015 16:08
A movement controller for platforms from an XNA prototype I've been working on. Platforms using this will move back and forth between two points, stopping at each end for the hold-time specified. This is part of a composition-based API, so you can drop in a controller, a sensor, etc and create platforms of various flavors. An option exists to fo…
using System;
using Microsoft.Xna.Framework;
public class PlatformController : IResetable
{
private Vector2 _startPos = Vector2.Zero;
private Vector2 _stopPos = Vector2.Zero;
private float _speed = 0f;
private bool _beingHeld = false;
@eman41
eman41 / ListAllWithExtension.java
Last active December 16, 2015 09:49
List all files in a directory with an extension filter. [Java 7]
package org.eman.gist;
import java.io.File;
import java.io.FilenameFilter;
import java.io.IOException;
import java.util.Collection;
import java.util.Arrays;
/**
* Print out a list of all files with a particular extension from a directory.
* @author eman41
@eman41
eman41 / java-proj.sublime-project
Last active December 16, 2015 08:19
Java Project Settings for SublimeLinter. A helpful command here (from javac) is the -d option that provides the target directory for the compiled class files. Standard classpath note: if you keep sub-folders in your lib directory, they must be specified since the -cp switch isn't recursive.Test classes are always in a separate test src so that i…
{
"folders":
[
{
"path": "/C/workspace/project"
}
],
"settings":
{
"SublimeLinter":