Skip to content

Instantly share code, notes, and snippets.

View Freika's full-sized avatar

Evgenii Burmakin Freika

View GitHub Profile
@Freika
Freika / gist:d27408ecfd5edb2a99c9ef3d6f69c958
Created March 2, 2017 06:55 — forked from kagemusha/gist:1569836
Dump Heroku Postgres DB and load locally
Get the Heroku db as detailed here:
http://devcenter.heroku.com/articles/pgbackups#exporting_via_a_backup
1. heroku pgbackups:capture
2. heroku pgbackups:url <backup_num> #=>backup_url
- get backup_num with cmd "heroku pgbackups"
3. curl -o latest.dump <backup_url>
Then locally do:
$ pg_restore --verbose --clean --no-acl --no-owner -h localhost -U myuser -d mydb latest.dump
@Freika
Freika / matches.csv
Last active January 10, 2017 07:02
matches.csv
id result skill_rating sr_diff season_id streak comment rounds party_size map_name heroes_names
1104 win 2441 21 1 2 2 1 Eichenwalde D.Va
1102 win 2420 25 1 1 2 1 Numbani Junkrat
1101 lose 2395 -23 1 -3 4 1 King's Row Ana
1100 lose 2418 -25 1 -2 2 0 Watchpoint: Gibraltar Ana, D.Va
1098 lose 2443 -24 1 -1 2 1 Volskaya Industries D.Va
1097 win 2467 19 1 1 2 1 Dorado D.Va
1096 lose 2448 -25 1 -1 2 1 Numbani Symmetra, D.Va
1095 win 2473 22 1 1 2 1 Hollywood D.Va
1094 lose 2451 -24 1 -1 2 1 Eichenwalde Ana, Pharah
@Freika
Freika / givup.md
Last active August 23, 2023 21:57
Ты слишком быстро сдаешься

Деятельность ментора по программированию часто напоминает работу неким life coach'ем. Мотивировать. Давать общие советы по жизни. Как организовывать время. Как решать задачи. Как быть продуктивным. Это всё значительно важней, чем уметь фреймворк X или язык программирования Y. Научись программировать на одном ЯП — и ты найдёшь себе работу "Язык X junior developer". Научись мгновенно изучать любую технологию и разбираться в любом коде и задаче — и ты никогда не останешься без работы и денег.

На днях я искал нового помощника для разработки mkdev.me, выложив в Интернет вот такое описание вакансии: https://gist.github.com/Fodoj/4acb2c9d1f6335de003f028585c3126d

Ключевым пунктом в требованиях там было, пожалуй, следующее: «Трудолюбие, желание учиться, вот это вот всё».

Каждому, кто откликнулся на эту, простите, вакансию я выдал небольшое тестовое задание — починить тесты в open source геме.

Результат меня разочаровал, хоть и был весьма предсказуемым: из десятка людей с «горящими глазами и жадных до знаний» ли

Deploying Elixir and Phoenix applications using Docker and Exrm

Goal

By the end of this quick guide, you will know how to compile a Phoenix app release using Exrm and run it inside a Docker container. I've found only a couple of articles that discuss getting an Elixir app up and running inside a Docker container, and even those only touched on some parts of the process. The idea is that this guide will give you a full end-to-end example of how to get all the pieces and parts working together so that you are able to deploy your Phoenix application inside a Docker container.

Assumptions

  1. You already have a working Elixir environment with the Phoenix Framework installed
  2. You have at least basic working knowledge of Docker, and have installed the Docker tools onto your local environment
gitlab-ci-multi-runner 1.1.4 (9e2fd1a)
Using Docker executor with image ruby:2.3.1 ...
Pulling docker image ruby:2.3.1 ...
Running on runner-8a2f473d-project-1206292-concurrent-0 via runner-8a2f473d-machine-1463869118-1efd872e-digital-ocean-4gb...
Cloning repository...
Cloning into '/builds/Freika/webdevbooks'...
Checking out df213c14 as master...
Note: checking out 'df213c14b4e1e46c6144d0b46344ec31338798a9'.
Started POST "/api/v2/people/waXT3kWeGZ5pJDQrairSwnMJ/wallets?payment_operator_id=3&pan=4242424242424242&exp_month=[FILTERED]&exp_year=[FILTERED]&cvc=[FILTERED]&cardholder_name=ivan%20aranov" for ::1 at 2016-05-14 16:30:33 +0700
ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
PaymentOperator Load (0.6ms) SELECT "payment_operators".* FROM "payment_operators" WHERE "payment_operators"."id" = $1 LIMIT 1 [["id", 3]]
Person Load (0.8ms) SELECT "people".* FROM "people" WHERE "people"."token" = $1 LIMIT 1 [["token", "waXT3kWeGZ5pJDQrairSwnMJ"]]
Card Load (0.8ms) SELECT "cards".* FROM "cards" WHERE "cards"."pan_sha256_hash" = $1 LIMIT 1 [["pan_sha256_hash", "c59d308226901d4535c18b1658c45d48d17fc5c58bd380337a396992a1a059fa"]]
/Users/frey/.rvm/gems/ruby-2.3.0@global/gems/did_you_mean-1.0.0/lib/did_you_mean/spell_checkers/name_error_checkers/variable_name_checker.rb:10: [BUG] Segmentation fault at 0x000000000000d1
ruby 2.3.0p0 (2015-12-25 revision 53290
Dmitry Sharikov [17:30]
Жек
[17:30]
я придумал
[17:30]
на твои сайтики часто нападают школохакеры
GIT
remote: git://github.com/thoughtbot/shoulda-matchers.git
revision: db67d27ceda7ea68f1c94e2956f0eada0d5b9312
specs:
shoulda-matchers (3.0.1)
activesupport (>= 4.0.0)
GEM
remote: https://rubygems.org/
specs:
╰─⠠⠵ cap production sidekiq:restart
DEBUG [dbbe91eb] Running /usr/bin/env [ -d ~/.rbenv/versions/2.2.3 ] as [email protected]
DEBUG [dbbe91eb] Command: [ -d ~/.rbenv/versions/2.2.3 ]
DEBUG [dbbe91eb] Finished in 1.620 seconds with exit status 0 (successful).
DEBUG [267311c0] Running /usr/bin/env which passenger as [email protected]
DEBUG [267311c0] Command: /usr/bin/env which passenger
DEBUG [267311c0] /usr/bin/passenger
DEBUG [267311c0] Finished in 0.225 seconds with exit status 0 (successful).
DEBUG [c9988864] Running /usr/bin/env [ -d /var/www/ad_words_manager/current ] as [email protected]
DEBUG [c9988864] Command: [ -d /var/www/ad_words_manager/current ]
@Freika
Freika / rspec_rails_cheetsheet.rb
Last active August 29, 2015 14:27 — forked from them0nk/rspec_rails_cheetsheet.rb
Rspec Rails cheatsheet (include capybara matchers)
#Model
@user.should have(1).error_on(:username) # Checks whether there is an error in username
@user.errors[:username].should include("can't be blank") # check for the error message
#Rendering
response.should render_template(:index)
#Redirecting
response.should redirect_to(movies_path)