Skip to content

Instantly share code, notes, and snippets.

🏠
Working from home

Suguru Murakami sugumura

🏠
Working from home
Block or report user

Report or block sugumura

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@sugumura
sugumura / Dockerfile.step1
Created Aug 4, 2019
「オトナのDocker入門#LAMP環境を作ろう」のサンプル
View Dockerfile.step1
FROM php:7.3.8-apache-stretch
EXPOSE 80
@sugumura
sugumura / command.log
Last active Jun 5, 2019
さくらレンタルサーバセットアップ
View command.log
# login
$ ssh example@example.sakura.ne.jp
$ chsh -s /usr/local/bin/bash
$ exec $SHELL -l
$ cat > ~/.bash_profile <<EOF
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
EOF
@sugumura
sugumura / Gemfile
Created Jan 23, 2019
install Fastlane
View Gemfile
source "https://rubygems.org"
gem 'dotenv'
gem 'fastlane'
plugins_path = File.join(File.dirname(__FILE__), 'fastlane', 'Pluginfile')
eval_gemfile(plugins_path) if File.exist?(plugins_path)
@sugumura
sugumura / remove_any_docker_volume.md
Last active Oct 9, 2018
docker volumeをgrepで引っ掛けて削除するやつ。動作の保証はしません
View remove_any_docker_volume.md
$ docker volume ls | grep [your keyword] | awk '{print $2}' | xargs docker volume rm
@sugumura
sugumura / Gemfile
Last active Sep 5, 2018
google/google-auth-library-rubyを利用したFCMへのプッシュ通知サンプル。Ruby on Rails前提
View Gemfile
source 'https://rubygems.org'
gem 'rails'
# google/google-auth-library-ruby
gem 'googleauth'
# HTTPリクエストできればなんでもよい
gem 'faraday'
@sugumura
sugumura / app.module.ts
Last active Sep 5, 2018
IonicでのFirebaseによるプッシュ通知用のトークンを取得するサンプル。
View app.module.ts
// src/app/app.module.ts
import { Firebase } from '@ionic-native/firebase';
@NgModule({
//...
providers: [
Firebase,
],
//...
})
export class AppModule {}
@sugumura
sugumura / command.rb
Created Jul 19, 2018
Rails consoleでJSONを出力したいとき
View command.rb
# ファイルに書き出したい
>> f = File.new(Rails.root + 'hoge.json', 'w')
>> f << JSON.pretty_generate(Post.all.as_json)
>> f.close
# 出力したい
>> puts JSON.pretty_generate(Post.all.as_json)
@sugumura
sugumura / create_rails_app.md
Last active Apr 27, 2018
Start Ruby on Rails.
View create_rails_app.md
$ mkdir {your_app}
$ bundle init
$ vim Gemfile

# enable rails gem and edit version
gem "rails", '5.2.0'


$ bundle install --path=vendor/bundle --jobs=4
@sugumura
sugumura / webapp_healthd.conf
Created Mar 12, 2018
NginxでSlackbotのアクセスを弾きたい場合
View webapp_healthd.conf
# ref: https://api.slack.com/robots
location / {
if ( $http_user_agent ~* (Slackbot-LinkExpanding) ) {
return 403;
}
}
@sugumura
sugumura / webapp_healthd.conf
Created Mar 1, 2018
nginxでキャッシュ時間を0にしたい場合
View webapp_healthd.conf
########
# ~~~
########
location /public {
alias /var/app/current/public;
gzip_static on;
gzip on;
expires 0;
add_header Cache-Control public;
You can’t perform that action at this time.