Skip to content

Instantly share code, notes, and snippets.

View kmiyake's full-sized avatar
🏠
Working from home

Kota Miyake kmiyake

🏠
Working from home
View GitHub Profile
class CreateUsers < ActiveRecord::Migration[6.0]
def change
create_table :users do |t|
t.string :email, null: false, index: { unique: true }
t.string :password_digest
t.timestamps
end
end
end
export FZF_DEFAULT_COMMAND='ag --hidden --ignore .git -g ""'
@kmiyake
kmiyake / w2g
Last active July 20, 2019 15:58
This is script of converting to gif from webm.
#!/bin/sh
WEBM=$1
if test -f $WEBM; then
EXTENSION=`echo ${WEBM##*.}`
if [ "$EXTENSION" == "webm" ]; then
FILENAME=`echo $WEBM | sed -e 's/.webm//g'`
PALETTE=${WEBM}-colors.png
[mysqld]
innodb_file_per_table=ON
innodb_file_format=Barracuda
innodb_file_format_max=Barracuda
innodb_large_prefix=1
$ npm ls -gp --depth=0 | awk -F/ '/node_modules/ && !/\/npm$/ {print $NF}' | xargs npm -g rm
deploy ALL=NOPASSWD:/usr/bin/monit, mv
$ sudo apt-get install monit
$ sudo vim /etc/monit/monitrc
require 'capistrano/puma/monit'
module ApplicationHelper
def display_atom_link_tag?
root_path? || posts_path?
end
private
def root_path?
current_page?(root_path)
end
$ rails g decorator Post
/Users/kotamiyake/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `require': cannot load such file -- active_model/serializers/xml (LoadError)
from /Users/kotamiyake/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `block in require'
from /Users/kotamiyake/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:259:in `load_dependency'
from /Users/kotamiyake/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/activesupport-5.0.1/lib/active_support/dependencies.rb:293:in `require'
from /Users/kotamiyake/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/draper-2.1.0/lib/draper.rb:5:in `<top (required)>'
from /Users/kotamiyake/.rbenv/versions/2.3.3/lib/ruby/gems/2.3.0/gems/bundler-1.13.6/lib/bundler/runtime.rb:91:in `require'
from /Users/kotamiyake/.rbenv/versions/2.3.3/lib/ruby/gems/