Skip to content

Instantly share code, notes, and snippets.

View usutani's full-sized avatar

Yasuhiro Usutani usutani

  • Kobe, Hyogo, Japan
View GitHub Profile

Ruby2.1 on Ubuntu

sudo ls

sudo apt-get update
sudo apt-get -y install gcc
sudo apt-get -y install make
sudo apt-get -y install build-essential
sudo apt-get -y install zlib1g-dev libssl-dev libreadline-dev libyaml-dev libxml2-dev libxslt-dev
# config/routes.rb
resources :documents do
scope module: 'documents' do
resources :versions do
post :restore, on: :member
end
resource :lock
end
end
bcx david$ rake stats
+----------------------+-------+-------+---------+---------+-----+-------+
| Name | Lines | LOC | Classes | Methods | M/C | LOC/M |
+----------------------+-------+-------+---------+---------+-----+-------+
| Controllers | 3704 | 2942 | 72 | 479 | 6 | 4 |
| Helpers | 1901 | 1529 | 13 | 261 | 20 | 3 |
| Models | 5310 | 4116 | 50 | 653 | 13 | 4 |
| Libraries | 2167 | 1593 | 51 | 200 | 3 | 5 |
| Integration tests | 297 | 217 | 6 | 1 | 0 | 215 |
| Functional tests | 3897 | 3065 | 61 | 11 | 0 | 276 |

Docker 虎の巻

何故Dockerを使うべきか

Why Should I Care (For Developers)

"Dockerが面白いのはシンプルな環境に隔離性と再現性をもたらしてくれることだ.ランタイムの環境を一度作れば、パッケージにして別のマシンでも再利用することできる.さらに,すべてはホスト内の隔離された環境で行われる(VMのように).最も素晴らしい点は,シンプルかつ高速であることだ."

{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Mail server for receiving",
"Parameters" : {
"MailServerDomain" : {
"Type" : "String",
"Default" : "mail.example.com",
"Description" : "mail server domain"
},
@usutani
usutani / terminate.cs
Created January 6, 2019 06:47 — forked from jvshahid/terminate.cs
C# terminating a child process (as opposed to killing, i.e. sigkill vs. sigint on linux)
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
namespace TestCtrlEvent

How to deploy a Rails 7.1 app with Postgres and Kamal on a single server

I think you have looked at the tutorial from Mr. Heinemeier Hansson at least once or twice and have a similar setup.

application

  • ruby 3.2.2
  • rails 7.1.3.2
  • postgresql 15

server