Skip to content

Instantly share code, notes, and snippets.

require 'pry'
PRINTING_BOARD = <<-STRING.chomp
*| *| *| *
---|---|---|---
*| *| *| *
---|---|---|---
*| *| *| *
---|---|---|---
*| *| *| *

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.
/* Here is your chance to take over Socrates!
Spend 10 minutes on each of the following hacks to the Socrates website.
Enter them in the console to make sure it works and then save
your results here.
Choose a new pair for each. Add your names to the section you complete.
*/
@joelevering
joelevering / index.html
Created October 17, 2013 15:10 — 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>
//------------------------------------------------------------------------------------------------------------------
// YOUR CODE: Create your Zoo "object literal" and Animal "constructor" and "prototypes" here.
//------------------------------------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------------------------------------
// DRIVER CODE: Do **NOT** change anything below this point. Your task is to implement code above to make this work.
//------------------------------------------------------------------------------------------------------------------
@joelevering
joelevering / form-validator.js
Last active December 25, 2015 19:39 — forked from ksolo/form-validator.js
Form Validation
// shorthand for $(document).ready();
$(function(e){
//Your code...
function appendError(message){
$("#errors").append("<li>" + message + "</li>");
}
$('form').on("submit", function(e) {
var email = $('input[name=email]').val();
var password = $('input[name=password]').val();
@joelevering
joelevering / carousel.js
Created October 17, 2013 21:00 — forked from ksolo/carousel.js
Image Carousel
module Reverb
module Google
module ShoppingV2
class RemoveEndedOrSoldOutProducts
def self.remove
new.remove
end
def remove
@joelevering
joelevering / user.proto
Created September 9, 2016 18:51
Example Protobuf
message UserSignedUp {
optional bool newsletter_opt_in = 1;
optional string user_id = 2;
optional string registration_source = 3;
optional string referer = 4;
optional string aid = 5;
optional string url = 6;
optional string country_code = 7;
}
@joelevering
joelevering / table.go
Last active September 9, 2016 18:54
Create Table From Protobuf
func (d *DB) createTable(table string) {
if d.tableExists(table) {
return
}
var cols []string
for _, col := range defaultCols { // e.g. timestamp, uid
cols = append(cols, fmt.Sprintf(“%s %s”, col.Name, col.PGType()))
}
allCols := strings.Join(cols, “, “)
cmd := fmt.Sprintf(“CREATE TABLE %s (%s)”, table, allCols)