Skip to content

Instantly share code, notes, and snippets.

View ctj01's full-sized avatar

Cristian Mendoza ctj01

View GitHub Profile
public class example
{
public void test(){
System.Console.WriteLine("i'm the firt example");
}
}
public class example_two{
private readonly example e;
public example_two()
public class example
{
public void test(){
System.Console.WriteLine("i'm the first example");
}
}
public class example_two{
private readonly example e;
public interface IFood
{
void Prepare();
}
}
public class Scrambled_eggs : IFood
{
public void Prepare()
{
Console.WriteLine("i'm preparing a Scrambled eggs");
}
}
public class Omelette : IFood
{
public void Prepare()
{
Console.WriteLine("im preparing a Omelette");
}
}
public class Chef
{
/// <summary>
/// doing dependency injection in the constructor
/// </summary>
private readonly IFood food;
public Chef(IFood food)
{
this.food = food;
}
@ctj01
ctj01 / promises.js
Last active January 21, 2021 13:56
const isYourFriendHappy = true;
const willGoingHisHome = new Promise((resolve, reject) => {
if(isYourFriendHappy)
{
const goodDay = {
games: 'enjoy good food'
}
const isYourFriendHappy = true;
const willGoingHisHome = new Promise((resolve, reject) => {
if(isYourFriendHappy)
{
const goodDay = {
games: 'enjoy good food'
}
@ctj01
ctj01 / program.cs
Last active January 24, 2021 00:32
class Program
{
public delegate int MyPrimerDelegado(int a, int b);
static void Main(string[] args)
{
MyPrimerDelegado del = Operaciones.Suma; // referenciando al metodo suma de la clase operaciones
int suma = del(6, 8);
del = Operaciones.Resta;// referenciando al metodo resta de clase operaciones
int resta = del(5, 2);
public delegate void CallBackTareaCompletada(string mensaje);
class Program
{
static void Main(string[] args)
{
CalllingCallback callback = new CalllingCallback();
callback.Tarea("soy la tarea inicial");
callback.Call();
}