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 Shape | |
attr_accessor :color | |
def can_fit?(shape) | |
area > shape.area | |
end | |
end | |
class Rectangle < Shape | |
attr_accessor :width, :height |
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
<% @posts.each do |post| %> | |
<div class="media"> | |
<%= render partial: 'votes/voter', locals: { topic: @topic, post: post } %> | |
<div class="media-body"> | |
<h4 class="media-heading"> | |
<%= link_to (markdown post.title), [@topic, post] %> | |
<%= image_tag(post.image.thumb.url) if post.image? %> | |
<br> | |
<small> | |
<%= image_tag(post.user.avatar.tiny.url) if post.user.avatar? %> |
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
<!-- wiki_collaborations/add_or_remove.html.erb --> | |
<!-- how can this be cleaned up? --> | |
<div class="row"> | |
<div class="col-sm-6"> | |
<%= form_for wiki, url: wiki_collaborations_path, method: :post do %> | |
<%= hidden_field_tag :wiki_id, wiki.id %> | |
<% @users.each do |user| %> | |
<% next if current_user == user %> | |
<div class="checkbox"> |
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
<h1>Select a plan</h1> | |
<div class="row"> | |
<%= form_for @subscription, url: user_subscriptions_path, method: :post, html: { class: 'form-horizontal' } do %> | |
<div class="col-sm-4"> | |
<%= hidden_field_tag :stripe_card_token %> | |
<div class="form-group"> | |
<%= label_tag "Premium" %> |
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
<div class="jumbotron center"> | |
<h1 class="center-header">Blocipedia</h1> | |
<h2 class="center-header">Social, Markdown Wikis</h2> | |
<br> | |
<div class="row"> | |
<div class="col-sm-5"> | |
<h3>Free Account</h3> | |
<ul> | |
<li>Create unlimited public wikis</li> | |
<li>Collaborate with unlimited users</li> |
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
(function( $ ){ | |
$.fn.markdownPreview = function() { | |
return this.each(function() { | |
var $this = $(this); | |
$this.wrap( '<div class="markdown_wrap editing"></div>' ); |
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
<div class="panel panel-default"> | |
<div class="panel-heading"> | |
<div class="panel-title"> | |
<h1>Edit <%= resource_name.to_s.humanize %></h1> | |
</div> | |
Current account: <%= resource.plan.name %> | |
</div> | |
<div class="panel-body"> | |
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %> | |
<%= devise_error_messages! %> |
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 BoggleBoard | |
#your code here | |
end | |
dice_grid = [["b", "r", "a", "e"], | |
["i", "o", "d", "t"], | |
["e", "c", "l", "r"], |
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
<div class="row"> | |
<div class="col-md-6"> | |
<h1>Refcodes</h1> | |
Referral discounts for great tech<br> | |
products and services | |
</div> | |
<div class="col-sm-6 message"> | |
Share referral discounts for your favorite web products and services, and redeem discounts for other products and services you want to try out. Oh, and if you see that there is already a post for the same referral deal, don't duplicate it. Otherwise, we might remove it. | |
<br> | |
<span class="pull-right">Thanks!</span> |
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 BoggleBoard | |
def initialize(dice_grid) | |
@dice_grid = dice_grid | |
end | |
def create_word(*coords) | |
coords.map { |coord| @dice_grid[coord.first][coord.last] }.join("") | |
end | |
def get_row(row) |
OlderNewer