Skip to content

Instantly share code, notes, and snippets.

View blackwatertepes's full-sized avatar
Relaxing

Tyler J. Kuhn blackwatertepes

Relaxing
View GitHub Profile
#This converts a csv file to a slightly different csv.
#usage: ruby csv_to_csv.rb <csv input filename> <csv output filename>
# leaving out the output filename will result in a csv file with the same name as the input, and will have 'converted' in front of it.
require 'rubygems'
require 'csv'
require 'json'
@blackwatertepes
blackwatertepes / gist:9818837
Created March 27, 2014 21:06
Seeing Machines CSV script
# This converts the CSV generated from job #1 into an input CSV for job #2.
# usage: ruby csv_to_csv.rb <csv input filename> <csv output filename>
# if there is no output file given, one will automatically be generated, with the filename of 'converted_[input filename]'
require 'rubygems'
require 'csv'
require 'json'
@blackwatertepes
blackwatertepes / report_size.md
Last active August 29, 2015 14:24
Job Report Sizes

Generating a distribution of report sizes

Jobs for the last # days

First, you'll need to generate a list of job.id's from reports generated in the last # days. Run the following in Mixpanel...

SELECT job_id
FROM public.reports AS reports
WHERE reports.updated_at > '2015-06-29 00:00:00'
@blackwatertepes
blackwatertepes / pow
Created April 28, 2011 22:35
Shell script for creating/destroying/opening .pow symlinks
#!/bin/bash
# Scripts for creating/deleting/viewing pow symlinks
# Created by Tyler J. (first ever bash!!!)
a=`pwd`
b=`basename -a $a`
create()
{
# Create a pow symlink
@blackwatertepes
blackwatertepes / g.donut.js
Created May 13, 2012 16:31
A donut chart object to be used with the raphael.js library. Extended from the pie chart object.
/*
* g.Raphael 0.5 - Charting library, based on Raphaël
*
* Copyright (c) 2009 Dmitry Baranovskiy (http://g.raphaeljs.com)
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
*/
(function () {
function Piechart(paper, cx, cy, ir, or, values, opts) {
opts = opts || {};
@blackwatertepes
blackwatertepes / g.donutX.js
Created June 12, 2012 16:29
An advnaced donut(capabale of scaling each slice) chart object to be used with the raphael.js library. Extended from the pie chart object.
/*
* g.Raphael 0.5 - Charting library, based on Raphaël
*
* Copyright (c) 2009 Dmitry Baranovskiy (http://g.raphaeljs.com)
* Licensed under the MIT (http://www.opensource.org/licenses/mit-license.php) license.
*/
(function () {
function DonutX(paper, cx, cy, ir, or, values, opts) {
opts = opts || {};
# This is how you define your own custom exception classes
class NoFruitError < StandardError
end
class FruitTree
attr_reader :age, :height, :fruit_type
@fruit_type = "fruit"
def initialize
Inheritance Model
class Car
attr_reader :color, :wheels, :cost
def initialize(args)
@wheels = 4
@color = args[:color]
@cost = :respectible
end
@blackwatertepes
blackwatertepes / gist:5138355
Created March 11, 2013 22:13
Layout Drill: Right-hand Navigation
.container {
/*
If you have a block-level element of a certain width, margin: 0 auto;
will how you center it inside its parent container.
See: http://bluerobot.com/web/css/center1.html
*/
margin: 0 auto;
width: 720px;
}
@blackwatertepes
blackwatertepes / gist:5138356
Created March 11, 2013 22:13
Layout Drill: Right-hand Navigation
.container {
/*
If you have a block-level element of a certain width, margin: 0 auto;
will how you center it inside its parent container.
See: http://bluerobot.com/web/css/center1.html
*/
margin: 0 auto;
width: 720px;
}