This file contains 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 -w | |
puts "Counting your gems ..." | |
gems = {} | |
project_folders = Dir.entries(".").select{ |d| d !~ /^\..*/ && !File.file?(d) } | |
project_folders.each do |folder| | |
Dir.chdir(folder) do | |
if File.exists?('Gemfile') && File.file?('Gemfile') |
This file contains 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 Carousel | |
@@rectangles = [1]*5 + [2]*5 + [3]*5 + [4]*5 + [5]*5 | |
attr_accessor :carousel | |
def initialize(total_size) | |
@carousel = [] | |
fill_carousel(total_size, @carousel) | |
end |
This file contains 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
#!/bin/sh | |
BACKUPDIR=/Users/developer/backup/bucky/production/ | |
DAYSTAMP=`date "+%d"` | |
HOURSTAMP=`date "+%H"` | |
DAYFILE="daily_$DAYSTAMP.dump" | |
HOURFILE="hourly_$HOURSTAMP.dump" | |
DAYPATH=$BACKUPDIR$DAYFILE | |
HOURPATH=$BACKUPDIR$HOURFILE |
This file contains 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
%body | |
.container | |
.row | |
.span2 | |
.span10 | |
.container-fluid | |
.row-fluid | |
.span3 | |
.span3 | |
.row-fluid |
This file contains 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
require 'active_attr' | |
RELATIVE_APP_PATH = File.expand_path("../../app", __FILE__) | |
def construct_require_path(middle_path, name) | |
"#{RELATIVE_APP_PATH}/#{middle_path}/#{name}.rb" | |
end | |
def require_model(name) | |
require construct_require_path('models', name) |
This file contains 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
require 'fast_spec_helper' | |
require 'date' | |
require_model 'generate_required_daily_lists' | |
required_constants %w(Distributor PackingList DeliveryList) | |
---- OR ---- | |
require 'fast_spec_helper' | |
require_model 'exporter', sub_dir: 'sales_csv' | |
require_model 'delivery_exporter', sub_dir: 'sales_csv' |
This file contains 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
# Want to pass in a hash or instance of object. Was hoping to avoid is_a? or creating a new object but | |
# think that can only be done with is_a? or overriding new. Also, I might be missing the point as | |
# avoiding is_a? should mean I am using Duck Typing but if I'm using Duck Typing then I shouldn't be | |
# checking object equality anyway. See RSpec test for details. | |
describe MyClass do | |
let(:hash) { { name: 'Duck Type', description: 'Quacks like a duck?' } } | |
before do | |
@my_instance_1 = MyClass.new(hash) |
This file contains 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
# Navigating | |
visit('/projects') | |
visit(post_comments_path(post)) | |
# Clicking links and buttons | |
click_link('id-of-link') | |
click_link('Link Text') | |
click_button('Save') |
Block Ads https://getadblock.com/
Block Comments http://stevenf.com/shutup-css
Block Tracking https://www.abine.com/dntdetail.php
OlderNewer