$ brew update
$ brew install rbenv
$ brew install ruby-build
append eval "$(rbenv init -)"
to your bash profile
$ rbenv install 1.9.3-p327
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ | |
░██░░░░░░██░░█████░░░██░░░░░░█████░░░ | |
░░██░░░░██░░██░░░██░░██░░░░░██░░░██░░ | |
░░░██░░██░░░██░░░██░░██░░░░░██░░░██░░ | |
░░░░████░░░░██░░░██░░██░░░░░██░░░██░░ | |
░░░░░██░░░░░██░░░██░░██░░░░░██░░░██░░ | |
░░░░░██░░░░░██░░░██░░██░░░░░██░░░██░░ | |
░░░░░██░░░░░░█████░░░██████░░█████░░░ | |
░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ | |
░░░█████░░░██░░░██░░░█████░░░█████░░░ |
Product.metaclass.send(:define_method, name.to_s) do | |
-> { Product.send(:relation).order(order_text) } | |
end |
class Rack::SecureHeaders | |
def initialize(app, options = {}) | |
@app, @options = app, options | |
end | |
def call(env) | |
response = @app.call(env) | |
# [status, headers, response] = response | |
number_of_colors = 60 #number of colors you want to generate in total. | |
z = 12 #"set size" | |
ang = 180/(z) | |
s = 30 #desired saturation constant, 1 to 100 | |
v = 50 #desired value/lightness constant, 1 to 100 | |
complement = (0..z/2).map{|i| (0..180).step(ang).map{|h| [[h + i,s,v], [h + i + 180,s,v] }} | |
triad = (0..z/2).map{|i| (0..180).step(ang).map{|h| [[h + i,s,v], [h + i + 60,s,v], [h + i + 120,s,v]] }} |
module Mokha | |
class HomeController < Mokha::BaseController | |
def index | |
@view = Mokha::HomePresenter.new | |
@view.user = User.includes(:ratings).find(current_user) | |
@view.user.track('Opened Mokha') | |
end |
// COLOR SCHEMES | |
$leche: #BBA993 | |
$caramel: #CC9966 | |
$shit-brown: #330000 | |
$craft-red: rgb(238, 64, 55) | |
$dark-red: #660000 | |
$satan-grey: #666 | |
$tres-gris: #333 | |
// FONTS |
$ brew update
$ brew install rbenv
$ brew install ruby-build
append eval "$(rbenv init -)"
to your bash profile
$ rbenv install 1.9.3-p327
..................... | |
First, the setup: | |
What problem are we're trying to solve? I'd call it coupling and I'll use the example from poodr to describe my take on it. | |
When Gear knows the name of Wheel, Wheel is a bit glued into Gear. Imagine that Gear has a gear_inches method that needs to get a Wheel's diameter. | |
def gear_inches |
# | |
# Insert an automatic text MIME part into HTML e-mail. | |
# (c) Daniel Doubrovkine, Art.sy 2012 | |
# MIT License | |
# | |
class ActionMailerWithTextPart < ActionMailer::Base | |
def collect_responses(headers) | |
responses = super(headers) | |
html_part = responses.detect { |response| response[:content_type] == "text/html" } |
<!DOCTYPE html> | |
<html xmlns="http://www.w3.org/1999/xhtml"> | |
<head> | |
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type"> | |
<title>*|Giver|* bought you a coffee tasting box subscription!</title> | |
</head> | |
<body leftmargin="0" marginheight="0" marginwidth="0" offset="0" topmargin="0" style="background-color:#bba993;-webkit-text-size-adjust:none;padding:0;margin:0;width:100%"> | |
<center> | |
<table border="0" cellpadding="0" cellspacing="0" height="100%" id="backgroundTable" width="100%" style="margin:0;padding:0;width:100%;height:100%;background-color:#669999"><tr> | |
<td align="center" valign="top" style="border-collapse:collapse"> |