Skip to content

Instantly share code, notes, and snippets.

View som-poddar's full-sized avatar

Som Poddar som-poddar

  • Warner Brother Discovery
  • San Francisco Bay Area
  • 15:46 (UTC -07:00)
View GitHub Profile
@som-poddar
som-poddar / read-me.md
Created May 15, 2023 17:20
Java Servlet Example

Java Servlet Example

@som-poddar
som-poddar / .travis-ginkgo.yml
Last active May 30, 2019 17:37
Setting Up Travis CI with Ginkgo
language: go
go:
- 1.10.x
install:
- go get github.com/golang/dep
- go get golang.org/x/tools/cmd/cover
- go get github.com/onsi/gomega
- go install github.com/onsi/ginkgo/ginkgo
- export PATH=$PATH:$HOME/gopath/bin
@som-poddar
som-poddar / ec2.md
Last active January 15, 2019 21:26
AWS Cli Example

EC2

All instances with max-output

aws ec2 describe-instances --max-items 1

List tags and their names

aws ec2 describe-instances --query 'Reservations[*].Instances[*].Tags[?Key==`Name`]'
@som-poddar
som-poddar / Dockerfile
Created February 6, 2018 19:19
Docker Go Sample
FROM golang:1.8.6-alpine3.5
WORKDIR /app
ADD go-docker /app/
ENTRYPOINT ["./go-docker"]
@som-poddar
som-poddar / vim-extended.md
Last active November 30, 2017 23:05
Cheat Sheets

Cursor movement

  • h - move left
  • j - move down
  • k - move up
  • l - move right
  • w - jump by start of words (punctuation considered words) W - jump by words (spaces separate words)
  • e - jump to end of words (punctuation considered words)
  • E - jump to end of words (no punctuation)
  • b - jump backward by words (punctuation considered words) B - jump backward by words (no punctuation)
@som-poddar
som-poddar / merge.rb
Last active October 15, 2015 19:16
merge vs merge!
main_hash = {}
K = 10000
start_time = Time.now
(1..K).each do |number|
main_hash = main_hash.merge({number => number})
end
puts "with 'merge'"
puts "Time elapsed #{Time.now - start_time} seconds"
puts "Main hash key count: #{main_hash.keys.count}"
@som-poddar
som-poddar / Grep
Last active September 25, 2017 18:47
Key Bindings
----------------------------------------------------------------------------------------
KeyBoard ShortCuts
----------------------------------------------------------------------------------------
: Grep :
grep 'text' /folder/file.log Regular search (-c adds count, -n adds line no., --color options add color)
grep -i 'text' /folder/file.log Ignore case
grep -r 'text' /folder/ search recursively (-h will hide file names)
grep -w 'word' /folder/file.log search for word only
grep -v 'text' /folder/file.log Invert search
@som-poddar
som-poddar / pdf_reader.rb
Last active August 29, 2015 14:11
pdf-reader
require 'pdf/reader'
raw_string = ''
#INSTRUCTION: save it locally http://www.energy.umich.edu/sites/default/files/pdf-sample.pdf
filename = File.expand_path(File.dirname(__FILE__)) + '/pdf-sample.pdf'
PDF::Reader.open(filename) do |reader|
reader.pages.each do |page|
raw_string = page.raw_content
puts page.raw_content
end