Skip to content

Instantly share code, notes, and snippets.


Vishal Telangre vishaltelangre

View GitHub Profile
"/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/" -o "output.pdf" *.pdf
View upsert_all_postgres_issue.rb
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source ""
git_source(:github) { |repo| "{repo}.git" }
gem "rails", github: "rails/rails"
vishaltelangre /
Last active Aug 31, 2018
Left Shift (<<) and Right Shift (>>) Operators

Left Shift (<<) Operator

x << y == x * (2 ^ y)
1 << 5 == 1 * (2 ^ 5) == 32
vishaltelangre / Main.elm
Last active Oct 22, 2017
Heartbeat animation rendering on HTML5 Canvas in Elm using "evancz/elm-graphics" package. Compatible with Elm v 0.18. This is ported from an old example on which uses old packages like "Signal" and "Graphics.Collage" which no longer exists in new Elm versions now.
View Main.elm
module Main exposing (..)
import Html exposing (..)
import Color exposing (..)
import Collage exposing (..)
import Element exposing (..)
import Time exposing (Time)
import AnimationFrame
vishaltelangre /
Last active Aug 27, 2017
Managing Data in Microservices - Notes

Link to the talk:


  1. Service for each table
  2. Local/own/isolated database for each service
  3. Cache join query information locally on respective service's DBs on each write to avoid cascaded service calls (aka joins in monolithic/shared DB)
  4. Alternative to ACID transactions is to perform multi-step operations using a state machine which can be rollbacked
  5. Dealing with events
    5.1 At most once delivery - When you don't care about such events, like logging stuff using UDP

Keybase proof

I hereby claim:

  • I am vishaltelangre on github.
  • I am vishaltelangre ( on keybase.
  • I have a public key ASAgnXEmPd6H1DjWLMKbHYF4gOL529tTFVCjGzWvqDRwQQo

To claim this, I am signing this object:

vishaltelangre /
Last active Jul 15, 2017
Locate big files on macOS
$ mdfind 'kMDItemFSSize > 200000000' | sed 's| |\\ |g' | xargs du -sch
#                             ^
#                         ~ 200MiB
vishaltelangre /
Created Oct 1, 2016
Add a volume to an existing Docker container
docker run --name rails-modified-container -v "$PWD":/usr/src/app -w /usr/src/app -d rails
^ ^ ^ ^
name of container app dir dir on image from which
on host container create container
vishaltelangre /
Created Sep 24, 2016
Join multiple VOB video files into one
cat *.VOB | pv | dd of=final.vob
You can’t perform that action at this time.