Skip to content

Instantly share code, notes, and snippets.

View matteing's full-sized avatar
🤠
hey

Sergio Mattei matteing

🤠
hey
View GitHub Profile

Using embedded schemas

In this short recipe, we'll learn how to create a basic embedded schema within an existing Ecto schema.

Scenario

Imagine this scenario: we're building an application that needs to store user profile information. We'd have a User schema that looks like this:

# User schema
/*
Nombre: Sergio Mattei
ID: 801183252
Class/Seccion: CCOM 3033 SEC 001
Nombre de archivo: main_mattei_4a.cpp
Descripción: This program calculates the salary for employees based on a simple database format, and places results in another file.
Notes: This was fun to make.
I went a little overboard improving user experience details (like adding friendly colors), but it's just who I am.
I really like making things work nicely.
/*
Nombre: Sergio Mattei
ID: 801183252
Class/Seccion: CCOM 3033 SEC 001
Nombre de archivo: main_mattei_4a.cpp
Descripción: This program calculates the salary for employees based on a simple database format, and places results in another file.
Notes: This was fun to make.
I went a little overboard improving user experience details (like adding friendly colors), but it's just who I am.
I really like making things work nicely.
/*
Nombre: Sergio Mattei
ID: 801183252
Class/Seccion: CCOM 3033 SEC 001
Nombre de archivo: main_mattei_4a.cpp
Descripción: This program calculates the salary for employees based on a simple database format, and places results in another file.
Notes: This was fun to make.
I went a little overboard improving user experience details (like adding friendly colors), but it's just who I am.
I really like making things work nicely.
/*
Nombre: Sergio Mattei, Jasiel Rivera
ID: 801183252, 801-18-6809
Class/Seccion: CCOM 3033 SEC 001
Nombre de archivo: main_soundp_jasiel_mattei.cpp
Descripción: This thing modifies .wav files.
*/
#include "audiomanip.h"
/// \file
@matteing
matteing / Filter_mattei.cpp
Created November 9, 2019 03:05
NetworkAnalyzer sorting practice
/*
Nombre: Sergio Mattei
ID: 801183252
Class/Seccion: CCOM 3033 SEC 001
Nombre de archivo: Filter_mattei.cpp
Descripción: This implements the filtering algorithms for the NetworkAnalyzer.
*/
#include <vector>
@matteing
matteing / main_mattei_4a.cpp
Created October 31, 2019 05:41
Nomina 2.0
/*
Nombre: Sergio Mattei
ID: 801183252
Class/Seccion: CCOM 3033 SEC 001
Nombre de archivo: main_mattei_4a.cpp
Descripción: This program calculates the salary for employees based on a simple database format, and places results in another file.
Notes: This was fun to make.
I went a little overboard improving user experience details (like adding friendly colors), but it's just who I am.
I really like making things work nicely.
/*
Nombre: Sergio Mattei, Michael Terrefortes, Jasiel Rivera
ID: 801183252, 801186809, 801189110
Class/Seccion: CCOM 3033 SEC 001
Nombre de archivo: boxes_mattei.cpp
Descripción: This program shows a bunch of recursive boxes.
*/
#include "drawingWindow.h"
/// \fn void DrawingWindow::box(int x, int y, int sideLength, QColor c)
@matteing
matteing / main.cpp
Last active October 11, 2019 17:56
lab #6 - prettyplots-functions
/*
Nombre: Sergio Mattei, Michael Terrefortes, Andres Rosner
ID: 801183252, 801189110, 801147305
Class/Seccion: CCOM 3033 SEC 001
Nombre de archivo: main.cpp
Descripción: This has all of the pretty plots with functions and using passing by reference.
*/
#include<iostream>
@matteing
matteing / main.cpp
Created September 26, 2019 18:24
stick game
#include <iostream>
using namespace std;
int main()
{
int player = 1;
int sticks = 1;
int selection;