Skip to content

Instantly share code, notes, and snippets.

# Continuation - http://www.ruby-doc.org/core-2.1.3/Continuation.html
require 'continuation'
# class Continuity
# def initialize total
# @total = 5
# end
@stujo
stujo / Rakefile
Created October 2, 2014 16:03
Todo Helper Rakefile
desc 'Generate a migration timestamp'
task 'mtimestamp' do
puts Time.now.strftime("%Y%m%d%H%M%S")
end
desc 'Test Drive Code'
task "driver" do
puts "ADD #{`ruby todo.rb add Bake a delicious blueberry-glazed cheesecake`}"
puts "LIST #{`ruby todo.rb list`}"
@stujo
stujo / clicker.html
Created October 13, 2014 03:58
javascript-event-demos-clicker
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.1/normalize.min.css">
<style>
body
{
margin: 0 40px;
}
h4 { margin-top: 5px }
@stujo
stujo / clock.html
Created October 13, 2014 03:58
javascript-event-demos-clock
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.1/normalize.min.css">
<style>
body
{
margin: 0 40px;
}
h4 { margin-top: 5px }
@stujo
stujo / closure_clock.html
Created October 13, 2014 03:58
javascript-event-demos-closure-clock
<html>
<head>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.1/normalize.min.css">
<style>
body
{
margin: 0 40px;
}
h4 { margin-top: 5px }
@stujo
stujo / event-driven-programming.md
Last active August 29, 2015 14:07
JavaScript Event Driven Programming

#Event Driven Programming

#Overview

#First-class nature of functions

@stujo
stujo / oojs.md
Last active June 27, 2018 05:31
Object Oriented JavaScript

#Object Oriented Javascript

#Overview

  • Creating Objects in JavaScript
    • new Object();
    • Object Literal Notation (Important)
    • Factory Function
  • Review JavaScript's this
  • More Creating Objects in JavaScript
  • Constructor Function
@stujo
stujo / app.js
Last active August 29, 2015 14:07
JavaScript Racing Game
function App(playerCount, numSpaces) {
this._boardView = new BoardView('#board_container');
this._historyView = new HistoryView('#history_container');
this._graphView = new GraphView('#distribution_container');
this._playerCount = playerCount;
this._numSpaces = numSpaces;
this._history = [];
}
App.prototype = {
@stujo
stujo / jasmine.md
Created October 17, 2014 17:18
Jasmine

#Due Monday

P 5-9 Due Monday along with P10 MVP Outline as Issue On Challenge P10 Presented on Friday

P7 Reviews

#Jasmine - Unit Testing for JavaScript

@stujo
stujo / app.rb
Last active August 29, 2015 14:07
Mini Ajax Sinatra Example - A single file demonstrating Ajax with HTML Fallback
require 'sinatra'
require "sinatra/json"
def eight_ball
[
"Definitely",
"Most likely",
"Try again",
"Cannot predict now",
"Don't count on it",