Skip to content

Instantly share code, notes, and snippets.

@gregRV
gregRV / 0_reuse_code.js
Created February 4, 2014 08:38
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
// GREG AND MARK, changing colors and text
$('.span8').attr('color', 'red');
[
<h1 class=​"span8" color=​"red">​…​</h1>​
,
<div class=​"span8" color=​"red">​…​</div>​
]
$('.span8').css('color', 'red');
[
<h1 class=​"span8" color=​"red" style=​"color:​ red;​">​…​</h1>​
@gregRV
gregRV / index.html
Created July 16, 2013 05:15 — forked from dbc-challenges/index.html
DBC Phase 2 Practice Assessment Part 3
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="http://cdn.jsdelivr.net/normalize/2.1.0/normalize.css">
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:100,900">
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.0.2/css/font-awesome.min.css">
</head>
@gregRV
gregRV / index.html
Created June 28, 2013 04:23 — forked from dbc-challenges/index.html
DBC Phase 2 Practice Assessment Part 3
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="http://cdn.jsdelivr.net/normalize/2.1.0/normalize.css">
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:100,900">
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.0.2/css/font-awesome.min.css">
</head>
$(document).ready(function () {
$('form').on('submit',function(e){
e.preventDefault();
$('#die img').hide();
$.ajax({
type: 'POST',
url: '/rolls'
}).done(function(response){
console.log(response);
$("#die").append(response);

Instructions:

  1. Download this application skeleton.
  2. Convert the app to use AJAX.
  3. Add any files you changed to your gist and submit your code.
@gregRV
gregRV / vehicle.rb
Last active December 18, 2015 09:19 — forked from aespaldi/vehicle.rb
class Vehicle
attr_reader :color, :status
def initialize(color)
@color = color
end
def drive
@status = :driving
end