Skip to content

Instantly share code, notes, and snippets.

@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
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 ubuntu@127.0.0.1
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 ubuntu@127.0.0.1
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 ubuntu@127.0.0.1
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)
class CreateIdentities < ActiveRecord::Migration
def change
create_table :identities do |t|
t.string :provider
t.string :uid
t.integer :user_id
t.timestamps null: false
end
require 'factory_girl_rails'
require 'rspec'
require 'rspec-rails'
require 'rspec/mocks/standalone' # => if factories need stubs (for remote services for example)
include FactoryGirl::Syntax::Methods # make FG methods available at top level, so you can do `> create :user`
def reload_factories!
FactoryGirl.instance_variable_set(:@factories, nil) # => clear loaded factories/sequences
# FactoryGirl.instance_variable_set(:@sequences, nil)

tmux cheatsheet

As configured in my dotfiles.

start new:

tmux

start new with session name: