Skip to content

Instantly share code, notes, and snippets.

View niisar's full-sized avatar

Mohammed Nisar Ansari niisar

View GitHub Profile
niisar / web-scrapping_r.ipynb
Last active July 17, 2020 12:59
Web Scrapping_R.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
niisar / Git
Created January 31, 2019 13:23
Git Helper

If you accidentally mistype a commit message, you can change it using git commit --amend - m "new message"

niisar / Detect the position of an object - computer
Last active January 28, 2019 09:20
Detect the position of an object - computer

Detect the position of an object - computer vision


Comparing two images: The observed position vs the required position.

Solution using (OpenCV-Python)

  1. Load your image and binarize it.
  2. Use cv2.findContours(thresh, 1, 2) to find the contour of interest object.
  3. Find the bounding rectangle using cv2.boundingRect(cnt) function.
niisar /
Last active September 2, 2017 05:19
bot's Note

Why bot framework

Developers writing bots all face the same problems:

  • Require I/O
  • Lang and Dialog Skill


You can create a bot with any programming language by using the Bot Framework REST API. There are three REST APIs in the Bot Framework:.

  • Bot Connector REST API : send and receive messages to channels configured in the Bot Framework Portal.
  • Bot State REST API : enables your bot to store and retrieve state.
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
// App
import { Component } from '@angular/core';
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 / 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('.button-primary-large').each(function(index, value) {
setTimeout(function() {
if(value.innerText == 'Send now'){
}, index * 1000);
niisar / SessionExtensions.cs
Last active June 20, 2020 10:07
SessionExtensions in core 1.0
using Microsoft.AspNetCore.Http;
using Newtonsoft.Json;
public static class SessionExtensions
public static void Set<T>(this ISession session, string key, T value)
session.SetString(key, JsonConvert.SerializeObject(value));
niisar / 404.html
Created January 18, 2017 18:45
GitHub single-page app hack
<!doctype html>
<!-- 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 -->
sessionStorage.redirect = location.href;
<meta http-equiv="refresh" content="0;URL=''"></meta>
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;