Skip to content

Instantly share code, notes, and snippets.

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

[0] zeroeth

🤖
🐱 🤖 🐱 🤖
View GitHub Profile
@zeroeth
zeroeth / BackboneCollectionView.js
Last active August 29, 2015 13:57
backbone collection
/* Sample table of data from collection */
/* Collection Partial */
var PartialView = Backbone.View.extend(
{
template: Mustache.compile ($("#PartialTemplate").html()),
tagName: "tr",
render: function()
@zeroeth
zeroeth / index.html
Last active August 29, 2015 13:57 — forked from cfergus/index.html
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://d3js.org/d3.v2.js"></script>
<script type="text/javascript" src="sankey.js"></script>
<title>Sankey Diagram</title>
<style>
@zeroeth
zeroeth / index.html
Last active August 29, 2015 13:57 — forked from cfergus/index.html
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://d3js.org/d3.v2.js"></script>
<script type="text/javascript" src="sankey.js"></script>
<title>Sankey Diagram</title>
<style>
@zeroeth
zeroeth / list_git_projects.sh
Created March 23, 2014 21:57
find all git repos in a folder
#!/bin/bash
# Doesn't work with white-spaced names.
# find . -type d -name .git | xargs -n 1 dirname
# Works with white-space.
find . -type d -name .git -print0 | xargs -0 -n 1 dirname
# TODO fetch all remotes and then list branch sync info similar to https://gist.github.com/zeroeth/8013177
@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
{
"name": "flare",
"children": [
{
"name": "analytics",
"children": [
{
"name": "cluster",
"children": [
{"name": "AgglomerativeCluster", "size": 3938},
@zeroeth
zeroeth / infinibi.out
Last active August 29, 2015 13:57
infinite zombies
A
B
A
B
A
B
A
B
A
B
@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 / 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 / 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 = []