Skip to content

Instantly share code, notes, and snippets.

View mrandyclark's full-sized avatar

Andrew Clark mrandyclark

View GitHub Profile
var map = ["string", "string2"]
$.each(map, function(key, value) {
alert(key + ': ' + value);
});
#model for drinks
belongs_to :person
<html>
<head>
<style>
#benson { overflow: hidden; }
#benson select { float: left; margin: 0px 10px; }
</style>
</head>
# this is pseudo code, so you'll probably need to fix it.
def index
#@tabs = [];
#@articles.each do |article|
# @tags << article.tags
#end
@tabs = [
controller :sites do
match '/:action'
end
<script>
function WriteToTheConsole(information) {
console.log(information);
}
$(document).ready(function() {
WriteToTheConsole("hey jackass");
});
<form id="new_size">
<input type="text" name="size_name" id="size_input" />
<input type="submit" />
</form>
<script>
$(document).ready(function() {
$("#new_size").submit(function(evt) {
<script>
// this is a function that you're going to pass a messageCode to.
// the message code will be an integer and you'll return a string
// that is the error message.
function getErrorMessage(messageCode)
{
var errorMessage = "";
// start the switch statement
<script>
// this is a function that you're going to pass a messageCode to.
// the message code will be an integer and you'll return a string
// that is the error message.
function getErrorMessage(messageCode)
{
var errorMessage = "";
<?php
$action = $_GET['action'];
API::process_action($action);
?>
<?php
class API {