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
# Ignore static version of the site (used to upload error pages to S3 for Heroku errors) | |
/out |
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
import Data.Semigroup | |
import Data.Functor | |
import Control.Applicative | |
data Validation err a = Failure err | Success a | |
deriving Show | |
instance Functor (Validation err) where | |
fmap f (Success a) = Success (f a) | |
fmap _ (Failure e) = Failure e |
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
##Create a migration | |
### rails g migration make_unicode_friendly | |
class MakeUnicodeFriendly < ActiveRecord::Migration | |
def change | |
alter_database_and_tables_charsets "utf8", "utf8_general_ci" | |
end | |
private | |
def alter_database_and_tables_charsets charset = default_charset, collation = default_collation |
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
<div class= "row"> | |
<div class="header"> | |
<h2 class= "learn-more"> Learn More </h2> | |
</div> | |
<div class="modalbutton"> | |
<button type="button" class="btn btn-primary" data-toggle="modal" data-target=".bs-example-modal-lg">Awesomness</button> | |
</div> | |
<!-- Large modal --> | |
<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel"> | |
<div class="modal-dialog modal-lg"> |
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
if (5 + 5 == 10) | |
puts 'this is true' | |
else | |
puts 'this is false' | |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<title>Nik the Nomad</title> | |
<link href="css/normalize.css" rel="stylesheet"> |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta charset="Web developer"> | |
<title>About Me</title> | |
<link href="css/bootstrap.css" rel="stylesheet"> | |
<link href="css/styles.css" type="text/css" rel="stylesheet"> |
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
mercury:search-test robb$ ruby ./test.rb | |
user system total real | |
Binary search: 0.000000 0.000000 0.000000 ( 0.000016) | |
Iterative search: 0.000000 0.000000 0.000000 ( 0.004715) | |
Binary search: 0.000000 0.000000 0.000000 ( 0.000010) | |
Iterative search: 0.010000 0.000000 0.010000 ( 0.006112) | |
Binary search: 0.000000 0.000000 0.000000 ( 0.000016) | |
Iterative search: 0.010000 0.000000 0.010000 ( 0.010991) |
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 Agent < ActiveRecord::Base | |
validates :first_name, :last_name, :email, presence: true | |
validates :email, uniqueness: true | |
has_many :missions | |
scope :on_assignment, -> { Agent.joins(:missions).where(missions: { status: 'active' }) } | |
scope :not_on_assignment, -> { where.not(id: Agent.on_assignment.pluck(:id)) } | |
def name | |
"#{first_name} #{last_name}" | |
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
require 'rspec' | |
describe "Behaviour" do | |
it "should pass" do | |
true.should eq true | |
end | |
it "should fail" do | |
true.should eq false | |
end |
NewerOlder