Skip to content

Instantly share code, notes, and snippets.

View priyankakundu's full-sized avatar

priyankakundu

View GitHub Profile
@priyankakundu
priyankakundu / gist:731de8fde00f19f8d74df9df014c97f8
Created March 22, 2022 11:19 — forked from tejpaldev/gist:4ceebdca16b1fb3a6049595b31509ae5
Check if MaxJsonDeserializerMembers values set
<add key="aspnet:MaxJsonDeserializerMembers" value="2147483647" />
Response.Write(new ScriptingJsonSerializationSection().MaxJsonLength);
int y = Nullable.Compare<DateTime>(DateTime.UtcNow, x);
if y=-1 means x is greater
if y=1 means x is lesser
if y=0 means equal
select f.*,
count(*) over (
partition by title, uk_release_date
) ct
from films f;
select *
from (
select f.*,
count(*) over (
Pivot C# Array or DataTable: Convert a Column To a Row with LINQ
var data = new[] {
new { Product = "Product 1", Year = 2009, Sales = 1212 },
new { Product = "Product 2", Year = 2009, Sales = 522 },
new { Product = "Product 1", Year = 2010, Sales = 1337 },
new { Product = "Product 2", Year = 2011, Sales = 711 },
new { Product = "Product 2", Year = 2012, Sales = 2245 },
new { Product = "Product 3", Year = 2012, Sales = 1000 }
};
1.Create a cookie before writing the stream to Response.
2.Use JavaScript timer to check whether the value of cookie is set to true
3.If downloaded cookie is true, display a message that file download is successful and erase cookie
<script>
var timer;
function getCookie(name) {
var re = new RegExp(name + "=([^;]+)");
var value = re.exec(document.cookie);
return (value != null) ? unescape(value[1]) : null;
@priyankakundu
priyankakundu / test
Created March 22, 2022 11:17 — forked from tejpaldev/test
testng
"scripts": {
"ng": "ng",
"start": "ng serve --open",
"start-hmr": "ng serve --configuration hmr --source-map=false --hmr-warning=false",
"start-hmr-sourcemaps": "ng serve --configuration hmr --source-map=true --hmr-warning=false",
"build": "node --max_old_space_size=6144 ./node_modules/@angular/cli/bin/ng build --aot --deploy-url=dist/ --output-hashing all --watch",
"build-watch": "node --max_old_space_size=6144 ./node_modules/@angular/cli/bin/ng build --deploy-url=dist/ --output-hashing all --watch",
"build-stats": "node --max_old_space_size=6144 ./node_modules/@angular/cli/bin/ng build --dev --stats-json",
"build-prod": "node --max_old_space_size=6144 ./node_modules/@angular/cli/bin/ng build --prod --aot --deploy-url=dist/",
"build-ci": "ng build --prod --aot --output-path=prod/dist --deploy-url=dist/",
@priyankakundu
priyankakundu / PasswordCryptoServiceProvider.cs
Created March 22, 2022 08:44 — forked from tejpaldev/PasswordCryptoServiceProvider.cs
C# password-based encryption helper class.
using System;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
public class PasswordCryptoServiceProvider : IDisposable
{
protected const string Base58Chars = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
private readonly SymmetricAlgorithm algorithm;