Skip to content

Instantly share code, notes, and snippets.

View JeffCohen's full-sized avatar

Jeff Cohen JeffCohen

View GitHub Profile
@JeffCohen
JeffCohen / boostrap-template.html
Last active May 13, 2017 15:14 — forked from eng/index.html
Bootstrap Starter Template
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- The above 3 meta tags *must* come first in the head; any other head content must come *after* these tags -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="http://code.jquery.com/jquery-2.1.4.js"></script>
# you'd obviously have more settings somewhere
set :scm, :git
set :repository, "git@github.com:defunkt/github.git"
set :branch, "origin/master"
set :migrate_target, :current # this tells capistrano where to run the migration. otherwise it would try to use the latest release directory (/path/to/app/releases/2012XXXXXXXXX)
set :use_sudo, false
set :ssh_options, {:forward_agent => true} # so you can checkout the git repo without giving the server access to the repo
set :rails_env, 'production'
# These are here to override the defaults by cap
@JeffCohen
JeffCohen / gist:2790389
Created May 25, 2012 20:26
Vending Machine Script
# Vending Project
# Task 1 - Write a vending machine script that will dispence cokes until inventory is 0.
# Task 2 - Try adding the ability to keep track of capacity per brand
class VendingMachine
def initialize(total_inventory)
@coke, @sprite, @root_beer = [total_inventory/3,total_inventory/3,total_inventory/3]
@money = 0
@total_inventory = total_inventory * 50