Skip to content

Instantly share code, notes, and snippets.

View olebedev's full-sized avatar
🏄‍♂️
🌊 🌊 🌊

Oleg Lebedev olebedev

🏄‍♂️
🌊 🌊 🌊
View GitHub Profile
@olebedev
olebedev / The Technical Interview Cheat Sheet.md
Created June 4, 2018 06:20 — forked from tsiege/The Technical Interview Cheat Sheet.md
This is my technical interview cheat sheet. Feel free to fork it or do whatever you want with it. PLEASE let me know if there are any errors or if anything crucial is missing. I will add more links soon.

Studying for a Tech Interview Sucks, so Here's a Cheat Sheet to Help

This list is meant to be a both a quick guide and reference for further research into these topics. It's basically a summary of that comp sci course you never took or forgot about, so there's no way it can cover everything in depth. It also will be available as a gist on Github for everyone to edit and add to.

Data Structure Basics

###Array ####Definition:

  • Stores data elements based on an sequential, most commonly 0 based, index.
  • Based on tuples from set theory.
@olebedev
olebedev / fresh-chrome-with-custom-tz.sh
Created December 16, 2017 05:33 — forked from prasadsilva/fresh-chrome-with-custom-tz.sh
Launch new instances of Google Chrome on OS X with isolated cache, cookies, user config and custom Timezone
#!/usr/bin/env bash
# fresh-chrome
#
# Use this script on OS X to launch a new instance of Google Chrome
# with its own empty cache, cookies, and user configuration.
#
# The first time you run this script, it will launch a new Google
# Chrome instance with a permanent user-data directory, which you can
# customize below. Perform any initial setup you want to keep on every
@olebedev
olebedev / _upgrade-pg9.4-to-pg9.5.md
Created August 2, 2017 10:29 — forked from chbrown/_upgrade-pg9.4-to-pg9.5.md
Upgrade PostgreSQL 9.4 to 9.5 on Mac OS X with Homebrew

First, check your current config (example output in homebrew.mxcl.postgresql.plist.xml lower down in this gist):

cat ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

Most importantly, note the -D /usr/local/var/postgres argument.

Second, shut down your current PostgreSQL.

launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
@olebedev
olebedev / ffmpeg-compress-mp4
Created January 28, 2017 19:10 — forked from lukehedger/ffmpeg-compress-mp4
Compress mp4 using FFMPEG
$ ffmpeg -i input.mp4 -vcodec h264 -acodec mp2 output.mp4
@olebedev
olebedev / README.md
Created December 30, 2016 06:31 — forked from rjeczalik/README.md
Go, multiple packages and coveralls.io

Go, multiple packages and coveralls.io

Single profile for single Go package

For Go projects that consist of only one package, the following Travis configuration is enough to get started with coveralls.io. You may want to encrypt your $COVERALLS_TOKEN via Travis encryption keys though.

language: go
go:
 - 1.3.1
### My publicly-auditable identity:
https://keybase.io/olebedev
### From the command line:
Consider the [keybase command line program](https://keybase.io/download).
```bash
# look me up
@olebedev
olebedev / building_micro_services.md
Created June 12, 2016 12:06
Note on tools for building micro-services based architecture: CI, CD, Cluster Management, etc

Tools for building microservices architecture (May 7, 2016)

We are obviously in the age of Microservices, Mobile first, Polyglot, post-Java JVM languages, GitHub and Docker uprise. In this world, Open Source usage dominates, and the speed of change is intense. Knowing the direction of DevOps tools and picking the right one for the project is crucial.

Terms

Continuous Integration is the practice of running your tests on a non-developer machine automatically everytime someone pushes new code into the source repository.

This has the tremendous advantage of always knowing if all tests work and getting fast feedback. The fast feedback is important so you always know right after you broke the build (introduced changes that made either the compile/build cycle or the tests fail) what you did that failed and how to revert it.

//usr/bin/env go run $0 $@; exit
@olebedev
olebedev / Makefile
Last active April 1, 2016 13:50
Makefile rule to extract gettetx/ngettext calls from Golang templates and source files
XGETTEXT_FLAGS = --no-wrap --language=c --from-code=UTF-8 --output=- -
$(POT_FILE): $(TEMPLATES) $(filter-out $(BINDATA), $(GO_FILES))
@cat $? \
| grep -i gettext \
| sed -e "s/ngettext \"\([^\"]*\)\".\"\([^\"]*\)\".\(.*\) }}/ngettext(\"\1\", \"\2\", \3) }}/g" \
| sed -e "s/[^n]gettext \"\(.*\)\"/ gettext(\"\1\")/g" \
| sed -e "s/NGetText(\([^\)]*\))/ ngettext(\1) /g" \
| sed -e "s/GetText(\([^\)]*\))/ gettext(\1) /g" \
| xgettext $(XGETTEXT_FLAGS) \
| sed -e '1,20d' \
@olebedev
olebedev / wercker-dokku-deploy.yml
Created February 18, 2016 10:31 — forked from ademuk/wercker-dokku-deploy.yml
Wercker Dokku deploy
deploy:
steps:
- add-to-known_hosts:
hostname: $HOSTNAME
- add-ssh-key:
keyname: KEY
- script:
name: Push to dokku
code: |
git remote add dokku dokku@$HOSTNAME:$APP