This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Table "public.reverb_event_usersignedup" | |
Column | Type | Modifiers | |
---------------------+-----------------------------+----------- | |
timestamp | timestamp without time zone | | |
event_source | character varying(1024) | | |
newsletter_opt_in | character varying(1024) | | |
user_id | character varying(1024) | | |
registration_source | character varying(1024) | | |
referer | character varying(1024) | | |
aid | character varying(1024) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Determine what fields should be created for a specific event | |
func FetchFields(event string) ([]SchemaField, error) { | |
var fields []SchemaField | |
messageType := proto.MessageType(event) | |
if messageType == nil { | |
return fields, fmt.Errorf("schema does not exist: %s", event) | |
} | |
fields = FetchFieldsForStruct("", messageType.Elem()) | |
return fields, nil | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Reverb | |
module Google | |
module ShoppingV2 | |
class RemoveEndedOrSoldOutProducts | |
def self.remove | |
new.remove | |
end | |
def remove |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Shorthand for $(document).ready(); | |
$(function(){ | |
// Your code goes here... | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//------------------------------------------------------------------------------------------------------------------ | |
// 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. | |
//------------------------------------------------------------------------------------------------------------------ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 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. | |
*/ |
NewerOlder