Skip to content

Instantly share code, notes, and snippets.

tDiaryの動かし方(2022年12月17日時点)

作成

  1. gem install tdiaryでtdiaryをインストール
  2. tdiary new diaryでdiaryディレクトリと関連ファイルを作成する
  3. cd diaryする

注意

@miyohide
miyohide / Gemfile
Created May 7, 2022 07:53
Cloud Native Buildpacks for Ruby
# frozen_string_literal: true
source "https://rubygems.org"
ruby "3.1.2"
gem "sinatra"
gem "puma"
@miyohide
miyohide / rails7_help.txt
Created April 11, 2022 11:22
Rails 7 help
Usage:
rails new APP_PATH [options]
Options:
[--skip-namespace], [--no-skip-namespace] # Skip namespace (affects only isolated engines)
[--skip-collision-check], [--no-skip-collision-check] # Skip collision check
-r, [--ruby=PATH] # Path to the Ruby binary of your choice
# Default: /Users/miyohide/.rbenv/versions/3.1.1/bin/ruby
-m, [--template=TEMPLATE] # Path to some application template (can be a filesystem path or URL)
-d, [--database=DATABASE] # Preconfigure for selected database (options: mysql/postgresql/sqlite3/oracle/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)
@miyohide
miyohide / frequently_use_git_commands.md
Last active November 25, 2020 12:26
よく使うGitコマンド

マージ済みのブランチ(現在のブランチ、develop、master以外)を表示する

git branch --merged | egrep -v '*|develop|master'

マージ済みのブランチ(現在のブランチ、develop、master以外)を削除する

git branch --merged | egrep -v '*|develop|master' | xargs git branch -d

既にリモートで削除されているブランチを消す

@miyohide
miyohide / feed.builder
Created May 31, 2020 09:16
create Atom feed for middleman
---
layout: false
---
require 'open3'
xml.instruct!
xml.feed "xmlns" => "http://www.w3.org/2005/Atom" do
xml.title "Sample Site"
xml.link "href" => "http://example.com"
xml.updated Time.now

これはなにか

Gitブランチ戦略のメモです。

基本戦略

ファーストバージョンリリースまで

  • masterブランチに対して直接コミットを行う。
  • ここで言うファーストバージョンとは、アプリ全体が一通り揃った段階の状態を指す。世間にリリースしているかどうかは不問。
@miyohide
miyohide / rails_new_version_6.0.0.txt
Created October 29, 2019 12:47
Rails new -h result. rails -v = 6.0.0
Usage:
rails new APP_PATH [options]
Options:
[--skip-namespace], [--no-skip-namespace] # Skip namespace (affects only isolated applications)
-r, [--ruby=PATH] # Path to the Ruby binary of your choice
# Default: /usr/local/bin/ruby
-m, [--template=TEMPLATE] # Path to some application template (can be a filesystem path or URL)
-d, [--database=DATABASE] # Preconfigure for selected database (options: mysql/postgresql/sqlite3/oracle/frontbase/ibm_db/sqlserver/jdbcmysql/jdbcsqlite3/jdbcpostgresql/jdbc)
# Default: sqlite3
package com.github.miyohide;
public class SampleGame {
public String play(String p1, String p2) {
if ((p1.equals("rock") && p2.equals("scissors")) ||
(p1.equals("scissors") && p2.equals("paper"))
) {
return "player1Win";
}
require "minitest/autorun"
require "json"
def solve(src)
src_i = src.to_i(16)
out = []
1.upto src_i do |i|
if (src_i & i ) == i
out << i
end
class Pukiwiki2md
STRONG_REG = /''(.+?)''/
LINK_REG = /\[\[(.+?):(.+?)\]\]/
def convert_strong!(line)
line.gsub!(STRONG_REG, "**\\1**")
line
end
def convert_link!(line)