Skip to content

Instantly share code, notes, and snippets.

View dipaktelangre's full-sized avatar

Dipak Telangre dipaktelangre

  • Coditas
  • Pune
View GitHub Profile

Create dotnet project

dotnet new -l List all the avaialble template
dotnet new angular -n MyAppName Create porject from angualr template with name MyAppName
dotnet build build dotnet application dotnet run Run dotnet application

Launch VSCode from commandline

code command will open the VSCode editor

Guide for create first NPM package with typescript. Tutorial from scratch to productoin ready NPM package.

Tools

  • Visual Studio Code
  • Git bash
  • Command Line
  • Prettier Extension for VSCode
  • NPM
  • Typscript
@dipaktelangre
dipaktelangre / MongoDBA.txt
Created December 4, 2019 06:33
Some of the most important commands and references information for Mongo DBA
-------------Manually Install MongoDB Service -----------
mkdir c:\mongodata\inMemory\db
mkdir c:\mongodata\mmapv1\db
mkdir c:\mongodata\wiredTiger\db
mkdir c:\mongodata\inMemory\log
mkdir c:\mongodata\mmapv1\log
mkdir c:\mongodata\wiredTiger\log
sc.exe create MongoInMemory binPath= "\"C:\Program Files\MongoDB\Server\3.4\bin\mongod.exe\" --service --config=\"C:\Program Files\MongoDB\Server\3.4\inMemory.cfg\"" DisplayName= "MongoInMemory" start= "auto"
sc.exe create MongoWiredTiger binPath= "\"C:\Program Files\MongoDB\Server\3.4\bin\mongod.exe\" --service --config=\"C:\Program Files\MongoDB\Server\3.4\wiredTiger.cfg\"" DisplayName= "MongoWiredTiger" start= "auto"
@dipaktelangre
dipaktelangre / show-indexes.js
Created December 10, 2018 11:13 — forked from wpottier/show-indexes.js
MongoDB copy indexes
db.getCollectionNames().forEach(function(collection) {
indexes = db[collection].getIndexes();
indexes.forEach(function (c) {
opt = '';
ixkey = JSON.stringify(c.key, null, 1).replace(/(\r\n|\n|\r)/gm,"");
ns = c.ns.substr(c.ns.indexOf(".") + 1, c.ns.length);
for (var key in c) {
if (key != 'key' && key != 'ns' && key != 'v') {
if (opt != '') { opt+= ','}
if (c.hasOwnProperty(key)) {
@dipaktelangre
dipaktelangre / docker.bash
Last active September 13, 2020 10:15
MongoDB in docker and Docker commands
# Pull mongo image
docker pull mongo
# Run container from image mongo in background, publish 50001 host port to 27017 container port
docker run --name mongoserver --restart=always -d -p 50001:27017 mongo
#------------------------- Refrence Commands ----------------------
# Show docker images
docker images
@dipaktelangre
dipaktelangre / basic-mongo-queries.js
Last active November 8, 2021 21:27
MongoDB: Indexing - Create, Update, Delete and Analyze MongoDb Indexes
//show databases
show dbs
//Use Database test
use test
// show collections from the database
show collections
// show counts of records in collection
@dipaktelangre
dipaktelangre / mongo-feeder.js
Last active September 18, 2019 20:24
MongoDB: Seeding mongodb with test data through JS script and mongo shell
// Running the script from CMD
// > mongo db_name mongo-feeder.js
var names = [
"Dipak",
"Sham",
"John",
"Mitika",
"Mathias",
@dipaktelangre
dipaktelangre / CreateVersionHistory.sql
Last active May 24, 2016 13:20
Maintain DB scripts versions executed over particular DB to avoid duplicate script executions and more.
--- Create DBVersion Table to maintain the Versions
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[DBVersion](
[DBVersionId] [int] NOT NULL,
[ExecutionDate] [datetime] NOT NULL,
// UTIL library for having an common tools for handy use
// Author : Dipak
var KMUTIL = (function (util) {
// This is ninja function which will tell If there gonna be CSS restriction gottca in IE 9
var countCSSRules = function () {
var results = '',
log = '';
var totalSheets = document.styleSheets.length;
@dipaktelangre
dipaktelangre / AngularJS-notes
Last active August 29, 2015 14:14
Notes for session on AngularJS
/*
* Angular JS
*/
// Hello World Angular
<!DOCTYPE html>
<html ng-app>
<head>