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 / datatable.js
Created September 15, 2018 08:40
NodeJS + Datatable + mysql
module.exports = function (db, req, res, data) {
// const db = require('../db');
var tableName = data.table;
var columns = data.columns;
var modify = data.modifyColumns;
var actions = data.actionButton;
var searchValue = req.body['search[value]'];
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
$(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';
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"}
var IdleTime = 0;
setTime();
$(this).on("mousemove keypress", function () {
IdleTime = 0;
});
function setTime() {
setTimeout(function () {
IdleTime += 1;
console.log(IdleTime + " Second passed.");
checkTime();
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");
#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
@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
@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
"API Watch": {
"commandName": "Executable",
"executablePath": "dotnet",
"commandLineArgs": "watch run",
"workingDirectory": "$(ProjectDir)",
"launchBrowser": true,
"applicationUrl": "https://localhost:5001;http://localhost:5000",
"environmentVariables": {
"ASPNETCORE_ENVIRONMENT": "Development"
},