Skip to content

Instantly share code, notes, and snippets.

View sunny4381's full-sized avatar

NAKANO Hideo sunny4381

  • 株式会社ウェブチップス
View GitHub Profile
port = ENV.fetch('port', 3000).to_i
SITE_ALLOWED = begin
fields = []
# 基本情報
fields += %w[_id id name host domains subdir parent_id domains_with_subdir group_ids partner_site_
ids]
# ページ設定
fields += %w[auto_keywords keywords auto_description max_name_length]
# モバイル設定
#
# 使用方法:
# bundle exec rails runner all_contents_download.rb www > all_contents.csv
#
site = Cms::Site.find_by(host: ARGV[0])
exporter = Cms::AllContent.new(site: site)
enumerable = exporter.enum_csv(encoding: "Shift_JIS")
enumerable.each do |csv|
STDOUT.write csv
# 少し凝った zshrc
# License : MIT
# http://mollifier.mit-license.org/
########################################
# 環境変数
#export LANG=ja_JP.UTF-8
#export PATH="/usr/local/opt/imagemagick@6/bin:$PATH"
#export PATH="/usr/local/opt/mongodb-community@4.2/bin:$PATH"
#export PATH="/usr/local/sbin:$PATH"
# SHIRASAGI OAuth 2.0 IdP 機能を利用したサンプルプログラム
# このサンプルでは jwt 拡張フローを用います。
#
# 実行方法
# bin/rails runner oauth2_sample_with_jwt_flow.rb
# ドメイン
your_domain = "https://localhost:3551/"
# トークンエンドポイントの URL
token_url = URI.join(your_domain, "/.mypage/login/oauth2/token")
# SHIRASAGI OAuth 2.0 IdP 機能を利用したサンプルコード
# このサンプルでは authorization code flow を用います。
#
# 実行方法
# bin/rails runner oauth2_sample_with_authorization_code_flow.rb
# ドメイン
your_domain = "https://localhost:3551/"
# 認可エンドポイントの URL
authorize_url = URI.join(your_domain, "/.mypage/login/oauth2/authorize")
# SHIRASAGI OAuth 2.0 IdP 機能を利用したサンプルコード
# このサンプルでは implicit flow を用います。
#
# 実行方法
# bin/rails runner oauth2_sample_with_implicit_flow.rb
# ドメイン
your_domain = "https://localhost:3551/"
# 認可エンドポイントの URL
authorize_url = URI.join(your_domain, "/.mypage/login/oauth2/authorize")
data:text/html,<html contenteditable> <script>window.onbeforeunload=function(){ return "%E9%96%89%E3%81%98%E3%81%BE%E3%81%99%E3%81%8B%EF%BC%9F" }</script>
brew doctor で sudo xcode-select --install を実行しろと表示され実行するものの、また sudo xcode-select --install を実行しろと言われる場合:
次のコマンドを実行する
xcodebuild -runFirstLaunch
以下のコマンドを実行した後で bundle install を実行する
bundle config build.debase --with-cflags="-Wno-error=implicit-function-declaration"
#!/bin/bash
port=3000
bundle exec rake db:drop
rm -rf private public
git checkout -- private public
bundle exec rake db:create_indexes
bundle exec rake ss:create_site data="{ name: '自治体サンプル', host: 'www', domains: 'www.example.jp:$port', mypage_domain: 'localhost:$port', map_api: 'openlayers' }"
bundle exec rake ss:create_site data="{ name: '企業サンプル', host: 'company', domains: 'company.example.jp:$port', mypage_domain: 'localhost:$port', map_api: 'openlayers' }"