プログラミングを完全に理解したエンジニアのメモ

チラ裏レベルのことしか書いてないインターネットの藻屑

axiosのdebug

axios.interceptors.request.use(request => { console.log('Starting Request: ', request); return request; }); axios.interceptors.response.use(response => { console.log('Response: ', response); return response; });

Selenimuのsession not created error と TCP connection error

問題 ひさしぶりにSeleniumを使うと下記のエラー session not created: This version of ChromeDriver only supports Chrome version 103 (Selenium::WebDriver::Error::SessionNotCreatedError) Current browser version is 110.0.5481.177 with binary pat…

Rreact Nativeで使ってみたいUIフレームワーク

wix.github.io callstack.github.io akveo.github.io reactnativeelements.com reactnativepaper.com 参考 docs.expo.dev

react_railsのTips(随時更新)

画像読み込み config/webpacker.ymlに下記追加 resolved_paths: ['app/assets/images'] jsファイル import SampleImage from 'sample.png'; <img src={SampleImage} />

stripeのライフサイクルのメモ

tech.innovator.jp.net

stripeのライフサイクルのメモ

tech.innovator.jp.net

expoでAdMobを導入する

使用するライブラリ docs.expo.dev 導入手順 インストール $ expo install expo-ads-admob Front import { Platform } from 'react-native'; import { AdMobBanner } from 'expo-ads-admob'; const bannerError = () => { console.log("AdMob Fail error") } <View style={styles.admobBanner}></view>…

Vue/Nuxt.jsでvue-awesome-swiperのnavigationとpaginationが動かなかった

原因 - cssのパスが5と6系で違う - プラグインのインポートの方法 github.com github.com github.com qiita.com stackoverflow.com

市区町村以下のデータの整形方法

select name, deleted_at from m_area_4 where name like '%ビル%' select name, deleted_at from m_area_4 where name like '%タワー%' select name, deleted_at from m_area_4 where name like '%ビルを除く%' select name, deleted_at from m_area_4 wher…

gulp導入メモ

$ npm init -y $ npm install -D gulp gulp-sass gulp-sass-glob sass $ npx -p touch nodetouch gulpfile.js

bitnamiでwordpressが落ちる時のMySQL php-fpm周りのチューニングメモ

