Skip to content

Instantly share code, notes, and snippets.

View caiogranero's full-sized avatar
🐧

Caio Granero caiogranero

🐧
View GitHub Profile
@caiogranero
caiogranero / Program.cs
Last active July 19, 2023 14:54
ChangeTracking behaviour inside foreach with try/catch
using System;
using System.Collections.Generic;
using System.Linq;
public class Program
{
public static void Main()
{
new MyClass().Main();
class User {
constructor(firstName, lastName) {
this._firstName = firstName;
this._lastName = lastName;
}
static printAge(age) {
console.log("Esse usuário tem " + age + " anos.");
}
}
class User {
constructor(firstName, lastName) {
this._firstName = firstName;
this._lastName = lastName;
}
get fullName() {
console.log(this._firstName + " " + this._lastName);
}
class User {
constructor(firstName, lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
getFullName() {
console.log(this.firstName + " " + this.lastName);
}
}
@caiogranero
caiogranero / classe.js
Last active July 18, 2018 23:53
Classes com ECMA6
class User {
constructor(firstName, lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
getFullName() {
console.log(this.firstName + " " + this.lastName);
}
}
@caiogranero
caiogranero / prototype.js
Last active July 18, 2018 23:53
Classes com Prototype
function User(firstName, lastName) {
this.firstName = firstName;
this.lastName = lastName;
}
User.prototype.getFullName = function() {
console.log(this.firstName + " " + this.lastName);
};
var user = new User("Jon", "Snow");
var usuarios = [
{
nome: 'Diego',
habilidades: ['Javascript', 'ReactJS', 'Redux']
},
{
nome: 'Gabriel',
habilidades: ['VueJS', 'Ruby On Rails', 'Elixir']
}
]
var usuarios = [
{
nome: 'Diego',
habilidades: ['Javascript', 'ReactJS', 'Redux']
},
{
nome: 'Gabriel',
habilidades: ['VueJS', 'Ruby On Rails', 'Elixir']
}
]
const characters = [
{ name: 'Professor', appearAt: '10/05/2017 10:10:10'},
{ name: 'Nairobi', appearAt: '10/05/2017 12:10:10' },
{ name: 'Tókyo', appearAt: '10/06/2017 07:10:10' },
{ name: 'Rio', appearAt: '10/06/2017 09:10:10' },
{ name: 'Denver', appearAt: '10/07/2018 11:10:10' },
{ name: 'Berlim', appearAt: '10/07/2018 17:10:10' },
{ name: 'Helsinque', appearAt: '15/04/2017 12:10:10' },
{ name: 'Moscou', appearAt: '15/04/2017 12:10:10' },
{ name: 'Raquel Murillo', appearAt: '10/09/2020 07:10:10' }
const characters = [
{ name: 'Professor', appearAt: '10/05/2017 10:10:10'},
{ name: 'Nairobi', appearAt: '10/05/2017 12:10:10' },
{ name: 'Tókyo', appearAt: '10/06/2017 07:10:10' },
{ name: 'Rio', appearAt: '10/06/2017 09:10:10' },
{ name: 'Denver', appearAt: '10/07/2018 11:10:10' },
{ name: 'Berlim', appearAt: '10/07/2018 17:10:10' },
{ name: 'Helsinque', appearAt: '15/04/2017 12:10:10' },
{ name: 'Moscou', appearAt: '15/04/2017 12:10:10' },
{ name: 'Raquel Murillo', appearAt: '10/09/2020 25:10:10' }