Skip to content

Instantly share code, notes, and snippets.

View niisar's full-sized avatar
🎯
Focusing

Mohammed Nisar Ansari niisar

🎯
Focusing
View GitHub Profile
@niisar
niisar / Get previous version of npm
Created December 28, 2016 08:51
Get previous version of npm
npm install -g --upgrade npm@v3.10.7
@niisar
niisar / Show Hide folder in windows.md
Created December 15, 2016 01:52
Show Hide folder in windows.

Hide folder

attrib +s +h "D:\ws\ADMS"

Show folder

attrib -s -h "D:\ws\ADMS"

@niisar
niisar / Make a sync call using qjs.js
Created November 16, 2016 09:41
Make a sync call using q.js
// http://cdnjs.cloudflare.com/ajax/libs/q.js/0.9.6/q.js
function doSomethingAsync(item) {
return Q.promise(function(resolve) {
$("#results").append("<div>" + item + "</div>");
setTimeout(resolve.bind(null, item), 3000);
});
}
function doAsyncSeries(arr) {
return arr.reduce(function (promise, item) {
@niisar
niisar / hybernate-after-3-hour.cmd
Created October 27, 2016 18:48
hybernate-after-3-hour.cmd
ping -n 7200 127.0.0.1 > NUL 2>&1 && shutdown /h /f
@niisar
niisar / addlevel.js
Created October 19, 2016 06:34
add level
vm.recursiveSearch = function find(source, id, currentLevel) {
for (var key in source) {
if (source.hasOwnProperty(key)) {
source[key].level = currentLevel;
var item = source[key];
vm.kk.push(item);
if (item.nodeId === id) {
return item;
}
if (item.childNode) {
@niisar
niisar / Using CTRL+W to close tabs in Visual Studio.md
Created August 31, 2016 06:51
Using CTRL+W to close tabs in Visual Studio

In Tools | Options | Keyboard...

  1. Add CTRL+W as a Global shortcut for Window.CloseDocumentWindow
  2. Remove the CTRL+W shortcut for Edit.SelectCurrentWord

The caveat to this is if you are used to using CTRL+W to select the current word. If you do, find another shortcut that works for that.

@niisar
niisar / WordtoHTML.cs
Created July 23, 2016 09:15
WordtoHTML
using DocumentFormat.OpenXml.Packaging;
using OpenXmlPowerTools;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
using System.Drawing.Imaging;
@niisar
niisar / angular1 Validation1
Created June 30, 2016 12:56
angular1 Validation1
<!DOCTYPE html>
<html ng-app="gemStore">
<head>
<link rel="stylesheet" type="text/css" href="bootstrap.min.css" />
<script type="text/javascript" src="angular.min.js"></script>
<script type="text/javascript" src="app.js"></script>
</head>
<body ng-controller="StoreController as store">
<!-- Store Header -->
@niisar
niisar / ChainingMiddleware.cs
Last active June 18, 2016 08:46
KatanaConsole.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Owin;
using Microsoft.Owin.Hosting;
using Microsoft.Owin;
using System.IO;
namespace KatanaConsole
@niisar
niisar / main.ts
Created May 23, 2016 12:51
HTTP and Routing - Basic Routing
import { bootstrap } from '@angular/platform-browser-dynamic';
import { enableProdMode, provide } from '@angular/core';
import { T3AppComponent, environment } from './app/';
import { ROUTER_PROVIDERS } from '@angular/router';
if (environment.production) {
enableProdMode();
}
bootstrap(T3AppComponent,[