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
# Recursive functions in ruby. | |
def factorial( number ) | |
if number <= 1 | |
1 | |
else | |
number * factorial( number - 1 ) | |
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
import React, { Component } from 'react'; | |
export default class CSSTricksHeader extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
downFacingPoints: "M-4,-4 L1004,-4 L1004,90 L804,90 L604,90 L404,90 L204,90 L-4,90 L-4,90 L-4,-4 Z" | |
}; | |
} |
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
function BinaryTree() { | |
this.root = null; | |
} | |
BinaryTree.prototype.addValue = function(value) { | |
if (this.root == null) { | |
this.root = new Node(value); | |
this.root.x = width / 2; | |
this.root.y = 50; | |
} else { |
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
function Node(value, x, y) { | |
this.value = value; | |
this.left = null; | |
this.right = null; | |
this.x = x; | |
this.y = y; | |
} | |
Node.prototype.addNode = function(node) { | |
if (node.value < this.value) { |
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 binaryTree; | |
function setup() { | |
createCanvas(1000, 800); | |
background(51); | |
binaryTree = new BinaryTree(); | |
for (var i = 0; i < 100; i++) { | |
binaryTree.addValue(floor(random(0, 1000))); | |
} |
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 lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<link rel="stylesheet" type="text/css" href="./css/index.css"> | |
<script src="./js/index.js"></script> | |
<title>Hello!</title> | |
</head> |
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
window.onload = function () { | |
document.getElementById('login').addEventListener('submit', function(e) { | |
e.preventDefault(); | |
document.getElementsByClassName('success')[0].style.display = 'block'; | |
}); | |
} |
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
.input-container { | |
padding: 10px; | |
} | |
.success { | |
color: green; | |
} | |
.visible { | |
display: block; |
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
require 'selenium-webdriver' | |
describe 'Login' do | |
before :each do | |
chromedriver_path = File.join(File.absolute_path('../..', File.dirname(__FILE__)), "test", "browsers", "chromedriver") | |
Selenium::WebDriver::Chrome.driver_path = chromedriver_path | |
@driver = Selenium::WebDriver.for :chrome | |
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
rspec spec/login_spec.rb | |
Failures: | |
1) Login succeeded | |
Got 0 failures and 2 other errors: | |
1.1) Failure/Error: @driver = Selenium::WebDriver.for :chrome | |
Selenium::WebDriver::Error::WebDriverError: | |
Unable to find chromedriver. Please download the server from http://chromedriver.storage.googleapis.com/index.html and place it somewhere on your PATH. More info at https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver. | |
# /var/lib/gems/2.3.0/gems/selenium-webdriver-3.5.2/lib/selenium/webdriver/common/service.rb:59:in `binary_path' | |
# /var/lib/gems/2.3.0/gems/selenium-webdriver-3.5.2/lib/selenium/webdriver/common/service.rb:49:in `initialize' | |
# /var/lib/gems/2.3.0/gems/selenium-webdriver-3.5.2/lib/selenium/webdriver/chrome/driver.rb:52:in `new' |
OlderNewer