Simple Reloading Server in Bash

Tuesday, August 5th 2014

It’s often extremely useful to have a server that automatically reloads when any of the source files change. Grunt is commonly used for this, but in some cases that is overkill - a simple bash script will suffice. The script below uses Python 2 to start the server and inotify-utils to wait on changes in a directory.

set -e

# Create site dir if it does not exist
mkdir -p site

# Python server
cd site
python -m SimpleHTTPServer &
cd ..

# Kill python server on exit
trap "exit" INT TERM
trap "kill 0" EXIT

while true; do
  echo "Building site..."
  sass theme/styles.scss:theme/styles.css

  echo "Waiting for changes..."
  inotifywait -e modify -r .
View Comments

The Damned

Sunday, July 20th 2014

A couple weeks ago, I took part in a game jam on called the AGDG Microgame Jam. The premise behind the jam was to create a WarioWare style game that takes place on a single screen. I chose to try a local multiplayer game, in the vein of the frantic, competitive multiplayer from the GameCube adaption of WarioWare.

Unfortunately, since it was mostly made during a single weekend, I didn’t get a chance to play-test at all, and for a multiplayer game that’s a death knell. If I get the chance to actually test it out, I might go back and tweak the mechanics.

Possible Concerns:

  1. It’s too easy to survive, especially after a certain amount of blocks have dropped from the arena.
  2. More obstacles should be implemented that actually bring out the chain mechanic.
  3. Chain physics is still wonky.
  4. Players may be so unwilling to cooperate, that any movement at all is impossible
View Comments

A Perk of Using WebGL

Thursday, November 28th 2013

I’ve recently been testing with WebGL for a project, and one of the pretty cool perks is that you can just use regular HTML/CSS/JS to create your GUIs. In this quick test, I made a simple chat window for the UI.

When I used Ogre3D, I knew about some libraries such as Navi that embed Mozilla/Chromium, but I always assumed they were more work then the time saved. Having now used HTML to create a GUI, I think I’ve changed my mind about that.

View Comments

Recent Hackathon Projects

Thursday, November 28th 2013

StumbleTube [Code] [Web]

StumbleTube was a simple hack that I made with three other students at the 2013 NorCal Facebook Hackathon. The goal was to present YouTube recommendations (pulled from your Google account) in a fashion that’s easy to quickly traverse, and let you find videos that actually interest you. You get videos in sets of four - hovering over a video plays only the audio from that video, and clicking on one makes that video full-screen. At any point, you can pick a different video, or request a new set of four. You can also like videos to further improve recommendations.

As a bonus feature, we added a QR code that, when scanned, will take you to a remote page, letting you control the entire player exclusively from your phone. We actually ended up winning first with this hack, and progressed to the global finals.

HackWall [Code] [Web]

HackWall was another simple hack that we made for the global finals. It’s essentially a real-time collaborative bulletin-board. All you need to do is create a wall, share the link, and you can collaboratively create/move notes, draw annotations, and create mind-maps.

View Comments

Designing a Cardboard Canoe

Monday, July 22nd 2013

Every year, my high school holds a canoe race, where students from the Engineering, Physics, and Calculus classes compete to design, build and race a canoe over the span of two weeks.

The standard way to do this was to first create the keel, then create ribs at regular intervals. From that, you can add a cardboard “skin” and then coat the whole thing in duct-tape.

The only real limit is that the canoe’s contours must be defined by an equation (thus relating it back to the class content). Most teams created two equations - one for the profile view, and one for each of the ribs.

I though we could take that further, and make a parametric function to define the entire surface of the boat. From there, one can plug in rib locations and automatically generate a table telling us what shapes to cut out. Turns out I already made a tool to make the process of creating the contour a visual one.

Using the Math4D system, I started out with three separate contours, then actually created the 2-variable parametric. It turns out the ability to render the boat shape was very useful, as the team suggested many modifications - both aesthetic and practical.

However, an equation is not a boat, and we still had to build the thing. The fact that we could so quickly generate the table certainly helped, as we could get a bit of a head-start.

We ended up winning two of the four heats, as well as taking the first prize overall. In the end though, the equations only helped us so much - many teams had really good designs. What set our boat apart was exceptionally sturdy build quality, as well as quality rowers.

View Comments