This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| require "csv" | |
| def print_help | |
| puts "Usage: ruby #{File.basename(__FILE__)} <column> <filename.csv>" | |
| puts "Please provide a column name and a CSV filename as an argument.\n" | |
| end | |
| def group_csv_by_column(filename, column) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Node | |
| attr_accessor :value, :next | |
| def initialize(value, _next) | |
| @value = value | |
| @next = _next | |
| end | |
| def to_s | |
| "#{self.value} -> #{self.next ? self.next.to_s : nil}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def test | |
| dummy = [ | |
| { a: 123, b: "hello", c: :whoa, another_key: "i don't know what to say here", even_more: "okay now it gets huge" }, | |
| { a: 123, b: "hello", c: :whoa, another_key: "i don't know what to say here", even_more: "okay now it gets huge" }, | |
| { a: 123, b: "hello", c: :whoa, another_key: "i don't know what to say here", even_more: "okay now it gets huge" }, | |
| { a: 123, b: "hello", c: :whoa, another_key: "i don't know what to say here", even_more: "okay now it gets huge" }, | |
| { a: 123, b: "hello", c: :whoa, another_key: "i don't know what to say here", even_more: "okay now it gets huge" }, | |
| { a: 123, b: "hello", c: :whoa, another_key: "i don't know what to say here", even_more: "okay now it gets huge" }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| describe Project do | |
| it "should be valid" do | |
| project = Fabricate.build :project | |
| project.must_be_valid | |
| end | |
| it "should have a name" do | |
| project_without_name = Fabricate.build :project, name: nil | |
| project_without_name.wont_be_valid |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Dreamforge::Application.configure do | |
| # Settings specified here will take precedence over those in config/environment.rb | |
| # In the development environment your application's code is reloaded on | |
| # every request. This slows down response time but is perfect for development | |
| # since you don't have to restart the webserver when you make code changes. | |
| config.cache_classes = false | |
| # Log error messages when you accidentally call methods on nil. | |
| config.whiny_nils = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/ruby | |
| require 'yaml' | |
| class Timestamp | |
| attr_accessor :start, :end | |
| def initialize(start_time) | |
| @start = start_time | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # magicWarden.rb - 2011 (c) Tobias Eilert | |
| # | |
| # Watches a folder recursively for changes and takes certain actions when files | |
| # are changed. You can specify the directory you want to watch on startup. | |
| # If no directory is passed, the magical warden will take care of the current place. | |
| # | |
| # $ magicWarden.rb some/path/to/some/place | |
| # $ magicWarden.rb # same as magicWarden.rb . | |
| # | |
| # Runs on Mac OS X, Windows and GNU/Linux with Ruby >= 1.9.2 |