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 / app-1.spec.ts
Created August 15, 2017 20:34 — forked from wkwiatek/app-1.spec.ts
Angular 2 test snippets for Angular final version. Codebase for https://developers.livechatinc.com/blog/category/programming/angular-2/
// App
import { Component } from '@angular/core';
@Component({
selector: 'app',
template: '<span>{{ sayHello() }}</span>',
})
export class App {
public name: string = 'John';
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
namespace Aps.ManageIT
{
public class UpdateOrderNo
{
public string ContentTypeId { get; set; }
@niisar
niisar / taskkill
Created August 28, 2014 12:43
taskkill
Taskkill /IM win_word.exe /F
@niisar
niisar / linkedin-connect-hack.js
Created April 13, 2017 17:06
linkedin connect hack
jQuery('.search-result__actions--primary').each(function(index, value) {
setTimeout(function() {
if(value.innerText == 'Connect'){
jQuery(value).trigger('click');
jQuery('.button-primary-large').each(function(index, value) {
setTimeout(function() {
if(value.innerText == 'Send now'){
jQuery(value).trigger('click');
}
}, index * 1000);
@niisar
niisar / 404.html
Created January 18, 2017 18:45
GitHub single-page app hack
<!doctype html>
<html>
<head>
<!-- This stores the URL the user was attempting to go to in sessionStorage,
and then redirects all 404 responses to the app’s index.html page -->
<!-- See http://www.backalleycoder.com/2016/05/13/sghpa-the-single-page-app-hack-for-github-pages/ -->
<script>
sessionStorage.redirect = location.href;
</script>
<meta http-equiv="refresh" content="0;URL='https://USERNAME.github.io/PROJECT_NAME'"></meta>
@niisar
niisar / find duplicate in JavaScript.js
Created January 2, 2017 09:52
find duplicate in JavaScript
//this prototype function checks if an element is already in the array or not
//go through all the array and push the element to result if it is not
//this way we can eliminate duplicates
//result will contain the resultant array
Array.prototype.contains = function(k) {
for ( var p in this)
if (this[p] === k)
return true;
return false;
};
@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 / 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 / extract files from MSI package
Created June 12, 2014 15:44
extract files from MSI package
msiexec /a filepath to MSI file /qb TARGETDIR=filepath to target folder