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> | |
<head> | |
<title>hi</title> | |
<style> | |
body, html { | |
background: #aaa; | |
font-family: monospace; |
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
var ShoppingCart = function(parent) { | |
var self = this; | |
self.parent = parent; | |
this.state = { | |
"items": { | |
"Chicken": 79.99, | |
"Horse": 1299.99, |
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
class NotEnoughCashError < Exception | |
end | |
class Bank | |
attr_reader :accounts | |
attr_reader :name | |
def initialize(name) | |
@name = name |
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> | |
<style> | |
html, body { | |
margin: 0; | |
padding: 0; | |
} | |
#wrapper { |
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
file = File.open('/usr/share/dict/words').read | |
lines = file.lines | |
$words = lines.map do |word| | |
word.strip.downcase | |
end |
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 'pg' | |
CONN = PG::Connection.new({ | |
host: 'localhost', | |
user: 'murat', | |
password: '', | |
dbname: 'lighthouse_2015_10' | |
}) | |
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> | |
<script src="https://code.jquery.com/jquery-1.11.3.min.js"></script> | |
<style> | |
body, html { padding: 0; margin: 0; } |
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
def read_dictionary | |
words = File.open('/usr/share/dict/words').read | |
words.each_line do |line| | |
word = line.chomp.downcase | |
yield(word) | |
end | |
end |
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("./config.rb") | |
require("./file.rb") | |
class EssayStats | |
include FileReader | |
def initialize | |
@words = read_file(Config::ESSAY_PATH) | |
end |
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
arr = [45, 234, 56758, 23, 1, 0, 0, 0, 0, 345345, 23] | |
def find_number(numbers, number) | |
numbers.each_with_index do |n, i| | |
if n == number | |
return i |