Skip to content

Instantly share code, notes, and snippets.

View egbakou's full-sized avatar
:octocat:

Laurent Egbakou egbakou

:octocat:
View GitHub Profile
@egbakou
egbakou / cours.ics
Last active December 6, 2020 17:01
BEGIN:VCALENDAR
CALSCALE:GREGORIAN
BEGIN:VEVENT
DTSTAMP:20200919T142610Z
DTSTART:20201019T081500Z
DTEND:20201019T101500Z
SUMMARY:CM - Management de projet
LOCATION:Amphi 001
DESCRIPTION:L3 M. Dupont charles
@egbakou
egbakou / BehaviorBase.cs
Last active December 23, 2019 11:11
Xamarin Forms Event To Command Behavior Gist
using System;
using Xamarin.Forms;
namespace EventToCommand.Behaviors
{
public class BehaviorBase<T> : Behavior<T> where T : BindableObject
{
public T AssociatedObject { get; private set; }
protected override void OnAttachedTo(T bindable)
using System;
namespace System{
public interface IEntity
{
public int Id { get; set; }
public DateTime CreatedAt { get; set; }
public DateTime UpdatedAt { get; set; }
@egbakou
egbakou / search-by-continent.cs
Created August 11, 2019 06:26
Search by continent when using RESCountries.NET.
// Search by continent: Africa, Americas, Asia, Europe, Oceania
List<Country> result = await RESTCountriesAPI.GetCountriesByContinentAsync(string continent);
@egbakou
egbakou / search-by-name.cs
Last active August 11, 2019 06:26
Search by country name when using RESCountries.NET.
// Search by country name
List<Country> result = await RESTCountriesAPI.GetCountriesByNameContainsAsync(string name);
// Search by country full name
Country country = await RESTCountriesAPI.GetCountryByFullNameAsync(string fullName);
@egbakou
egbakou / NamesInSpanish.cs
Last active August 12, 2019 11:05
Get all countries in Spanish language when using RESTCountries.NET
// Get all countries in Spanish language
var countries = await RESTCountriesAPI.GetAllCountriesAsync();
List<string> countriesInSpanish = countries.Select(c => c.Translations.Es).ToList();
@egbakou
egbakou / get-country-name-list.cs
Last active August 11, 2019 06:14
Get a list of country names using RESTCountries.NET
// Get a list of country names
var all = await RESTCountriesAPI.GetAllCountriesAsync();
List<string> countries = all.Select(c => c.Name).ToList();
@egbakou
egbakou / get-all-countries.cs
Created August 11, 2019 00:28
Get all countries when using RESTCountries.NET
// Get all countries
List<Country> countries = await RESTCountriesAPI.GetAllCountriesAsync();
@egbakou
egbakou / add-namesapace.cs
Last active August 11, 2019 00:25
Getting started with RESTCountries.NET.
// Add namespace
using RESTCountries.Services;