Skip to content

Instantly share code, notes, and snippets.

View JeffCohen's full-sized avatar

Jeff Cohen JeffCohen

View GitHub Profile
@JeffCohen
JeffCohen / coins.rb
Created August 6, 2012 01:38
Coin Change Machine
require 'test/unit'
class ChangeMachine
# Returns an array indicating the quantity of
# each denomination required.
# [pennies, nickels, dimes, quarters]
def issue_coins(amount)
end
end
@JeffCohen
JeffCohen / gist:3405328
Created August 20, 2012 15:53
jQuery Starter
<h1>Welcome to Week 9</h1>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js"></script>
@JeffCohen
JeffCohen / gist:3425920
Created August 22, 2012 14:03
jQuery Core + jQuery UI
<h1>Welcome to Week 9</h1>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js">
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js"></script>
<script>
$(document).ready(function() {
$("h1").on("click", function() {
@JeffCohen
JeffCohen / gist:3958673
Created October 26, 2012 13:03
reset.css
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
@JeffCohen
JeffCohen / gist:3958681
Created October 26, 2012 13:05
styles.css
body {
background-image: url('/assets/low_contrast_linen.png');
font-family: 'Oswald', sans-serif;
padding: 40px;
}
header {
text-align: center;
}
@JeffCohen
JeffCohen / gist:3986887
Created October 31, 2012 12:57
Week 5 Ruby Challenge
class Person
attr_accessor :name
attr_accessor :hometown
def bio
# Add code here
end
end
@JeffCohen
JeffCohen / bootstrap_starter.html
Last active December 13, 2015 21:59
Bootstrap starter template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Bootstrap, from Twitter</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Le styles -->
@JeffCohen
JeffCohen / gist:5380180
Last active December 16, 2015 04:49
monopoly tests
require "test/unit"
#######################################################
#
# Your code starts on line 20.
#
# To run the tests from your command line:
#
# > rake
#
@JeffCohen
JeffCohen / shapes.js
Created May 23, 2013 22:49
JS shapes demo
<body></body>
<script src="http://gamingJS.com/Three.js"></script>
<script src="http://gamingJS.com/ChromeFixes.js"></script>
<script>
var camera, scene, renderer;
var geometry, material, mesh;
init();
animate();
@JeffCohen
JeffCohen / view_helpers.erb
Created June 11, 2013 15:48
Example view helpers
link_to "Search", "http://www.google.com"
link_to "Buy Something", "http://www.amazon.com"
link_to "Delete Something", "/items/4", method: 'delete'
link_to "Delete Something!", "/items/4", method: 'delete'
link_to "My Link", "/items/4", class: 'my-link-style'
image_tag "http://example.com/photo.jpg"
image_tag "logo.png"
image_tag "http://example.com/photo.jpg", size: '80x120'
image_tag "http://example.com/photo.jpg", width: '60px'