Skip to content

Instantly share code, notes, and snippets.

View zeroeth's full-sized avatar
🤖
🐱 🤖 🐱 🤖

[0] zeroeth

🤖
🐱 🤖 🐱 🤖
View GitHub Profile
@zeroeth
zeroeth / jump.js
Created February 1, 2014 17:01
simple jump game
var player1 = {name: "yoda", power: "jedi", age: 900};
var player2 = {name: "luke"}
var players = [player1, player2];
var jump = function(player) {
console.log(player.name + " jumps!");
}
@zeroeth
zeroeth / notzork.js
Last active August 29, 2015 13:55
text adventure
// introduction
// a game with two rooms
// walk to next room
// grab an item
// (something good or bad happens)
var room1 = {
description: "A dark room full of holographic clowns"
}
@zeroeth
zeroeth / asteroids.html
Last active August 29, 2015 13:55
asteroids 1
<html>
<head>
<script src='http://cdn.html5quintus.com/v0.2.0/quintus-all.js'></script>
<style>
canvas { background-color: black; }
</style>
</head>
<body>
<script>
// This game uses images from:
@zeroeth
zeroeth / marionetteview.js
Created February 11, 2014 19:48
Make model available to Backbone.Marionette View.
return Backbone.Marionette.ItemView.extend({
// Pass model to view because template 'this' is not current view.
// based on: https://github.com/marionettejs/backbone.marionette/blob/master/docs/marionette.view.md#basic-example
//
templateHelpers: function() {
return { model: this.model };
}
});
@zeroeth
zeroeth / rb.rb.rb.rb.rb
Created February 20, 2014 00:58
ruby lovin
class Mizu
# getter setters for instance variables
attr_accessor :name, :is_coding
attr_accessor :bite_count
attr_accessor :zombie_stats
attr_reader :werewolfness
@@people_bitten_by_vampires = []
@zeroeth
zeroeth / grid.rb
Last active August 29, 2015 13:56
because clever
class HistoryResultRow
def initialize
700.times do |number|
self.class.send :define_method, "Col#{number}" do
instance_variable_get "@col#{number}"
end
self.class.send :define_method, "Col#{number}=" do |value|
instance_variable_set "@col#{number}", value
end
@zeroeth
zeroeth / git-directory-status.sh
Last active August 29, 2015 13:57
git directory stats, gives a view into the activity/stagnation of a particular folder.
#!/bin/bash
# modified by https://github.com/zeroeth for clarity, commit count, committer list
# original from https://gist.github.com/Gabro/5883819
# based on http://stackoverflow.com/questions/17359370/git-show-last-commit-date-and-message-for-each-file-in-directory-like-github
#
# Prints out git statistics for each folder similar to githubs file listing, example:
#
# build_osx.sh -- 11 days ago b865716 Notes for intalling devil (Kevin Alford)
# main.cpp -- 10 months ago dc06f98 No fullscreen (Kevin Alford)
# main.h -- 10 months ago c16c2f3 sdl open include helper and change number of blobs (Kevin Alford)
@zeroeth
zeroeth / infinibi.out
Last active August 29, 2015 13:57
infinite zombies
A
B
A
B
A
B
A
B
A
B
{
"name": "flare",
"children": [
{
"name": "analytics",
"children": [
{
"name": "cluster",
"children": [
{"name": "AgglomerativeCluster", "size": 3938},
@zeroeth
zeroeth / oven.rb
Created March 23, 2014 20:57
mooncake fun
class Oven
def bake item
item.to_cookie
end
end
class PorkMooncake
def to_cookie
PorkCookie.new
end