Skip to content

Instantly share code, notes, and snippets.

# User list holds a list of names
# and their shopping items
# Expecting [name, [item1, item2]] style
user_list = []
# Prompting the user if they want to start
puts "Would you like to start a nested list?[y/n]"
response = gets.chomp
# ,o888888o. 8 8888 88 8 8888 8888888888',8888'
# . 8888 `88. 8 8888 88 8 8888 ,8',8888'
# ,8 8888 `8b 8 8888 88 8 8888 ,8',8888'
# 88 8888 `8b 8 8888 88 8 8888 ,8',8888'
# 88 8888 88 8 8888 88 8 8888 ,8',8888'
# 88 8888 `8. 88 8 8888 88 8 8888 ,8',8888'
# 88 8888 `8,8P 8 8888 88 8 8888 ,8',8888'
# `8 8888 ;8P ` 8888 ,8P 8 8888 ,8',8888'
# ` 8888 ,88'8. 8888 ,d8P 8 8888 ,8',8888'
@marcocerna
marcocerna / 0_reuse_code.js
Created September 30, 2013 20:39
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
<!doctype html>
<html>
<head>
<title>ATM</title>
<meta charset="utf-8">
<link rel="stylesheet" href="atm.css">
<script src="atm.js"></script>
</head>
<body>
<div id="content">

#Debugging (Use The Duck… )

Find the errors in the following

1.)

#Debugging (Use The Duck… )

Find the errors in the following

1.)

Sublime Text 2 – Useful Shortcuts (Mac OS X)

General

⌘T go to file
⌘⌃P go to project
⌘R go to methods
⌃G go to line
⌘KB toggle side bar
⌘⇧P command prompt

##jQuery

###Basics

  • Little bit of background on jQuery
  • How to include it
  • How to make sure it's included and works
  • How to use the documentation to explore methods (in the course of this class)

###Select elements and add property $('#topsquare').addClass('white-text');

<html>
<head>
<title>Puppies</title>
<link rel="stylesheet" type="text/css" href="puppies.css">
<script src="puppies.js"></script>
</head>
<body>
<center>
<div class="top">
<h1>Puppies - wait, is that a puppy?! </h1>
// name_of_obj.name_of_key_in_object => value_associated_with_that_key
var board = [
[0, 0, 0],
[0, 0, 0],
[0, 0, 0]
];
// Variable to store the winning player.
var winningPlayer= 0;