A Pen by Keith Raymond on CodePen.
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
p.bubble { | |
background: #6bc384; | |
color: #fff; | |
@include bubblify('right', #6bc384, 8px); | |
} | |
@mixin bubblify($dir, $color, $size: 10px) { | |
position: relative; | |
&:after { |
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
specify "my super awesome test here" do | |
nested_value = "my awesome string" | |
allow(model).to receive(:method) do |arg| | |
expect(arg).to include(:nested_key) | |
expect(arg[:nested_key]).to eq nested_value | |
end | |
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
defmodule GameOfLife do | |
use Application | |
@moduledoc """ | |
Documentation for GameOfLife. | |
""" | |
def start(_type, _args) do | |
import Supervisor.Spec, warn: false | |
init_alive_cells = [] |
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
defmodule GameOfLife.BoardServer do | |
use GenServer | |
require Logger | |
@name {:global, __MODULE__} | |
@game_speed 1000 | |
def start_link(alive_cells) do | |
case GenServer.start_link(__MODULE__, {alive_cells, nil, 0}, name: @name) do |
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 ApplicationController < ActionController::Base | |
...omitted code... | |
def check_ability action, obj | |
raise CanCan::AccessDenied unless can?(action, obj) | |
end | |
end | |
class UsersController < ApplicationController | |
load_and_authorize_resource except: [:create, :update] |