Skip to content

Instantly share code, notes, and snippets.

Vishal Telangre vishaltelangre

Block or report user

Report or block vishaltelangre

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
View combine_pdfs_into_one.sh
"/System/Library/Automator/Combine PDF Pages.action/Contents/Resources/join.py" -o "output.pdf" *.pdf
View upsert_all_postgres_issue.rb
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem "rails", github: "rails/rails"
@vishaltelangre
vishaltelangre / left_shift_and_right_shift_operators.md
Last active Aug 31, 2018
Left Shift (<<) and Right Shift (>>) Operators
View left_shift_and_right_shift_operators.md

Left Shift (<<) Operator

x << y == x * (2 ^ y)
Examples
1 << 5 == 1 * (2 ^ 5) == 32
@vishaltelangre
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 http://outreach.mcmaster.ca/tutorials/animation/animation.html 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
vishaltelangre / Managing_Data_in_Microservices.md
Last active Aug 27, 2017
Managing Data in Microservices - Notes
View Managing_Data_in_Microservices.md

Link to the talk: https://www.infoq.com/presentations/microservices-data-centric

Notes:

  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
View keybase.md

Keybase proof

I hereby claim:

  • I am vishaltelangre on github.
  • I am vishaltelangre (https://keybase.io/vishaltelangre) on keybase.
  • I have a public key ASAgnXEmPd6H1DjWLMKbHYF4gOL529tTFVCjGzWvqDRwQQo

To claim this, I am signing this object:

@vishaltelangre
vishaltelangre / mac_locate_big_files.md
Last active Jul 15, 2017
Locate big files on macOS
View mac_locate_big_files.md
$ mdfind 'kMDItemFSSize > 200000000' | sed 's| |\\ |g' | xargs du -sch
#                             ^
#                         ~ 200MiB
@vishaltelangre
vishaltelangre / docker.sh
Created Oct 1, 2016
Add a volume to an existing Docker container
View docker.sh
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
vishaltelangre / merge_vob.sh
Created Sep 24, 2016
Join multiple VOB video files into one
View merge_vob.sh
cat *.VOB | pv | dd of=final.vob
You can’t perform that action at this time.