Skip to content

Instantly share code, notes, and snippets.

View ngfarjad's full-sized avatar
🏠
Working from home

Syed Farjad Zia Zaidi ngfarjad

🏠
Working from home
View GitHub Profile
@ngfarjad
ngfarjad / qloud-style.css
Created April 19, 2023 03:07
Qloud - Cloud Computing, Apps & Server Responsive HTML5 Template
/*
Template: Qloud - Cloud Computing, Apps & Server Responsive HTML5 Template
Author: iqonicthemes.in
Version: 1.0
Design and Developed by: iqonicthemes.in
NOTE: This is main stylesheet of template, This file contains the styling for the actual Template. Please do not change anything here! write in a custom.css file if required!
*/
/*================================================
[ Table of contents ]
@ngfarjad
ngfarjad / GcpSelfLinkParser.cs
Created January 19, 2022 18:14
Helps parse GCP Resources Self Link.
public static class SelfLinkParser
{
public static SelfLinkParserViewModel ParseSelfLink(this string id)
{
var result = new SelfLinkParserViewModel();
var resultParts = id.Split('/');
result.Name = resultParts.LastOrDefault();
result.Project = resultParts[Array.IndexOf(resultParts, "projects") + 1];
result.Region = resultParts[Array.IndexOf(resultParts, "regions") + 1];
@ngfarjad
ngfarjad / AzureResourceIdParser.cs
Last active June 3, 2024 17:07
Azure SDK Resource ID Parser, will return Resource Name, ResourceGroup, SubscriptionId, ResourceType, Provider.
using System;
using System.Linq;
using Azure.ResourceManager.Network.Models;
public static class ResourceGroupIdParser
{
public static AzureResourceIdParseViewModel ParseResourceId(this Resource resource)
{
var result = new AzureResourceIdParseViewModel();
var resultParts = resource.Id.Split('/');
@ngfarjad
ngfarjad / IRepository.cs
Last active February 12, 2019 20:56
Entity Framework: T4 Template with Automatic Repository Code Generation
public interface IRepository<T> where T : class
{
IQueryable<T> GetAll();
IQueryable<T> GetBy(Expression<Func<T, bool>> predicate);
T Find(int id);
T FindBy(Expression<Func<T, bool>> predicate);
void Insert(T entity);
bool Update(T entity);