Skip to content

Instantly share code, notes, and snippets.

View fdervishi90's full-sized avatar

Flamur Dervishi fdervishi90

View GitHub Profile
@fdervishi90
fdervishi90 / xamarin.cs
Last active January 8, 2019 13:57
#xamarin #c#
// PCL difference between devices
switch (Device.RuntimePlatform)
{
case Device.iOS:
Padding = new Thickness(0, 20, 0, 0);
break;
case Device.Android:
Padding = new Thickness(0, 20, 0, 0);
break;
case Device.UWP:
@fdervishi90
fdervishi90 / c#.cs
Last active February 3, 2019 15:19
#asp #mvc
// Send mail c#
public static class Mail
{
public const string Host = "smtp.gmail.com";
//public const string Host = "exchange.tgroupcc.com";
public static MailAddress FromAddress { get; set; } = new MailAddress("greeti.albania@gmail.com", "GREETi");
public static string FromPassword { get; set; } = "Greeti2019";
public static string Subject { get; set; } = "GREETi: You have visitors.";
public static async void SendMail(MailAddress toAddress, string visitor)
1. Login
POST: https://172.28.150.60:8443/api/login
Body:
{
"username": "",
"password": "",
"remember": true
}
2. Get all sites info
@fdervishi90
fdervishi90 / .net core.cs
Last active September 24, 2019 13:12
.NET Core #core
// .NET CORE
CreateDefaultBuilder method functions:
1. Set up the web server
2. Load host and app configuration from config sources
3. Configure logging
AspNetCoreHostingModel:
1. OutOfProcess (default)
@fdervishi90
fdervishi90 / Docker.txt
Last active September 3, 2021 20:11
Docker
###### DOCKER #######
docker build . // create image from the current directory
docker run -p 3000:3000 xxxxx // run the image, open up port 3000 in host and 3000 on container, xxxxx id of the image
docker ps // list running containers
docker ps -a // all
docker stop xxxxxxx // stop container xxxxxxx