Skip to content

Instantly share code, notes, and snippets.

@goosys
goosys / bitnami-apps-vhosts.conf
Last active March 31, 2020 15:27
LightsailのWordpressにLet's EncryptでSSLを設定し自動更新する
<VirtualHost *:80>
ServerName tarumae.tech
<IfModule rewrite_module>
RewriteEngine On
LogLevel alert rewrite:trace3
RewriteCond %{HTTPS} off
RewriteCond %{REQUEST_URI} !(^/.well-known/)
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R,L]
</IfModule>
default: &default
# adapter: postgresql
encoding: utf-8
# URL
url: <%= ENV.fetch('DATABASE_URL','postgresql://postgres:postgres@localhost:5432') %>
database: <%= ENV.fetch('DATABASE_BASENAME', 'project') + '_' + Rails.env %>
# For details on connection pooling, see Rails configuration guide
# http://guides.rubyonrails.org/configuring.html#database-pooling
rails new project -d postgresql -SJT --skip-spring --skip-turbolinks -m template.rb
@goosys
goosys / Dockerfile.development
Created September 6, 2018 13:37
DockerCompose-Rails
FROM ruby:2.5.1
RUN apt-get update && apt-get install -y postgresql-client --no-install-recommends && rm -rf /var/lib/apt/lists/*
RUN curl -sL https://deb.nodesource.com/setup_9.x | bash - && \
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
echo "deb https://dl.yarnpkg.com/debian/ stable main" >> /etc/apt/sources.list.d/yarn.list && \
apt-get update && apt-get install -y nodejs yarn --no-install-recommends && rm -rf /var/lib/apt/lists/*
ENV RAILS_VERSION 5.1.4
# frozen_string_literal: true
# @see https://github.com/rails/rails/blob/5-2-0/activerecord/lib/active_record/connection_adapters/postgresql/oid/uuid.rb
module ActiveRecord
module ConnectionAdapters
module PostgreSQL
module OID # :nodoc:
class Uuid < Type::Value # :nodoc:
# ACCEPTABLE_UUID = %r{\A(\{)?([a-fA-F0-9]{4}-?){8}(?(1)\}|)\z}
@goosys
goosys / a.sh
Created December 8, 2016 19:12
a
echo $ES_ENDPOINT
@goosys
goosys / UserData.sh
Last active November 16, 2017 08:28
ec2-setup-base
#!/bin/bash
# setup
# source: https://gist.github.com/goosys/8f8d6db86325ea6e8ad6315f037addd5
sh -c "$(curl -fsSL https://gist.githubusercontent.com/goosys/8f8d6db86325ea6e8ad6315f037addd5/raw/18ef6cf38a4c8add4515c20a73c8dbe89f385433/setup.sh)"
@goosys
goosys / result.txt
Created November 9, 2016 18:37
skip_carrierwave_callbacks
------------------------ all skip
"Material"
:save
{}
:commit
{}
:update
{}
------------------------ no skip
function CompatibilityCheck() {
hasWebGL ? mobile ? confirm("Please note that Unity WebGL is not currently supported on mobiles. Press Ok if you wish to continue anyway.") || window.history.back() : -1 == browser.indexOf("Firefox") && -1 == browser.indexOf("Chrome") && -1 == browser.indexOf("Safari") && (confirm("Please note that your browser is not currently supported for this Unity WebGL content. Try installing Firefox, or press Ok if you wish to continue anyway.") || window.history.back()) : (alert("You need a browser which supports WebGL to run this content. Try installing Firefox."),
window.history.back());
}
function SetFullscreen(a) {
if ("undefined" == typeof JSEvents) return void console.log("Player not loaded yet.");
var b = JSEvents.canPerformEventHandlerRequests;
JSEvents.canPerformEventHandlerRequests = function() {
return 1;
module Rack
class GzipHeader
def initialize(app, options = {})
@app = app
@start_with = options[:start_with] || '/'
@end_with = options[:end_with] || '.gz'
end
def call(env)