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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Test</title> | |
<link rel="stylesheet" type="text/css" href="css/test.css"> | |
</head> | |
<body> | |
<div class="container"> | |
<div id="dealersHand" class="cf"></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
var deck = [2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,6,6,6,6,7,7,7,7,8,8,8,8,9,9,9,9,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,11,11,11,11]; | |
// Creates a Call To Action div | |
// Add button class to create basic button style | |
// @params c - the class | |
// @params i - the id e.g. ctaHit, ctaStand etc | |
// @params t - the text | |
// @params f - the function to call onclick | |
function ctaGenerator(c, i, t) { | |
var cta = document.createElement('div'); | |
cta.setAttribute('class', c); |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Test</title> | |
<link rel="stylesheet" type="text/css" href="css/test.css"> | |
</head> | |
<body> | |
<div class="container"> | |
<div id="playerScore"></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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Test</title> | |
<link rel="stylesheet" type="text/css" href="css/test.css"> | |
</head> | |
<body> | |
<div class="container"> | |
<div id="playerScore"></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
@import url(http://fonts.googleapis.com/css?family=Source+Sans+Pro:300); | |
body { | |
font-family: 'Source Sans Pro', sans-serif; | |
background-color: #F6F8F8; | |
font-size: 1.1em; | |
//font-weight: bold; | |
} | |
.cf:before, .cf:after { |
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
.card { | |
width: 50px; | |
height: 100px; | |
border: 1px solid #ccc; | |
border-radius: 4px; | |
float: left; | |
margin: 5px; | |
} |
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
angular.module('app', []) | |
.controller('MainCtrl', MainCtrl) | |
.directive('checkBox', checkBox); | |
function checkBox() { | |
var directive = { | |
controller: Controller, | |
link: link, | |
restrict: 'E', | |
require: 'ngModel', |
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
projects/index | |
<h1>Listing projects</h1> | |
<br /> | |
<div id="projects_list"> | |
<% @projects.each do |project| %> | |
<%= project.name %><br> | |
<% end %> | |
</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
before_save :set_expiration_date #once its been saved update the expires_at attribute with the set_expiration_method | |
def expired? | |
if accepted! #if an offer has been accepted it cannot expire | |
return false | |
else | |
created_at > expires_at #if created_at is greater than expires_at return true, else return false | |
end | |
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 AddExpiresAtToOffer < ActiveRecord::Migration | |
def change | |
add_column :offers, :expires_at, :date | |
Offer.reset_column_information | |
Offer.find_each do |offer| | |
puts '...running loop' | |
offer.update_attribute(:expires_at, offer.created_at + 6.months) | |
offer.save |
OlderNewer