Skip to content

Instantly share code, notes, and snippets.

View shishirsharma's full-sized avatar
🤑
Focusing

Shishir Sharma shishirsharma

🤑
Focusing
View GitHub Profile
@shishirsharma
shishirsharma / dc.cpp
Created February 7, 2015 06:52
Desktop Calculator is a application coded in Standard C++. It is a application based on the example 6.1 in the book "The C++ Programming Language", Third Edition by Bjarne Stroustrup.
/*
* This file is part of Desktop Calculator.
*
* Desktop Calculator is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Desktop Calculator is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@shishirsharma
shishirsharma / .irbrc
Last active February 9, 2020 10:22
IRB Console with history and logging
#! /usr/bin/env ruby
# -*- Ruby-*-
require 'irb/completion'
require 'irb/ext/save-history'
ARGV.concat [ "--readline",
"--prompt-mode",
"simple" ]
# 100 entries in the list
@shishirsharma
shishirsharma / README.md
Created March 18, 2019 13:59 — forked from tmilos/README.md
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

@shishirsharma
shishirsharma / Number2words.py
Last active January 15, 2019 06:18
phonenumber2word
import math
import os
import random
import re
import sys
import functools
import bisect
import pprint
@shishirsharma
shishirsharma / pycrypto.py
Created November 13, 2018 12:47
pycrypto RSA example
# https://www.dlitz.net/software/pycrypto/api/current/Crypto.Cipher.PKCS1_v1_5-module.html
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-----
MIICXQIBAAKBgQDlOJu6TyygqxfWT7eLtGDwajtNFOb9I5XRb6khyfD1Yt3YiCgQ
WMNW649887VGJiGr/L5i2osbl8C9+WJTeucF+S76xFxdU6jE0NQ+Z+zEdhUTooNR
'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
shishirsharma / plugin_mixpanel.js
Last active June 26, 2018 07:18
botkit-mixpanel-metrics
var request = require('request');
var md5 = require('md5');
var botkit_mixpanel_metrics = function(controller, options) {
if (!options) {
options = {
debug: false,
always_update: false,
}
}
@shishirsharma
shishirsharma / Chrome custom scrollbar.css
Created April 26, 2018 07:57 — forked from oumu/Chrome custom scrollbar.css
CSS : Chrome custom scrollbar
/*http://support.google.com/chrome/?hl=en*/
::-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
shishirsharma / Dockerfile
Created April 8, 2017 16:51
Dockerizing Ruby on Rails
FROM ruby:2.3
MAINTAINER backend@nuvoex.com
# https://blog.codeship.com/running-rails-development-environment-docker/
# 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
$ sudo apt-get install imagemagick
$ sudo apt-get install poppler-utils