Skip to content

Instantly share code, notes, and snippets.

@ogawatti
ogawatti / Dockerfile
Created November 26, 2022 14:03
docker/build-push-action ssh and github secrets private key
# syntax = docker/dockerfile:1.0-experimental
FROM node:16-bullseye-slim
ARG ssh_prv_key
RUN apt update \
&& apt upgrade -y \
&& apt install -y git
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
set nu
set expandtab
set autoindent
set viminfo='20,\"1000
set hlsearch
set tabstop=2
set shiftwidth=2
set hlsearch
syntax on
@ogawatti
ogawatti / .bashrc
Created August 23, 2022 23:23
bashrc for mac
export PS1='[\u@\h \W]\$ '
export LSCOLORS=gxfxcxdxbxegedabagacad
export GREP_OPTIONS="--binary-files=without-match --color=auto"
export LANG=ja_JP.UTF-8 # Win-Mac 文字化け対策
export LESSCHARSET=utf-8 # Win-Mac 文字化け対策
export HISTTIMEFORMAT='%y/%m/%d %H:%M:%S ';
export BASH_SILENCE_DEPRECATION_WARNING=1
export PATH="/opt/homebrew/bin:$PATH"
export PATH="/opt/homebrew/opt/curl/bin:$PATH"
export PATH="/opt/homebrew/sbin:$PATH"
@ogawatti
ogawatti / docker.yml
Last active August 23, 2022 23:01
Lima settings
# Example to use Docker instead of containerd & nerdctl
# $ limactl start ./docker.yaml
# $ limactl shell docker docker run -it -v $HOME:$HOME --rm alpine
# To run `docker` on the host (assumes docker-cli is installed):
# $ export DOCKER_HOST=$(limactl list docker --format 'unix://{{.Dir}}/sock/docker.sock')
# $ docker ...
# Specify Intel x86-64 VM
# arch: "x86_64"
@ogawatti
ogawatti / docker-compose.yml
Created August 23, 2022 22:49
rails and db, swagger, redoc for docker
version: '3'
services:
app:
build: .
volumes:
- ./:/usr/src/app
ports:
- "3000:3000"
depends_on:
- db
@ogawatti
ogawatti / merge_main_and_tag_and_create_github_release.js
Created August 23, 2022 06:32
release script (merge to main and tag and create github release)
const { execSync } = require('child_process')
const readlineSync = require('readline-sync')
const { Octokit } = require('@octokit/rest')
process.chdir('..')
require('dotenv').config()
const releaseBranch = 'main'
const defaultBranch = 'develop'
@ogawatti
ogawatti / simplecss.html
Created August 23, 2022 06:18
Simple CSS example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="https://cdn.simplecss.org/simple.min.css">
<title>My New Website</title>
</head>
<body>
@ogawatti
ogawatti / insert-presenter-to-html.js
Created August 23, 2022 06:13
Add presentor window to html (for marp)
const fs = require('fs')
const cheerio = require('cheerio')
const link = '<link rel="stylesheet" href="presenter.css">'
const script = '<script src="presenter.js" defer></script>'
const presenter = '<div class="presenter"><video id="incam" /></div>'
const filepath = process.argv[2]
let html = fs.readFileSync(filepath, 'utf8')
@ogawatti
ogawatti / rails_routes_by_console.rb
Created August 23, 2022 05:46
Rails routes by console
# http://localhost:3000/rails/info/routes
Rails.application.routes.url_helpers.root_path #=> "/"
Rails.application.routes.routes.map(&:name).compact