Skip to content

Instantly share code, notes, and snippets.

@droberts-sea
droberts-sea / bicycle.rb
Last active August 26, 2016 18:08
Bicycle example
module Transportation
class Vehicle
def vechicle_method()
puts "I am a vehicle"
end
end
class Bicycle < Vehicle
attr_accessor :gear, :speed
def initialize()
<!doctype html>
<html class="no-js" lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Foundation Demonstration</title>
<link rel="stylesheet" href="css/foundation.css">
<link rel="stylesheet" href="css/app.css">
</head>
CHAR_COUNT=`rake routes | head -n 1 | sed 's/\(.*Prefix\).*/\1/' | wc -c | xargs`
for PREFIX in `rake routes | cut -c -${CHAR_COUNT} | awk '{$1=$1};1' | grep -v '^$' | grep -v "Prefix"` ; do
echo "\n"
echo $PREFIX
grep -n -i -I -d recurse --color=always "${PREFIX}_path" *
done
@droberts-sea
droberts-sea / app.js
Last active November 28, 2016 00:08
Ada C6 Backbone Views Checkin 1
import $ from 'jquery';
import Backbone from 'backbone';
var taskData = [
{
title: 'Mow the lawn',
description: 'Must be finished before BBQ on Sat afternoon'
}, {
title: 'Go to the Bank',
description: 'Need to make a transfer'
@droberts-sea
droberts-sea / app.js
Last active November 28, 2016 00:12
Ada C6 Backbone Views Checkin 2
import $ from 'jquery';
import _ from 'underscore';
import Backbone from 'backbone';
var taskData = [
{
title: 'Mow the lawn',
description: 'Must be finished before BBQ on Sat afternoon'
}, {
title: 'Go to the Bank',
@droberts-sea
droberts-sea / index.html
Last active November 28, 2016 01:41
Ada C6 Backbone Events Checkin 1
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/foundation/6.2.4/foundation.min.css">
<link rel="stylesheet" href="styles/index.css">
</head>
<body>
<main id="application" class="row">
<section class="small-12 columns">
@droberts-sea
droberts-sea / task_list_view.js
Last active November 28, 2016 04:39
Ada C6 Backbone Events Checkin 2
import $ from 'jquery';
import _ from 'underscore';
import Backbone from 'backbone';
import TaskView from 'app/views/task_view';
var TaskListView = Backbone.View.extend({
initialize: function(options) {
// Store a the full list of tasks
this.taskData = options.taskData;
@droberts-sea
droberts-sea / task_list_view.js
Last active November 28, 2016 04:59
Convert TaskListView to use a Task model
import $ from 'jquery';
import _ from 'underscore';
import Backbone from 'backbone';
import Task from 'app/models/task';
import TaskView from 'app/views/task_view';
var TaskListView = Backbone.View.extend({
initialize: function(options) {
// Compile a template to be shared between the individual tasks
var Luhn = function(number) {
// console.log("Doing Luhn check on " + number);
this.checkDigit = number % 10;
this.addends = [];
this.checksum = 0;
// for (var i = 1; number > 0; i++) {
// var i = 1;
var double = false;
while (number > 0) {
@droberts-sea
droberts-sea / index.html
Last active November 29, 2016 04:29
Ada C6 Backbone Models Check-in 2
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/foundation/6.2.4/foundation.min.css">
<link rel="stylesheet" href="styles/index.css">
</head>
<body>
<main id="application" class="row">
<section class="small-12 columns">