Skip to content

Instantly share code, notes, and snippets.

View olebedev's full-sized avatar
🎾

Oleg Lebedev olebedev

🎾
View GitHub Profile
@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
@olebedev
olebedev / hn_seach.js
Created November 2, 2015 16:59 — forked from meiamsome/hn_search.js
hn job query search
// takes arguments and produces an array of functions that accept context
function handle_args() {
var args = Array.prototype.slice.call(arguments);
return args.map(function(arg) {
if(arg instanceof Function) return arg; // Presumably already a contex-accepting function.
if(arg instanceof Array) return and.apply(this, arg); // make arrays behave as and.
// Presuming a string, build a function to check.
var my_regex = new RegExp(arg.toString(), 'i');
return function(context) {
return context.search(my_regex) > -1;
@olebedev
olebedev / wercker.yml
Created October 14, 2015 17:27 — forked from mies/wercker.yml
default golang wercker.yml
box: wercker/golang
# Add services here
# Build definition
build:
# The steps that will be executed on build
steps:
# Sets the go workspace and places you package
# at the right place in the workspace tree
- setup-go-workspace