Skip to content

Instantly share code, notes, and snippets.

@YusukeIwaki
YusukeIwaki / Dockerfile
Created July 24, 2019 13:08
rails new
FROM ruby:2.6-alpine
RUN mkdir /usr/src/app
WORKDIR /usr/src/app
RUN bundle init
RUN sed -i -e 's/# gem "rails"/gem "rails"/' Gemfile
# For installing Nokogiri (ref: https://copo.jp/blog/2016/03/alpine-%E3%81%AE-ruby-%E3%81%AE%E3%82%A4%E3%83%A1%E3%83%BC%E3%82%B8%E3%81%AB-nokogiri-%E3%82%92%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB/ )
RUN apk add --no-cache build-base libxml2-dev libxslt-dev
wget https://dl.google.com/go/go1.12.7.linux-amd64.tar.gz
rm -rf go/
tar xzvf go1.12.7.linux-amd64.tar.gz
sudo mv go /usr/local/go
sudo touch /etc/profile.d/golang.sh
echo 'export GOROOT=/usr/local/go' | sudo tee --append /etc/profile.d/golang.sh
echo 'export GOPATH=~/' | sudo tee --append /etc/profile.d/golang.sh
echo 'export PATH=$GOROOT/bin:$PATH' | sudo tee --append /etc/profile.d/golang.sh
@YusukeIwaki
YusukeIwaki / japanese_cmd_space.json
Last active July 11, 2019 03:53 — forked from keik/japanese.json
Karabiner-Elements で command + space での IME トグル
{
"title": "For Japanese",
"rules": [
{
"description": "toggle eisuu with command + space",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "spacebar",
@YusukeIwaki
YusukeIwaki / docker-compose.yml
Created March 12, 2019 15:39
Elasticsearch + Kibana
version: '2.2'
services:
elasticsearch:
image: elasticsearch:5.6
environment:
- discovery.type=single-node
ulimits:
memlock:
soft: -1
hard: -1
@YusukeIwaki
YusukeIwaki / upgrade_ubuntu.sh
Created February 17, 2019 07:12
Cloud9 proでubuntu 18.04
#!/bin/sh
sudo apt-get update
sudo apt-get -y install update-manager-core
sudo do-release-upgrade
npm install -g @vue/cli
vue create プロジェクト名
cd プロジェクト名/
vue add electron-builder
yarn electron:serve
$ bundle exec rails new -h
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/rvm/rubies/ruby-2.5.3/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)
eval "$(direnv hook bash)"
export EDITOR=/usr/bin/nano
#export PS1='\h:\W \u\$ ' # もともと入ってた値
source /usr/local/etc/bash_completion.d/git-prompt.sh
source /usr/local/etc/bash_completion.d/git-completion.bash
GIT_PS1_SHOWDIRTYSTATE=true
export PS1='\h:\W $(if [ -d .git ]; then __git_ps1 " \e[32m(%s)\e[m" ; else echo \u; fi) \$ '
class Ten
include Enumerable
def initialize
end
def each(&block)
10.times.each(&block)
end
end
@YusukeIwaki
YusukeIwaki / rakuten_bank_walking.js
Created June 11, 2018 19:53
puppeteer-page-walkerを使った、楽天銀行残高の確認コード
const userId = "??????????????";
const loginPassword = "???????????";
const branchCode = "???";
const accountNumber = "???????";
const secretWords = {
"卒業した中学校": "???????",
"母親の旧姓": "??????",
"??????": "??????"
};