Skip to content

Instantly share code, notes, and snippets.

View Html table for print .html
<html>
<head>
<title>Title of the document</title>
<style>
table {
page-break-inside: auto;
}
tr {
page-break-inside: avoid;
page-break-after: auto;
View packages.json
"scripts": {
"ng": "ng",
"ngh": "ngh",
"gulp": "gulp",
"conventional-changelog": "conventional-changelog",
"start": "ng serve",
"build": "ng build",
"build:prod": "npm run build -- --prod --aot",
"build:demo:prod": "npm run build -- --prod --aot --base-href /ngx-admin/",
"test": "ng test",
View Commands
docker logs -f
docker ps -a
docker-compos down
docker run -ti abp/host:latest sh
docker run -ti abp/host:latest sh
docker exec -ti abp/host:latest bash
docker logs -f outputs_abp_host_1
docker network create dotnet
docker-compos down
View Ml
https://docs.microsoft.com/en-us/dotnet/machine-learning/how-does-mldotnet-work
View Last executed queries for a specific database.sql
SELECT deqs.last_execution_time AS [Time],
dest.text AS [Query],
dest.*
FROM sys.dm_exec_query_stats AS deqs
CROSS APPLY sys.dm_exec_sql_text(deqs.sql_handle) AS dest
--WHERE dest.dbid = DB_ID('msdb')
where dest.text like '%delete %'
ORDER BY deqs.last_execution_time DESC
--SELECT deqs.last_execution_time AS [Time], dest.text AS [Query], dest.*
View restore deleted data .sql
Recover Deleted Data From SQL Server Table by Transaction Logs
There are some prerequisites to be fulfilled before we start the process to recover deleted data from SQL table. To easily recover deleted rows from a table in SQL Server database, it must have the BULK-LOGGED or FULL recovery model at the time when the deletion first occurred. Some quick actions are required so that the logs are still available to perform the recovery of data.
Follow the steps given below to recover deleted data from SQL Server 2005, 2008, 2012, 2014, and 2016 by the use of transaction logs.
Step 1
Check the number of rows present in the table from which the data has been accidentally deleted using the below-mentioned query:
1
SELECT * FROM Table_name
View convert sql querty to comma seperated string.sql
SELECT p.Name as PermissionName, (STUFF( (select ',' + r.Name from Roles r where r.id in (select RoleId from RolePermissions rp where rp.RoleId =r.Id and rp.PermissionId = p.Id )
FOR XML PATH('')),
1, 1, '')) AS RoleName
FROM Permissions p
-------------------------------------------------
DECLARE @CodeNameString varchar(100)
SELECT
@CodeNameString = STUFF( (select ',' + r.Name from Roles r where r.id in (select RoleId from RolePermissions rp where rp.RoleId =r.Id and rp.PermissionId = p.Id )
FOR XML PATH('')),
View asp net bilerplate empty tables
truncate table [dbo].[AbpAuditLogs]
truncate table [dbo].[AbpEntityPropertyChanges]
DELETE FROM [dbo].[AbpEntityChangeSets]
DBCC CHECKIDENT ('OTCDB.dbo.AbpEntityChangeSets',RESEED, 0)
DELETE FROM [dbo].[AbpEntityChanges]
DBCC CHECKIDENT ('OTCDB.dbo.AbpEntityChanges',RESEED, 0)
DELETE FROM [dbo].[AbpTenantNotifications]
View dynamic read models.cs
using INTDV.BASECLASSES.BaseRepository;
using INTDV.BASECLASSES.Shared;
using INTDV.COMMUNICO.BACKEND.Core.Entities;
using INTDV.COMMUNICO.BACKEND.Core.Filters;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
View baserepo.cs
using INTDV.BASECLASSES.Shared;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Query;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Threading.Tasks;
namespace BaseRepository