Skip to content

Instantly share code, notes, and snippets.

View hey24sheep's full-sized avatar
🐑

Heyramb Narayan Goyal hey24sheep

🐑
View GitHub Profile
@hey24sheep
hey24sheep / gist:21daff7c3a19f8c4c386ccc44b6eed02
Created April 7, 2025 10:44
.net auto format - add to csproj
-- Add this below line to your csproj .net project to auto format on build
<Target Name="PreBuild Format" BeforeTargets="PreBuildEvent" Condition=" '$(Configuration)' == '' Or '$(Configuration)' == 'Debug'">
<Exec Command="dotnet format --no-restore --severity warn --verbosity diagnostic" />
</Target>
@hey24sheep
hey24sheep / generic_css_template.css
Created February 26, 2025 10:56
generic css template
/* You can add global styles to this file, and also import other style files */
:root {
--main-color: #fff;
--second-color: #347deb;
--box-shadow: 0 10px 10px rgba(0, 0, 0, 0.1);
--facebook-color: rgb(60, 90, 154);
--google-color: rgb(220, 74, 61);
--app-landing-bg-color: linear-gradient(-225deg, #e3fdf5 0%, #ffe6fa 100%);
--blue-1-color: #6554e9;
@hey24sheep
hey24sheep / console_startup.cs
Created April 17, 2024 12:21
Startup.cs file for a console .net application
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using PubPeerScraper.Models.AppSettings;
using SharedUtils.BaseRestClient;
using SharedUtils.Database;
using SharedUtils.DataServices.Email;
using SharedUtils.DataServices.PubPeer.Publications;
using SharedUtils.DataServices.PubPeer.PubPeerComments;
using SharedUtils.DataServices.PubPeer.Users;
@hey24sheep
hey24sheep / CMDs for Angular with .Net in package.json
Last active April 9, 2024 06:38
CMDs for Angular + .Net in package.json
"scripts": {
"ng": "ng",
"prestart": "node aspnetcore-https",
"start": "run-script-os",
"start:windows": "ng serve --watch --hmr --port 44489 --ssl --ssl-cert %APPDATA%\\ASP.NET\\https\\%npm_package_name%.pem --ssl-key %APPDATA%\\ASP.NET\\https\\%npm_package_name%.key",
"start:default": "ng serve --watch --hmr --port 44489 --ssl --ssl-cert $HOME/.aspnet/https/${npm_package_name}.pem --ssl-key $HOME/.aspnet/https/${npm_package_name}.key",
"clean-certs": "dotnet dev-certs https --clean && del %APPDATA%\\ASP.NET\\https\\%npm_package_name%.pem && del %APPDATA%\\ASP.NET\\https\\%npm_package_name%.key",
"create-certs": "dotnet dev-certs https --trust",
"build": "ng build",
"watch": "ng build --watch --configuration development",
@hey24sheep
hey24sheep / blank_sp_template.sql
Created June 13, 2023 04:47
SQL Stored Procedure Template
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
/*
Purpose:
Author:
Date:
execuation : [sp_name] comma_sep_params
@hey24sheep
hey24sheep / InitAutoGenModel.cs
Created June 13, 2023 04:34
C# to Typescript Generator using "Reinforced Typings"
using Reinforced.Typings.Attributes;
[assembly: TsGlobal(UseModules = true, AutoOptionalProperties = true, DiscardNamespacesWhenUsingModules = true, ExportPureTypings = true, CamelCaseForMethods = true, CamelCaseForProperties = true)]
// DO NOT DELETE THIS FILE
// Configures auto generation properties
namespace SharedUtils.Models
{
public class InitAutoGenModel
{
@hey24sheep
hey24sheep / database_handler.cs
Created June 13, 2023 04:26
.Net C# Generic Stored Procedure Execute Reader
public class DatabaseHandler
{
#region Fields
#endregion
#region Constructor
public DatabaseHandler()
{
@hey24sheep
hey24sheep / efcore_command_cheat_sheet.txt
Last active March 12, 2023 05:55
Entity Framework Core Command Cheat Sheet
# to add new migration
add-migration "migration_name"
# to apply migration to db
update-database
# to revert applied migration
update-database "target_migration_name"
# to revert unapplied migration
@hey24sheep
hey24sheep / rarreg.key
Created March 11, 2023 11:31 — forked from MuhammadSaim/rarreg.key
Step 1: Create a file called rarreg.key Step 2: Paste into the file the raw content of this gist Step 3: Go to Winrar install directory (by default => c:\ProgramFiles\WinRAR\ ) Step 4: Paste the rarreg.key into WinRAR directory Step 5: Enjoy
RAR registration data
WinRAR
Unlimited Company License
UID=4b914fb772c8376bf571
6412212250f5711ad072cf351cfa39e2851192daf8a362681bbb1d
cd48da1d14d995f0bbf960fce6cb5ffde62890079861be57638717
7131ced835ed65cc743d9777f2ea71a8e32c7e593cf66794343565
b41bcf56929486b8bcdac33d50ecf773996052598f1f556defffbd
982fbe71e93df6b6346c37a3890f3c7edc65d7f5455470d13d1190
6e6fb824bcf25f155547b5fc41901ad58c0992f570be1cf5608ba9
@hey24sheep
hey24sheep / findcombinationsol.js
Last active May 11, 2020 20:00
Find combinations to reach given n using steps array
//Hey24sheep - 12 May 2020
/*
Find combinations for given n using steps array
//show invalid if not possible for given step
//input n = 9, steps=[1,2,6]
// output example