Skip to content

Instantly share code, notes, and snippets.

View yask123's full-sized avatar
πŸ‘¨β€πŸ’»

Yask Srivastava yask123

πŸ‘¨β€πŸ’»
View GitHub Profile
appbase.searchStream({
type: 'people71',
body: {
"from" : 0, "size" : 1000,
query: {
match_all: {}
}
}
}).on('data', function(response) {
console.log('test');
if (response.hits){
console.log(response.hits.hits.length);
var l = response.hits.hits.length;
document.getElementById('count').innerHTML = response.hits.hits.length +1;
for(var i=0;i<l;i++)
{
var data = {
color: '#2962FF',
lat: response.hits.hits[i]._source.latitude,
lon: response.hits.hits[i]._source.longitude,
if (response.hits){
console.log(response.hits.hits.length);
var l = response.hits.hits.length;
document.getElementById('count').innerHTML = response.hits.hits.length +1;
for(var i=0;i<l;i++)
{
var data = {
color: '#2962FF',
lat: response.hits.hits[i]._source.latitude,
lon: response.hits.hits[i]._source.longitude,
else
{
$('#count').text(parseInt($('#count').html())+1);
console.log("New user");
document.getElementById('cont').innerHTML = response._source.country;
$('.error').fadeIn(400).delay(3000).fadeOut(400);
console.log(response._source);
var time = response._source.h+":"+response._source.m+":"+response._source.s;
// random data
var data = {
color: '#FF0000',
size: 20,
lat: 52.3747158,
lon: 4.8986231,
size: 20
};
// add a block in realtime after getting data
block: function(color) {
return new THREE.Mesh(
new THREE.BoxGeometry(0.5, 0.5, 10),
new THREE.MeshNormalMaterial()
);
}
@yask123
yask123 / kruskal.cpp
Created November 15, 2015 07:37
Kruskal algo MSP
#include <iostream>
#include <vector>
#include <map>
using namespace std;
struct Edge{
char vertex1;
char vertex2;
int weight;
@yask123
yask123 / kruskal.cpp
Created November 15, 2015 07:37
Kruskap MSP
#include <iostream>
#include <vector>
#include <map>
using namespace std;
struct Edge{
char vertex1;
char vertex2;
int weight;
#include <iostream>
#include <vector>
#include <map>
using namespace std;
struct Edge{
char vertex1;
char vertex2;
int weight;
yasksrivastava at Yasks-MacBook-Pro in ~/learnyoureact
$ node
> function calc(){
... this.a = 5;
... }
undefined
> calc()
undefined
> calc
[Function: calc]