PG::ConnectionBad at /
could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections on port 5432?
could not connect to server: Connection refused
Is the server running on host "localhost" (127.0.0.1) and accepting
TCP/IP connections on port 5432?
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
やわらかRubyはCC BY 4.0 で提供します。 | |
詳細: https://creativecommons.org/licenses/by/4.0/deed.ja | |
This work is licensed under a Creative Commons Attribution 4.0 International License. | |
See also: https://creativecommons.org/licenses/by/4.0/deed |
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
// ==UserScript== | |
// @name http://gazoreply.jp/ | |
// @description replace gazoreply.jp copy image url | |
// @include http://gazoreply.jp/* | |
// @exclude http://gazoreply.jp/situation/* | |
// ==/UserScript== | |
window.addEventListener('load', function(){ | |
var imgURL = document.getElementById("main-photo-img").getAttribute('src'); | |
var clipboardButtonElement = document.getElementById("copy-clipboard-btn"); |
- ダッシュボード
- 何も考えずに各モデルをカウントするのでレコード件数増えるとえらいことになる。
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
##controller | |
def index | |
#includesとかはせずにとりあえずn1_safeを付けておく | |
@posts = Post.all.n1_safe | |
end | |
#Post load (X.Xms) SELECT "posts".* FROM "posts" | |
##view | |
#なにも考えずにeachとかまわしまくると、必要になった時にまとめてN+1を回避しつつloadされる感じ | |
<% @posts.each do |post| %> |