Skip to content

Instantly share code, notes, and snippets.


Shishir Sharma shishirsharma

View GitHub Profile
shishirsharma /
Created Mar 18, 2019 — forked from tmilos/
Modified Preorder Tree Traversal

Modified Preorder Tree Traversal

Hierarchical data metrics that allows fast read operations on tree like structures.

Based on Left and Right fields that are set during tree traversal. When entered into node value is set to it's Left, when exiting node value is set to it's Right.

Sample implementation

import math
import os
import random
import re
import sys
import functools
import bisect
import pprint
shishirsharma /
Created Nov 13, 2018
pycrypto RSA example
from Crypto import Random
from Crypto.Cipher import PKCS1_v1_5
from Crypto.Hash import SHA
from Crypto.PublicKey import RSA
from base64 import b64decode
raw_key = """-----BEGIN RSA PRIVATE KEY-----
View app__components__express_middleware__register_with_swagger_express.js
'use strict';
var debug = require('debug')('botkit:register_with_swagger_express');
var SwaggerExpress = require('swagger-express-mw');
var SwaggerUi = require('swagger-tools/middleware/swagger-ui');
// var ejwt = require('express-jwt');
// // Initialize express-jwt
// var jwt = ejwt({
// secret: "bla bla blackship" //new Buffer(process.env.AUTH0_CLIENT_SECRET, 'base64'),
shishirsharma / plugin_mixpanel.js
Last active Jun 26, 2018
View plugin_mixpanel.js
var request = require('request');
var md5 = require('md5');
var botkit_mixpanel_metrics = function(controller, options) {
if (!options) {
options = {
debug: false,
always_update: false,
View Chrome custom scrollbar.css
::-webkit-scrollbar {
height: 16px !important;
overflow: visible !important;
width: 16px !important;
::-webkit-scrollbar-thumb {
background: -webkit-linear-gradient(left, rgba(198,198,198,1) 0%,rgba(220,220,220,1) 100%) !important;
background-clip: padding-box !important;
shishirsharma / Dockerfile
Created Apr 8, 2017
Dockerizing Ruby on Rails
View Dockerfile
FROM ruby:2.3
# Install apt based dependencies required to run Rails as
# well as RubyGems. As the Ruby image itself is based on a
# Debian image, we use apt-get to install those.
RUN apt-get update && apt-get install -y build-essential
# For postgres
shishirsharma / A brief history of all objects
Last active Dec 9, 2015
A brief history of all objects
View A brief history of all objects
A brief history of all objects
shishirsharma / gist:2f01b98ff44372a51258
Created Jun 5, 2015
Convert month number into string in Libreoffce
View gist:2f01b98ff44372a51258