Skip to content

Instantly share code, notes, and snippets.

View edcsu's full-sized avatar

Ssewannonda Keith Edwin edcsu

View GitHub Profile
public void UpdateSpecificField(Employees entity, params Expression<Func<Employees, object>>[] updatedProperties)
{
foreach (var property in updatedProperties)
{
_context.Entry(entity).Property(property).IsModified = true;
}
}
@timbophillips
timbophillips / local-fonts-icons-angular
Created January 1, 2019 00:44
host roboto font and material icons locally in angular app
//// npm install --save roboto-fontface material-icons
//// put the below stuff into src/styles.scss
// for npm roboto-fontface package (to load local files)
$roboto-font-path: "~roboto-fontface/fonts" !default;
@import "~roboto-fontface/css/roboto/sass/roboto-fontface";
// for npm material-icons package (to load local files)
$material-icons-font-path: '~material-icons/iconfont/';
@matteocrippa
matteocrippa / flutter.md
Last active October 26, 2023 05:47
Flutter Cheatsheet

Flutter

A quick cheatsheet of useful snippet for Flutter

Widget

A widget is the basic type of controller in Flutter Material. There are two type of basic Widget we can extend our classes: StatefulWidget or StatelessWidget.

Stateful

StatefulWidget are all the widget that interally have a dynamic value that can change during usage. It can receive an input value in the constructor or reference to functions. You need to create two classes like:

@svrooij
svrooij / Certificates.cs
Last active November 26, 2023 11:20
C# generate X509Certificate2
/* By Stephan van Rooij
* See https://svrooij.nl/2018/04/generate-x509certificate2-in-csharp/
*/
using System;
using System.Security.Cryptography.X509Certificates;
using System.Security.Cryptography;
using Org.BouncyCastle.X509;
using Org.BouncyCastle.Utilities;
@joshi-kumar
joshi-kumar / using lambda match item in nested list( list in list)
Created February 17, 2018 12:01
using lambda (LINQ) find item in nested list (list under list)
query = query.Where(c => c.CustomerRoles.Select(cr => cr.SystemName).Contains(customerRole));
@cstroe
cstroe / OpenSourceCRM.rst
Last active May 30, 2024 11:53
A distilled list of open-source CRM software
@regisdiogo
regisdiogo / Startup.cs
Last active June 13, 2022 11:17
ASP.NET Core - Json serializer settings Enum as string and ignore null values
public class Startup
{
public IServiceProvider ConfigureServices(IServiceCollection services)
{
services.AddMvc().AddJsonOptions(options =>
{
options.SerializerSettings.Converters.Add(new Newtonsoft.Json.Converters.StringEnumConverter());
options.SerializerSettings.NullValueHandling = Newtonsoft.Json.NullValueHandling.Ignore;
});
}
@hootlex
hootlex / laravellocal.md
Last active May 3, 2024 08:06
Run laravel project locally

##Windows users:

cmder will be refered as console

##Mac Os, Ubuntu and windows users continue here:

  • Create a database locally named homestead utf8_general_ci
@kmlprtsng
kmlprtsng / asp_get_base_url.cs
Created August 14, 2013 14:54
Get Base URL or a part of URL
//*************** Solution 1 **************/
// http://forums.asp.net/t/1466607.aspx/1
//http://forums.asp.net/t/1383898.aspx
//would return http://localhost:2013 or http://localhost:2013/ApplicationPath
return string.Format("{0}://{1}{2}",
HttpContext.Current.Request.Url.Scheme,
HttpContext.Current.Request.ServerVariables["HTTP_HOST"],