Skip to content

Instantly share code, notes, and snippets.

View lastlegion's full-sized avatar
🎯
Focusing

Ganesh Iyer lastlegion

🎯
Focusing
View GitHub Profile
@lastlegion
lastlegion / subscribe-kue
Created June 28, 2016 21:16
Subscribing to Kue Events
127.0.0.1:6379> subscribe q:events
Reading messages... (press Ctrl-C to quit)
1) "subscribe"
2) "q:events"
3) (integer) 1
1) "message"
2) "q:events"
@lastlegion
lastlegion / logicalToPhysical.js
Last active June 23, 2016 21:38
caMicroscope image ROI Logical to physical coordinates
var bounds = viewer.viewport.getBounds()
var imageCoordinates = viewer.viewport.viewportToImageRectangle(bounds.x, bounds.y, bounds.width, bounds.height)
/*
* Use
* imageCoordinates.x
* imageCoordinates.y and so on
*/
@lastlegion
lastlegion / cami-docker.md
Created June 6, 2016 19:18
CaMicroscope Docker Deployement Guide

Camicroscope Docker Distribution

Architecture

  • Application => Viewer
  • Data => Data
  • Backend => Loader

Installation

{
"presets": ["es2015", "react"]
}
@lastlegion
lastlegion / webpack.config.js
Last active August 9, 2016 12:32
Minimal webpack config to get started with React and ES2015
module.exports = {
entry: "./public/javascripts/src/App.jsx", //entry point of your app
output: {
filename: "./public/javascripts/build/bundle.js" //output transpiled and compiled code
},
module: {
loaders:[
{
test: /\.js[x]?$/, //list of extensions
exclude: /node_modules/,
@lastlegion
lastlegion / lexrank.py
Last active November 7, 2018 15:20
LexRank summarization in python using sumy
#Import library essentials
from sumy.parsers.plaintext import PlaintextParser #We're choosing a plaintext parser here, other parsers available for HTML etc.
from sumy.nlp.tokenizers import Tokenizer
from sumy.summarizers.lex_rank import LexRankSummarizer #We're choosing Lexrank, other algorithms are also built in
file = "plain_text.txt" #name of the plain-text file
parser = PlaintextParser.from_file(file, Tokenizer("english"))
summarizer = LexRankSummarizer()
summary = summarizer(parser.document, 5) #Summarize the document with 5 sentences
@lastlegion
lastlegion / gist:d29bcd2850f336799696
Last active August 29, 2015 14:10
sentimentscore
function(text){
var score = 0;
var words = text.split(" ");
for(var i in words){
word = words[i];
if(word in this.wordList){
score+= this.wordList[word];
}
}
return score/words.length;
tweets = [];
socket.on("tweet", function(data){
console.log(data);
tweets.push(data);
});
io.on("connection", function (socket){
t.on("tweet", function(tweet){
var tweetText = tweet.text;
var score = s.score(tweetText);
socket.emit("tweet", {tweet: tweetText, score:score})
});
});
@lastlegion
lastlegion / gist:f6894d500b38d94d4d1c
Created October 12, 2014 16:41
Benchmark test for node with crossfilter
29 attributes(24 filtering)
1mil - memory exceeded
500k - memory exceeded
250k - memory exceeded
100k -1100
50k- 1000
20 attributes (15 filtering)
1mil - memory exceeded
500k - memory exceeded