Skip to content

Instantly share code, notes, and snippets.

View mh-mobile's full-sized avatar
🏠
Working from home

mh-mobile mh-mobile

🏠
Working from home
View GitHub Profile
@mh-mobile
mh-mobile / doordeeper.rb
Last active October 28, 2020 14:07
test doorkeeper response
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
# Activate the gem you are reporting the issue against.
gem "activerecord", "6.0.0"
end
@mh-mobile
mh-mobile / connpass.rb
Created October 28, 2020 13:40
test connpass request
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
# Activate the gem you are reporting the issue against.
gem "activerecord", "6.0.0"
end
@mh-mobile
mh-mobile / ogp.rb
Created October 28, 2020 11:25
test ogp
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
# Activate the gem you are reporting the issue against.
@mh-mobile
mh-mobile / comment_assoc.rb
Created October 15, 2020 01:32
ActiveRecord for MySQL version
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
# Activate the gem you are reporting the issue against.
@mh-mobile
mh-mobile / Dockerfile
Last active October 15, 2020 01:30
VSCode Remote Container for MySQL
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/ruby/.devcontainer/base.Dockerfile
# [Choice] Ruby version: 2, 2.7, 2.6, 2.5
ARG VARIANT="2"
FROM mcr.microsoft.com/vscode/devcontainers/ruby:${VARIANT}
#RUN apt update
#RUN sudo apt-get install imagemagick
# [Option] Install Node.js
@mh-mobile
mh-mobile / Dockerfile
Created October 13, 2020 09:36
VSCode Remote Container for Postgres + Rails + Chrome
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.140.1/containers/ruby/.devcontainer/base.Dockerfile
# [Choice] Ruby version: 2, 2.7, 2.6, 2.5
ARG VARIANT="2"
FROM mcr.microsoft.com/vscode/devcontainers/ruby:${VARIANT}
# [Option] Install Node.js
ARG INSTALL_NODE="true"
ARG NODE_VERSION="lts/*"
@mh-mobile
mh-mobile / .devcontainer
Last active October 13, 2020 09:31
Alpine Remote Container for Rails
{
"name": "Ruby 2.6.5 & PostgreSQL",
"dockerComposeFile": "docker-compose.yml",
"service": "app",
"workspaceFolder": "/workspace",
"remoteUser": "vscode",
// Set *default* container specific settings.json values on container create.
"settings": {
"terminal.integrated.shell.linux": "/bin/bash",
"sqltools.connections": [{
@mh-mobile
mh-mobile / openpr.vim
Created October 9, 2020 03:11
openpr.vim
function! openpr#open() abort
let line = line('.')
let fname = expand('%')
let cmd = printf('git blame -L %d,%d %s | cut -d " " -f 1', line, line, fname)
let sha1 = system(cmd)
let cmd = printf('git openpr %s', sha1)
echo system(cmd)
endfunction
@mh-mobile
mh-mobile / active_record_gem_for_postgres.rb
Created October 6, 2020 03:36
postgresのactive_record_gem
# frozen_string_literal: true
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
# Activate the gem you are reporting the issue against.
@mh-mobile
mh-mobile / whereby_log_exporter.js
Last active August 19, 2020 14:19
コンソールログにWherebyの会話ログをエクスポートするスクリプト
class ChatMessage {
constructor(message) {
this.content = message.querySelector("[class^=content-]").textContent
}
static createChatMessages(messages) {
return messages.map(message => new ChatMessage(message))
}
buildLog() {