Skip to content

Instantly share code, notes, and snippets.

Shrikrishna Holla shrikrishnaholla

Block or report user

Report or block shrikrishnaholla

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
konklone /
Last active Mar 16, 2016
Problem solving high memory usage with node.js, websockets,, and redis.

Problem: My Node.js processes (drones on Nodejitsu) are repeatedly growing in memory until they crash and get restarted. They are multiple processes responding to websockets connections over, using's Redis store to broker messages across connections and broadcast messages.

Conclusion: that's Redis store's memory usage likely either grows indefinitely, or is just way too high. We also isolated semi-frequent reconnects to the redis client on the part of each node.js process, though this looks unrelated to the overall memory problem.

Possibly related:

=== edited chat log of #nodejitsu on 25/11/2012 follows ==

aquilax / gist:1333830
Created Nov 2, 2011
Naive Bayes classifier in PostgreSQL
View gist:1333830
-- PostgreSQL database dump
-- Dumped from database version 9.1.1
-- Dumped by pg_dump version 9.1.1
-- Started on 2011-11-02 16:53:36 EET
SET statement_timeout = 0;
SET client_encoding = 'UTF8';
gurudeb / bootstrap-3-right-offset.css
Created Aug 11, 2016
Bootstrap 3 offset on right
View bootstrap-3-right-offset.css
.col-xs-offset-right-12 {
margin-right: 100%;
.col-xs-offset-right-11 {
margin-right: 91.66666667%;
.col-xs-offset-right-10 {
margin-right: 83.33333333%;
.col-xs-offset-right-9 {
View rg_dyno_sim.R
# you can make a text file of request times (in ms, one number per line) and import it here, or you can use a probability distribution to simulate request times (see below where setting req_durations_in_ms)
# rq = read.table("~/Downloads/request_times.txt", header=FALSE)$V1
# argument notes:
# parallel_router_count is only relevant if router_mode is set to "intelligent"
# choice_of_two, power_of_two, and unicorn_workers_per_dyno are only relevant if router_mode is set to "naive"
# you can only select one of choice_of_two, power_of_two, and unicorn_workers_per_dyno
run_simulation = function(router_mode = "naive",
reqs_per_minute = 9000,
wkjagt /
Last active Feb 11, 2020
How I built an audio book reader for my nearly blind grandfather

#How I built an audio book reader for my nearly blind grandfather

Tweet this - Follow me

Last year, when visiting my family back home in Holland, I also stopped by my grand-parents. My grand-father, now 93 years old, had always been a very active man. However, during the presceding couple of months, he'd gone almost completely blind and now spent his days sitting in a chair. Trying to think of something for him to do, I suggested he try out audio books. After finally convincing him -- he said audio books were for sad old people -- that listening to a well performed recording is actually a wonderful experience, I realized the problem of this idea.

####The problem with audio devices and the newly blind. After my first impulse to jump up and go buy him an

philfreo / gist:7257723
Created Oct 31, 2013
Facebook Perl source code from 2005. When browsing around in 2005 the server spit out some server-side source code rather than running it. I believe this was for their old graph feature that let you visualize the graph between all your friends. The filename is `mygraph.svgz` and contains some gems such as a commented out "zuck" d…
View gist:7257723
use Mysql;
use strict;
use vars qw($school_name);
use vars qw($pass);
require "./";
View promise-abort.js
var DIR = '/tmp/test',
FILE_PATTERN = /test/,
fs = require('q-io/fs');
.then(function (files) {
var matched = files.filter(function (item) {
return item.match(FILE_PATTERN);
if (matched.length !== 1) {
Vovan-VE / fix-lists.js
Created Jun 20, 2019
Quill Lists Fix (redux ready)
View fix-lists.js
* Quill 1.* cannot next block elements inside <li> including nested <ul>,<ol>.
* To achieve nested lists it uses flat linear lists with CSS class `ql-indent-\d+` on <li>.
* Nesting <ul> inside <ol> or vice-versa cause topmost list to break in two adjacent lists.
* There is the only solution: fix bad HTML after getting it from Quill and break it back before
* passing to Quill again for editing.
const mkNode = (tagName = 'div') => document.createElement(tagName);
140bytes / LICENSE.txt
Created May 9, 2011 -- Click ↑↑ fork ↑↑ to play!
View LICENSE.txt
Version 2, December 2004
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
sent-hil / pictures.markdown
Created Aug 24, 2012
River ( Keep a programming journal.
View pictures.markdown

One of my favorite past times is to look at the notebooks of famous scientists. Da Vinci's notebook is well known, but there plenty others. Worshipping Da Vinci like no other, I bought a Think/Create/Record journal, used it mostly to keep jot down random thoughts and take notes. This was great in the beginning, but the conformity of lines drove me nuts. Only moleskines made blank notebooks, so I had to buy one.

At the same time I started a freelance project. The project itself is irrelevant, but suffice to say it was very complex and spanned several months. It seemed like a perfect opportunity to use the moleskine. Looking back, all my entries fell under few categories:

  • Todo
  • Question
  • Thought
  • Bug
  • Feature
You can’t perform that action at this time.