일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
- 설치
- ubuntu
- docket
- 이것이 자바다
- 쿠버네티스
- Visual Studio Code
- 우분투 24
- 사용중인포트검색
- change_column
- 우분투
- Java
- change_column_null
- 주차장 시스템
- 도커
- mac
- docker
- after_save
- Orange Pi 3B
- RUBY
- 오랜지파이
- Time.znoe.now
- Rails
- after_update
- Migrate
- Kotlin
- install
- Ruby on Rails
- ruby #string #strip #split #gsub
- with_indifferent_access
- MySQL
- Today
- Total
목록Code Language/Ruby (10)
중고 신입이 개발해보기..
limit = nil limit.present?=> false limit = 0 limit.present? => true limit = 10 limit.present? => true limit = 'test' limit.present? => true limit = [] limit.present? => false limit = ['test', 1] limit.present? => true limit = nil limit.blank?=> true limit = 1 limit.blank?=> false limit = 'test' limit.blank?=> false limit = [] limit.blank?=> true limit = [1] limit.blank?=> false [31] pry(main)> l..
in_groups_of array를 특정갯수만큼 끊어서 호출하고 싶을때 arr = [ 5 , 6, 7, 8, 9, 10 , 11 , 12, 13, 14] arr.in_groups_of(5) { |ar| p ar } [5, 6, 7, 8, 9] [10, 11, 12, 13, 14] => nil arr.in_groups_of(7) { |ar| p ar } [5, 6, 7, 8, 9, 10, 11] [12, 13, 14, nil, nil, nil, nil] arr.in_groups_of(7, false) { |ar| p ar } [5, 6, 7, 8, 9, 10, 11] [12, 13, 14]
현재 시간 구하기 now = Time.now => 2020-07-07 18:37:25 +0900 그 시간을 유닉스 시간으로 unix_time = now.to_i => 1594114645 그걸 다시 ... 음.. Time.at(unix_time) => 2020-07-07 18:37:25 +0900 오늘 시작 시작 Time.now.beginning_of_day => 2020-07-07 00:00:00 +0900 오늘 마지막 시간 Time.now.end_of_day => 2020-07-07 23:59:59 +0900 utc로 변환 now_utc = now.utc => 2020-07-07 09:37:25 UTC 다시 로컬타임으로 now_utc.localtime => 2020-07-07 18:37:25 +0900
https://medium.com/steady-study/%EB%A3%A8%EB%B9%84-mixin-include-prepend-extend-%EA%B7%B8%EB%A6%AC%EA%B3%A0-concern-e691c92fb233 루비 mixin: include, prepend, extend 그리고 Concern 루비에서 module을 mixin하면 다중 상속과 비슷한, 또는 더 풍부한 효과를 낼 수 있습니다. mixin과 ActiveSupport::Concern에 대해 알아봅시다. medium.com
def 메소드(인수) ..... end
루비 설치 https://www.digitalocean.com/community/tutorials/how-to-install-ruby-on-rails-with-rbenv-on-ubuntu-18-04 우분투에서 rbenv 업데이트하기 https://www.endpoint.com/blog/2015/11/03/updating-rbenv-ruby-build-on-ubuntu cd ~/.rbenv git pull cd ~/.rbenv/plugins/ruby-build/ git pull for MAC https://pie001.github.io/entry/blog/0017/https://rorlab.org/rblogs/214 for mac 업데이트 하기.. - 새로운 루비 버전이 나와서 세팅해야될때.. $ brew..
find numbers = [38, 74, 56, 48, 87, 68, 81, 49] puts numbers.find {|item| item % 7 == 0 } scores = { 'Alice' => 50, 'Bob' => 60, 'Carol' => 90, 'David' => 40 } p scores.find {|k, v| v >= 70 } detect ...
https://docs.ruby-lang.org/en/2.5.0/Hash.html