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
$(document).ready(function() { | |
// create new grid object based on size[[x,x], [x,x]] | |
var grid = new Grid(5).init(); | |
// set top left (first element of first array) to be full | |
grid[0][0].value = 1; | |
// build the dom | |
grid.forEach(function(row, i) { | |
$("#grid").append("<div class='row row-" + i + "'></div>"); | |
row.forEach(function(spot){ | |
if (spot.value === 1) { |
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> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<table> | |
<thead> | |
<tr> |
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
source "https://rubygems.org" | |
gem 'faraday' | |
gem 'rspec' |
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
<section> | |
<section class="half green-light left" id="speaker-photo"> | |
<div class="spkr-prev left"><a id="prev2" href="">button</a></div> | |
<div class="spkr-middle left"> | |
<div class="spkr-cir" style="background-image: url(<?php echo $url ?>); ?>/img/tester.jpg)"></div> | |
<div class="speaker-name"><?php echo '<h2>' . get_the_title() . '</h2>'; ?></div> | |
</div> | |
<div class="spkr-next left"><a id="next2" href="">button</a></div> | |
<br style="clear: left"> | |
</section> |
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
/* Top menu items */ | |
.nav-bar ul { | |
margin:0; | |
padding:0; | |
list-style:none; | |
/*float:right;*/ | |
position:relative; | |
/*right:50%;*/ |
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
$('#hide1').hide(); | |
$("input:checkbox[value='The legal representative for the patient']").change(function(){ | |
$('#hide1').toggle(); | |
}); |
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
test_str = "Doo bee doo bee doo" | |
counted = Hash[test_str.downcase.split.map { |p| [p, 0] }] | |
#=> {"doo"=>0, "bee"=>0} | |
Desired output (counting number of times a word appears in a string, returned inside of a hash) | |
#=> {'doo' => 3, 'bee' => 2} |
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
Greenu::Application.routes.draw do | |
get "/markets" => "markets#index", :as => "markets" | |
get "/market/new" => "markets#new", :as => "new_market" | |
get "/market/:id" => "markets#show", :as => "market" | |
post "/markets" => "markets#create" |
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
<!-- will be put into helper and need to DRY--> | |
<% d = Date.today %> | |
<% today = d.wday %> | |
<% if today == 1 %> | |
<% today = "Monday" %> | |
<% elsif today == 2 %> | |
<% today = "Tuesday" %> | |
<% elsif today == 3 %> | |
<% today = "Wednesday" %> | |
<% elsif today == 4 %> |
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 'json' | |
require 'open-uri' | |
class MarketsController < ApplicationController | |
def index | |
@markets = Market.all | |
end | |
def show |
NewerOlder