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).on('page:change', function() { | |
var $productContainer = $('#product-container'); | |
if ($productContainer.length) { | |
setInterval(fetchProducts, 500); | |
} | |
function fetchProduct() { | |
// some ajax code | |
} |
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
<html> | |
<head> | |
<script src="http://d3js.org/d3.v3.min.js" charset="utf-8"></script> | |
</head> | |
<body> | |
<script> | |
// set the height and width of your objects, if they are always the same. I assume this would be the case for a panel at least. You can always hard code it in the data array. | |
var house = {width: 24, height: 17.5} | |
var panel = {width: 2.5, height: 5.5} | |
// set size of you overall svg field. I arbitrarily chose 800 square. |
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
function find_lefts() { | |
var all = document.getElementsByTagName('*'); | |
var left_elements = []; | |
for (var i=0;i<all.length;i++) { | |
ti = window.getComputedStyle(all[i]).getPropertyValue('text-indent'); | |
if (ti.match(/-/)) { | |
left_elements.push(all[i]); | |
} | |
} | |
return left_elements; |
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
#!/usr/bin/env ruby | |
class SpecMaker | |
def initialize(file_info) | |
@classes_modules_and_methods = file_info[:classes_modules_and_methods] | |
@file_name = file_info[:file_name] | |
end | |
def write | |
File.open("#{file_name}_spec.rb", 'w') do |f| |
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
// As a user, I want to be able to add a list of numbers together to get their sum. | |
// As a user, I want to be able to find the mean of a list of numbers. | |
// As a user, I want to be able to find the median of a list of numbers. | |
/* Reflection: I think this challenge helped show a little bit about how working in a group as a programmer happens. Clearly communication is very important if many different people are working on different aspects of the same program to make sure everyone is on the same page. I'm glad we did this challenge.*/ |