Skip to content

Instantly share code, notes, and snippets.

<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>demo2</title>
<link rel="stylesheet" href="stylesheets/main.css">
<style>
html, body { height: 100%; margin: 0;}
#container { display: flex; height: 100%; flex-flow: row;}
#index { flex: 1; background: white; }
@epoch
epoch / linked_list.rb
Created March 20, 2014 00:48
linked list template
class Node
attr_accessor :value, :next_node
def initialize(value=nil)
@value = value
@next_node = nil
end
def to_s
@value || nil
@epoch
epoch / warmup_scrabble_quiz.md
Last active June 16, 2021 11:32
scrabble score

Scrabble Score

Write a program that, given a word, computes the scrabble score for that word.

eg. the word cabbage should have a score of 14
eg. the word cat should have a score of 5

Your program should be in a file named scrabble.rb or scrabble.js.

Robot Name

When robots come off the factory floor, they have no name.

The first time you boot them up, a random name is generated, such as RX837 or BC811.

In other words, if I say:

puts "Robot 1: "
@epoch
epoch / school.md
Last active January 19, 2021 13:59

Grade School

Write a small archiving program that stores students along with the grade that they are in.

This is meant to test your objects, class, hash & array knowledge. No actual database needed.

school = School.new("Haleakala Hippy School")
/** @jsx React.DOM */
var MyComponent = React.createClass({
getInitialState: function() {
// set up the initial state. used for "logical" initialization code
return {perMinute: '-', perDay: '-'};
},
componentDidMount: function() {
// fired only once, when the component is added to the DOM
// used for initialization code that has "side effects" i.e. i/o, jquery plugins, etc
var socket = io.connect(this.props.url);
/** @jsx React.DOM */
var MyRootComponent = React.createClass({
getInitialState: function() {
return {perMinute: '-', perDay: '-'};
},
componentDidMount: function() {
var socket = io.connect(this.props.url);
socket.on('business.clickout', this.setState.bind(this));
},
render: function() {
<html>
<head>
<title>Test</title>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<script src="http://fb.me/react-0.5.1.js"></script>
<script src="http://fb.me/JSXTransformer-0.5.1.js"></script>
</head>

Bob

Bob is a lackadaisical teenager. In conversation, his responses are very limited.

He answers 'Sure.' if you ask him a question. He answers 'Whatever.' if you tell him something. He answers 'Woah, chill out!' if you yell at him (ALL CAPS). He says 'Fine. Be that way!' if you address him without actually saying anything.

Write Bob so that you can have an interactive conversation with him.

Say

Write a program that will take a number from 0 to 99 and spell out that number in English.

In other words, if the input to the program is 22, then the output should be 'twenty-two'

e.g.

Say.new(22).in_english