Skip to content

Instantly share code, notes, and snippets.

View thesunwave's full-sized avatar
🏠
Working from home

Artur Malev thesunwave

🏠
Working from home
View GitHub Profile
[4] pry(main)> var1 = File.open(Rails.root.join("config/redis.yml"))
=> #<File:/Users/thesunwave/Documents/work/ural1/config/redis.yml>
[5] pry(main)> var2 = File.read(Rails.root.join("config/redis.yml"))
=> "default: &default\n host: localhost\n port: 6379\ndevelopment:\n <<: *default\ntest:\n <<: *default\nproduction:\n host: \#{ ENV[\"REDIS_URL\"] }\n"
[6] pry(main)> var3 = IO.read(Rails.root.join("config/redis.yml"))
=> "default: &default\n host: localhost\n port: 6379\ndevelopment:\n <<: *default\ntest:\n <<: *default\nproduction:\n host: \#{ ENV[\"REDIS_URL\"] }\n"
[7] pry(main)> YAML.load var1
=> {"default"=>{"host"=>"localhost", "port"=>6379},
"development"=>{"host"=>"localhost", "port"=>6379},
"test"=>{"host"=>"localhost", "port"=>6379},
@thesunwave
thesunwave / electron-api.md
Created February 24, 2016 07:19 — forked from mrmlnc/electron-api.md
Electron API

Базовые возможности

process — это объект, позволяющий получить информацию о типе запущенного процесса (рендеринг или основной процесс), версию Chrome и Electron, а также путь до выполняемого js-файла.

Пользовательские элементы DOM:

Объект File — это абстракция над нативным File, передающая стандартному HTML5 file API путь к физическому расположению файла в файловой системе пользователя.

def include_path?(options)
return false unless request
url_string = url_for(options)
if url_string.index("?")
request_uri = request.fullpath
else
request_uri = request.path
@thesunwave
thesunwave / ml-ruby.md
Created May 14, 2016 20:57 — forked from gbuesing/ml-ruby.md
Resources for Machine Learning in Ruby

Resources for Machine Learning in Ruby

Gems

@thesunwave
thesunwave / nested_content_snippet.rb
Created June 28, 2016 19:24 — forked from bunnymatic/nested_content_snippet.rb
nested content in rails view helpers
# because i can never remember exactly how and when to use concat
# when building content in helpers
def nested_content
content_tag 'div' do
concat(content_tag 'span', 'span block')
concat(tag 'br')
concat(link_to 'root link', root_path)
concat(tag 'br')
concat(link_to('#') do
concat(content_tag 'h2', 'Head \'em off')
@thesunwave
thesunwave / capybara cheat sheet
Created July 28, 2016 11:16 — forked from zhengjia/capybara cheat sheet
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')

2016. Итоги.

  • Уволился с работы фронтендером (но по большей части HTML/jQuery макакой)
  • Был принят в маленькую и уютную фирму специализирующейся на разработке проектов на Ruby и рельсах.
  • Взял себе Макбук и стал получать удовольствие от работы.
  • Поднял свой уровень с почти нуля до уверенного джуна (или неуверенного миддла, но по сей день не понимаю этой градации)
  • Познакомился с Trailblazer гемом Cells и в целом с подходом Trailblazer.
  • Написал gem, обертку апи для Soccerama.pro
  • Ближе познакомился с уютным Руби сообществом, познакомился в сети с приятными и интересными профессионалами своего дела.
  • Съездил в отпуск в Сочи (на любителя, скажем)
@thesunwave
thesunwave / rvm.sh
Last active February 14, 2017 11:14 — forked from tesths/rvm.sh
rvm
#fork from https://github.com/huacnlee/init.d
echo "Install RVM"
echo "---------------------------------------------------------------------------"
command gpg --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3
command curl -sSL https://get.rvm.io | bash -s stable
source /etc/profile.d/rvm.sh
rvm install 2.3.3
require 'rest-client'
class YandexGeocoder
attr_reader :data, :address
NotFound = Class.new(StandardError)
EmptyRequest = Class.new(StandardError)
BASE_URL = 'https://geocode-maps.yandex.ru/1.x/'.freeze
PARAMS = {
@thesunwave
thesunwave / tmux-iterm2.md
Created November 7, 2017 14:25 — forked from royling/tmux-iterm2.md
tmux in iTerm2 cheatsheet