ログ内容 [26-Sep-2019 12:59:26] WARNING: [pool wordpress] server reached pm.max_children setting (5), consider raising it [26-Sep-2019 13:00:55] WARNING: [pool wordpress] server reached pm.max_children setting (5), consider raising it [26-…

背景がボーダー(とか単色ではない)の吹き出し

背景がボーダーのデザイン こんなやつ ・レスポンシブでもデザインの背景に切れ目が入らない ・複数行でも対応できる を満たす実装 html <div class="title">背景がボーダーの吹き出しのタイトル</div> <br><br><br> <div class="title">背景がボーダーの吹き出しのタイトル改行が入っても大丈夫です。<br>背景がボーダー</div>…

Railsにnpmでfullcalendarを導入

課題 gemもあるけど公式から入れたい jqueryは未導入 方法 $ npm install jquery moment fullcalendar application.jsに以下を追加 //= require jquery/dist/jquery //= require moment/moment //= require fullcalendar/dist/fullcalendar //= require full…

ライブ配信のポイント購入画面のUI

ライブ配信のポイント購入画面のUIのスクショ ツイキャス ツイキャス LINE LIVE LINE LIVE 17 live 17live Mirrativ Mirrativ mix channel mixchannel showroom showroom spoon spoon

MacbookをMojaveにアップデートしたらbundle installでこける

問題 MacbookをMojave 10.14にアップデートしたらbundle installでこける (略) An error occurred while installing ffi (1.9.25), and Bundler cannot continue. Make sure that `gem install ffi -v '1.9.25' --source 'https://rubygems.org/'` succeeds …

All-in-One WP Migrationの"Maximum upload file size: 40 MB."の解決方法

問題 All-in-One WP Migrationでエクスポートしたデータが容量制限のせいでインポートできない "Maximum upload file size: 40 MB." Bitnamiで構築したサーバーなので $ vi /opt/bitnami/php/etc/php.ini post_max_size と upload_max_filesize の16を512に…

Rails / Nginxのサイトでrobots.txtがアクセスできない

Nginxで側でやってもいい production.rb config.public_file_server.enabled = true

モーダルをiPhoneでスクロールするともっさりする

html { -webkit-overflow-scrolling: touch; } & スクロールしたい要素にoverflow-y: scroll;をつける

AdminLTEのサイドバーを固定した時にスクロールすると背景色がかからない

問題 AdminLTEでヘッダ固定、サイドバー固定をして、スクロールすると画像の赤枠以降に背景色が適用されない。 bodyについてるクラスはこれ body class="skin-blue fixed sidebar-mini sidebar-mini-expand-feature" 解決方法 cssを書く .content-wrapper { …

RailsでFUJISSLのファイル認証をする

NginxでなくRails側でファイル認証をする routes.rb get "/.well-known/pki-validation/fileauth.txt" => "top#ssl" top_controller.rb class TopController < ApplicationController def index hogehoge end def ssl render plain: "(ファイル認証の文字列)…

wordpressにfavicon設定

header.php <link rel="shortcut icon" href="<?php echo get_stylesheet_directory_uri(); ?>/favicon.ico" /> 画像をテーマディレクトリの直下に置く wp-content/themes/favicon.ico</link>

スクロールしたときに要素が画面上部からどの位置にいるか取得する

coffeescript $ -> $(window).scroll -> console.log $('.target-element').offset().top - $(window).scrollTop(); スクロールするたびにコンソールに画面上部からの位置が表示される

bitnamiをssl化する

csrの作成 秘密鍵を作成 $ sudo openssl genrsa -out /opt/bitnami/apache2/conf/server.key 2048 秘密鍵からCSRを作成 $ sudo openssl req -new -key /opt/bitnami/apache2/conf/server.key -out /opt/bitnami/apache2/conf/cert.csr 作成のための質問項目…

AWS EC2のbitnamiの右下のバナーを消す

$ sudo /opt/bitnami/apps/APPNAME/bnconfig --disable_banner 1 $ sudo /opt/bitnami/ctlscript.sh restart apache 公式Doc Remove the Bitnami Banner

AWS EC2のbitnamiにbasic認証をかける

環境 AWS EC2 WordPress Certified by Bitnami 実装 $ cd /opt/bitnami $ sudo apache2/bin/htpasswd -cb apache2/wordpress_users USERNAME PASSWORD $ sudo vi /opt/bitnami/apps/wordpress/conf/httpd-app.conf 以下に書き換える。 4行追加 & Require all…

EC2とRailsとnginxのサイトをLet’s EncryptでSSL化

httpで動いてるとこからhttpsに変更する手順 Rails5 AWS EC2 CentOS 6系 準備 $ git clone https://github.com/letsencrypt/letsencrypt $ cd ./letsencrypt $ ./letsencrypt-auto --help --debug 最後に以下のようにでればOK Complete! Creating virtual en…

bitnamiでLet's EncryptでSSL化するときに読むメモ

Doc Generate And Install A Let's Encrypt SSL Certificate For A Bitnami Application Generate and Install a Let's Encrypt SSL Certificate for a Bitnami Application How To Force HTTPS Redirection With Apache? Bitnami Stacks for AWS Cloud Forc…

Railsで多言語対応する

トップページを多言語化するサンプルコードのメモ Gemfile gem 'rails-i18n' gem 'http_accept_language' config/routes.rb Rails.application.routes.draw do scope '(:locale)', locale: /#{I18n.available_locales.join('|')}/ do root 'top#index' end e…

carrierwaveで画像名をユニークにした時にS3とDBでファイル名が異なる

問題 ファイル名をユニークにするために以下の処理をしていた def filename p "#{SecureRandom.uuid}.#{file.extension}" if original_filename.present? end がs3にcarrierwaveで画像アップ&DBに保存すると、s3とDBのファイル名が違っていた。 この人たちと…

Rspec導入

gem導入 group :development, :test do (略) gem 'rspec-rails' end $ bundle install --path vendor/bundle configファイル生成 $ rails generate rspec:install .rspec spec/spec_helper.rb spec/rails_helper.rb が生成される .rspec編集 --warnings --co…