Skip to content

Instantly share code, notes, and snippets.

Nitish Bhagat nitish1402

Block or report user

Report or block nitish1402

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@nitish1402
nitish1402 / QueueMin.java
Created Apr 2, 2017
Naive Implementation of queue with minimum value
View QueueMin.java
import java.io.*;
import java.util.*;
public class queueMin {
static class stack {
private Node<Integer> head;
public void push(int data) {
Node<Integer> newNode = new Node<Integer>(data);
@nitish1402
nitish1402 / WebSockets.md
Created Nov 10, 2016 — forked from subudeepak/WebSockets.md
The problems and some security implications of websockets - Cross-site WebSockets Scripting (XSWS)
View WebSockets.md

WebSockets - An Introduction

WebSockets is a modern HTML5 standard which makes communication between client and server a lot more simpler than ever. We are all familiar with the technology of sockets. Sockets have been fundamental to network communication for a long time but usually the communication over the browser has been restricted. The general restrictions

  • The server used to have a permanent listener while the client (aka browser) was not designated any fixed listener for a more long term connection. Hence, every communication was restricted to the client demanding and the server responding.
  • This meant that unless the client requested for a particular resource, the server was unable to push such a resource to the client.
  • This was detrimental since the client is then forced to check with the server at regular intervals. This meant a lot of libraries focused on optimizing asynchronous calls and identifying the response of asynchronous calls. Notably t
@nitish1402
nitish1402 / index.html
Created Nov 17, 2014
Basic example of binding data to an input in jQuery // source http://jsbin.com/julav
View index.html
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Basic example of binding data to an input in jQuery" />
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<br/><br/>
@nitish1402
nitish1402 / index.html
Created Nov 17, 2014
Basic example of binding data to an input in jQuery // source http://jsbin.com/kakaye
View index.html
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Basic example of binding data to an input in jQuery" />
<script src="http://code.jquery.com/jquery-2.0.3.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<br/><br/>
@nitish1402
nitish1402 / fibonacii.c
Last active Aug 29, 2015
Fibonacci via matrix exponenetiation
View fibonacii.c
#include<stdio.h>
#define ll long long
void matpower(long long M[2][2],int n){
long long w,x,y,z,a,b,c,d;
long long j=1000000007;
if(n>1){
matpower(M,n/2);
w=((M[0][0]*M[0][0])%j+(M[0][1]*M[1][0])%j)%j;
View 11digprime.java
import java.math.BigInteger;
import java.util.*;
/**
* @author nitish
* This code finds out about 125 prime numbers in the digits of pi of length 11
*/
public class arraylist {
public static void main(String atgs[])
{
You can’t perform that action at this time.