puts 'Hello Ruby on Rails World'
This file contains 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
{"lastUpload":"2021-01-08T10:12:47.637Z","extensionVersion":"v3.4.3"} |
This file contains 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
# 사전 준비물 | |
# 파이어폭스 | |
# 게코드라이버 - geckodriver | |
# 루비 - ruby | |
# 셀레니움을 쓸 수 있게 설정합니다. 브라우저와 코드 사이에서 커뮤니케이션을 해주는 라이브러리입니다. | |
require "selenium-webdriver" | |
# 파이어폭스를 셀레니움과 연결해줍니다. 파이어폭스가 다른 브라우저에 비해 오토메이션 속도가 빠른편입니다. | |
driver = Selenium::WebDriver.for :firefox |
This file contains 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
from bs4 import BeautifulSoup | |
from urllib.parse import urlparse | |
import xlsxwriter | |
import re | |
import requests | |
import urllib | |
import unicodedata | |
def page_url(locations, page): |
This file contains 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
ko: | |
devise_token_auth: | |
sessions: | |
not_confirmed: " '%{email}'확인 용 메일을 보냈습니다. 이메일의 지침을 읽고 계정을 활성화하십시오." | |
bad_credentials: "이메일 또는 비밀번호를 다시 한 번 확인해보시기 바랍니다." | |
not_supported: "/sign_in에 GET은 지원되지 않습니다. POST를 사용하십시오." | |
user_not_found: "이메일을 다시 한 번 확인해보시기 바랍니다." | |
token_validations: | |
invalid: "로그인 인증 정보가 올바르지 않습니다." | |
registrations: |
This file contains 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
<script src="https://service.iamport.kr/js/iamport.payment-1.1.2.js" type="text/javascript"></script> | |
<script> | |
IMP.init('imp34166162'); | |
IMP.request_pay({ | |
pg : 'kakao', | |
pay_method : 'card', | |
merchant_uid : 'merchant_' + new Date().getTime(), | |
name : '주문명:결제테스트', | |
amount : 14000, |
This file contains 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
의도: 새로운 QueryLog 가 생성되면, 같은 keyword 를 가지고 있는 오늘 생성된 모든 QueryLog 를 카운팅해서 Keyword 객체의 daily_query_logs 에 업데이트 해준다. | |
삽질: update_daily_query_logs_count 함수 안에서 QueryLog 를 조회하면, | |
새로 생성되는 해당 객체가 가지고 있는 attribute 를 사용해서 조회를 한다. | |
설명이 좀 어려운데, 그냥 단순하게 QueryLog.all.to_sql 로 조회를 해도 | |
SELECT `query_logs`.* FROM `query_logs` | |
WHERE `query_logs`.`user_id` = 5 AND `query_logs`.`keyword_id` = 2 | |
AND (`query_logs`.`created_at` BETWEEN '2016-11-19 15:00:00' AND '2016-11-19 16:40:12') |
This file contains 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
#when UploaderInput use in ActiveAdmin | |
form do |f| | |
image_preview = -> { | |
if f.object.contents_thumbnail.present? | |
image_tag(f.object.contents_thumbnail.url) | |
else | |
content_tag(:span, "no thumbnail image yet") | |
end | |
} |
This file contains 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
def test | |
item = OrderItem.last | |
image = item.rop | |
send_file image.path, type: 'image/jpeg', disposition: 'inline' | |
end | |
#image.path looks like '/Users/onesup/projects/project-a/public/images/image_name.jpg' |
This file contains 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
['ticket_message','ticket_memo'].each do |method| | |
method_name = (method.underscore+"?").to_sym | |
send :define_method, method_name do | |
method.camelize.constantize.is_a? method.camelize.constantize | |
end | |
end | |
#TicketActivity.ticket_message? 와 같은 식으로 활용. |
NewerOlder