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
Scaling RoR MUC | |
Roles | |
- "big decisions" group | |
- Examples: | |
- do we take on non-refugees | |
- when do we start the weekly course | |
- do students have to qualify for the weekly course | |
- which volunteers do we take on |
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
source 'http://rubygems.org' | |
# REFINERY CMS ================================================================ | |
# Anything you put in here will be overridden when the app gets updated. | |
gem 'refinerycms', '1.0.8' | |
group :development, :test do | |
# To use refinerycms-testing, uncomment it (if it's commented out) and run 'bundle install' | |
# Then, run 'rails generate refinerycms_testing' which will copy its support files. |
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 PortfolioItem::Image | |
dragonfly_accessor :image_original # store original | |
dragonfly_accessor :image_medium # 660px | |
end | |
class PortfolioItem | |
include PortfolioItem::ImagesConcern | |
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
class PortfolioItem::Image < ActiveEceord::Base | |
end | |
class PortfolioItem < ActiveEceord::Base | |
has_many :images, class_name: 'PortfolioItem::Image', dependent: :destroy | |
# id stored in column portfolio_items.tile_image_id | |
has_one :tile_image, class_name: 'PortfolioItem::Image', dependent: :destroy |
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 PortfolioItem | |
# | |
# alt | |
# | |
#has_attached_file :teaser, styles: { tile: ["555x>", :jpg] } | |
# | |
# neu | |
# |
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 'test/unit' | |
class StringCalculator | |
def add(string) | |
string.split(',').map(&:to_i).inject(:+) || 0 | |
end | |
end | |
class TestStringCalculator < Test::Unit::TestCase |
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 Account | |
def initialize(id) | |
@balance = 0 | |
@id = id | |
end | |
def decrease_balance(amount) | |
@balance -= amount | |
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
require 'embedly' | |
key = ENV['KEY'] | |
timeout = 60 | |
client = Embedly::API.new(key: key, timeout: timeout) | |
url = 'http://de.qantara.de/inhalt/zivilgesellschaftliche-initiativen-im-libanon-ich-bin-kein-maertyrer' | |
p client.extract(url: url) |
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_relative '../features_helper' | |
require_relative 'registration_spec_helper' | |
feature "Registering as new user", :js do | |
include RegistrationSpecHelper | |
background do | |
visit root_path | |
click_on("Registrieren") | |
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
contents = { | |
user1: [1, 2, 4, 5, 6], | |
user2: [7, 8, 9], | |
user3: [10, 11, 12, 13] | |
} | |
# regeln: | |
- höchstens 6 elemente zurückgeben | |
- von möglichst vielen usern | |
- gleichmaessig |