Skip to content

Instantly share code, notes, and snippets.

function arrayOfLight(x) {
var array = [];
for (var i = 0; i <= x; i++) {
array.push(i);
}
return array
}
alert(arrayOfLight(20));
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
</head>
<body>
<!-- TODO make navigation bar wider -->
<nav class="navbar navbar-default">
<div class="container-fluid">
@shinobcrc
shinobcrc / assignment_1.sql
Last active July 19, 2016 01:25
Bookstore-SQL-Assigment
SELECT
editions.isbn AS "ISBN"
FROM editions
INNER JOIN books ON (books.id = editions.book_id)
INNER JOIN publishers ON (editions.publisher_id = publishers.id)
WHERE publishers.name = 'Random House';
@shinobcrc
shinobcrc / box_of_bolts.rb
Created July 1, 2016 03:18
Robot Mock Test
require_relative 'robot'
class BoxOfBolts < Item
def initialize
super("Box of bolts", 25)
end
def feed(robot_to_feed)
@shinobcrc
shinobcrc / Gemfile
Created June 29, 2016 23:53
Stub Review
gem 'rspec'
gem 'pry'
gem 'byebug'
@shinobcrc
shinobcrc / barracks.rb
Created June 28, 2016 22:48
warcraft3.rb
require_relative 'footman'
class Barracks
attr_reader :gold, :food
def initialize
@gold = 1000
@food = 80
end
module Flight
def fly
puts "I'm a #{self.class}, I'm flying"
end
end
class Animal
attr_reader :num_legs, :warm_blooded
def initialize(num_legs, warm_blooded)
@num_legs = num_legs
#Problem 1
require 'rubygems'
require 'rest-client'
require 'open-uri'
wiki_url = "http://en.wikipedia.org/"
wiki_local_filename = "wiki-page.html"
@shinobcrc
shinobcrc / .rspec
Last active June 27, 2016 00:05 — forked from davidvandusen/.rspec
--color
@shinobcrc
shinobcrc / main.rb
Created June 25, 2016 21:10
2 Player Math game
require_relative 'two_player'
require_relative 'question'
@repl = true
@turn_number = 0
puts "Welcome to 2 Player Math"
print 'Player 1 name: '
@name = gets.chomp