This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang:1.8.6-alpine3.5 | |
WORKDIR /app | |
ADD go-docker /app/ | |
ENTRYPOINT ["./go-docker"] |
- 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)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
---------------------------------------------------------------------------------------- | |
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |