Skip to content

Instantly share code, notes, and snippets.

View monir-dev's full-sized avatar

Md Monir Hossain monir-dev

  • http://yescoders.com/
  • Dhaka, Bangladesh
View GitHub Profile
@monir-dev
monir-dev / RDLC report show inside aspdotnet core application
Created September 26, 2022 14:00
RDLC report show inside aspdotnet core application
public IActionResult RdlcReportPreview()
{
// Require package: AspNetCore.Reporting
var path = $"{this._IWebHostEnvironment.WebRootPath}\\Report\\NewReport.rdlc"; // Local Path
AspNetCore.Reporting.LocalReport localReport = new LocalReport(path);
localReport.AddDataSource("DataSetOne", #DataListOne);
localReport.AddDataSource("DataSetTwo", #DataListTwo);
"API Watch": {
"commandName": "Executable",
"executablePath": "dotnet",
"commandLineArgs": "watch run",
"workingDirectory": "$(ProjectDir)",
"launchBrowser": true,
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},
@monir-dev
monir-dev / pdocrash.php
Created January 28, 2021 05:38 — forked from bradtraversy/pdocrash.php
PDO & Prepared Statements Snippets
<?php
$host = 'localhost';
$user = 'root';
$password = '123456';
$dbname = 'pdoposts';
// Set DSN
$dsn = 'mysql:host='. $host .';dbname='. $dbname;
// Create a PDO instance
@monir-dev
monir-dev / ExportSchema.ps1
Created January 30, 2020 05:53 — forked from cheynewallace/ExportSchema.ps1
Export MSSQL schema with PowerShell. This script will export your schema definitions for tables, stored procs, triggers, functions and views to .sql files
# Usage: powershell ExportSchema.ps1 "SERVERNAME" "DATABASE" "C:\<YourOutputPath>"
# Start Script
Set-ExecutionPolicy RemoteSigned
# Set-ExecutionPolicy -ExecutionPolicy:Unrestricted -Scope:LocalMachine
function GenerateDBScript([string]$serverName, [string]$dbname, [string]$scriptpath)
{
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | Out-Null
#disable automatic repair on Windows 10
------------------------------------------
Here is a step-by-step guide on how to stop automatic repair on Windows 10:
Open Start
In the list of programs, search for Command Prompt, right- click it and choose Run as Administrator.
Type the command “bcdedit” and press the Enter button.
Under the Windows boot loaders section, look for the identifier and recoveryenabled values. They should read:
identifier: {current}
recoveryenabled: yes
To disable automatic repair input the following command followed by pressing the Enter key: bcdedit /set {current} recoveryenabled no
Process cmd = new Process();
cmd.StartInfo.FileName = "cmd.exe";
cmd.StartInfo.RedirectStandardInput = true;
cmd.StartInfo.RedirectStandardOutput = true;
cmd.StartInfo.CreateNoWindow = true;
cmd.StartInfo.UseShellExecute = false;
cmd.Start();
cmd.StandardInput.WriteLine(@"cd 'C:\Users\Monir\Desktop\Exchange Script'");
cmd.StandardInput.WriteLine(@"dir");
var IdleTime = 0;
setTime();
$(this).on("mousemove keypress", function () {
IdleTime = 0;
});
function setTime() {
setTimeout(function () {
IdleTime += 1;
console.log(IdleTime + " Second passed.");
checkTime();
public string SEND_PUSH_NOTIFICATION()
{
// one or more ids. Change "ANDROID_CLIENT_ID" with real ids
var REGISTRATIONS_IDS = new List<string>() { "ANDROID_CLIENT_ID" };
Dictionary<string, string> OptionalData = new Dictionary<string, string>()
{
{ "Category", "NEW_INDIVIDUAL_REQUEST"},
{ "Title", "Title"},
{ "SubTitle", "SubTitle"}
$(document).on("click", ".yourClass", function() {
var links = document.getElementsByClassName('nav-menu');
for (var i = 0; i < links.length; i++){
var now = links[i];
if(now.className.includes("active")) {
now.classList.remove("active");
}
}
this.className += ' active';
LINQ Cheat Sheet By: Monir Hossain
Restriction
context.Courses.Where(c => c.Level == 1);
Ordering
context.Courses
.OrderBy(c => c.Name) // or OrderByDescending
.ThenBy(c => c.Level); // or ThenByDescending
Projection