This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| chrome | |
| warp | |
| https://www.warp.dev/ | |
| brew | |
| https://brew.sh/ | |
| dbngin (to install mysql, postgres) | |
| https://dbngin.com/download |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rails new my_app_name -d postgresql --skip-test | |
| # Gemfile | |
| gem 'slim' | |
| gem "rubocop", require: false | |
| gem "devise" | |
| group :development, :test do | |
| gem "debug", platforms: %i[ mri windows ], require: "debug/prelude" | |
| gem "brakeman", require: false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ************** Mapbox | |
| 1. Controller | |
| def find_us | |
| @geojson = build_geojson | |
| end | |
| private | |
| def build_geojson | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Normal: http://prntscr.com/lqkpkg | |
| application.html.slim | |
| doctype html | |
| html | |
| head | |
| = yield(:header) | |
| = display_meta_tags site: 'Project management tool', reverse: true | |
| New(only on this page): http://prntscr.com/lqkpzk | |
| app/views/account/workspaces/list.html.slim |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cat.rb | |
| require 'singleton' | |
| class Cat | |
| include Singleton | |
| end | |
| p Cat.instance |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 1) Create your private key (any password will do, we remove it below) | |
| $ cd ~/.ssh | |
| $ openssl genrsa -des3 -out server.orig.key 2048 | |
| # 2) Remove the password | |
| $ openssl rsa -in server.orig.key -out server.key |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| http://www.cheat-sheets.org/saved-copy/RubyCheat.pdf | |
| http://www.peachpit.com/articles/article.aspx?p=1278994&seqNum=2 | |
| https://quickleft.com/blog/five-ruby-methods-you-should-be-using/ | |
| https://callahan.io/blog/2014/07/17/five-useful-ruby-array-methods | |
| https://launchschool.com/books/ruby/read/arrays#nestedarrays | |
| # String | |
| .concat OR + OR << |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 5 прикладів belongs_to з різними опціями | |
| https://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html#method-i-belongs_to | |
| 10 методів ajax | |
| 5 прикладів has many з різними опціями | |
| # to generate random password | |
| http://ruby-doc.org/stdlib-1.9.2/libdoc/securerandom/rdoc/SecureRandom.html | |
| (0...8).map { (65 + rand(26)).chr }.join | |
| (0...50).map { ('a'..'z').to_a[rand(26)] }.join |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # rails caching | |
| https://guides.rubyonrails.org/caching_with_rails.html | |
| <% @products.each do |product| %> | |
| <% cache product do %> | |
| <%= render product %> | |
| <% end %> | |
| <% end %> | |
| <%= render partial: 'products/product', collection: @products, cached: true %> | |
| class Product < ApplicationRecord | |
| has_many :games |