Skip to content

Instantly share code, notes, and snippets.

View mmizutani's full-sized avatar

Minoru Mizutani mmizutani

  • Tokyo
  • 10:14 (UTC +09:00)
View GitHub Profile
@mmizutani
mmizutani / gist:206344a6439f5d8c72a0
Created February 15, 2016 14:09 — forked from bigsnarfdude/gist:b2eb1cabfdaf7e62a8fc
ubuntu 14.04 install scala 2.11.7 and sbt 13.9 and java 8 and git
# scala install
wget www.scala-lang.org/files/archive/scala-2.11.7.deb
sudo dpkg -i scala-2.11.7.deb
# sbt installation
echo "deb https://dl.bintray.com/sbt/debian /" | sudo tee -a /etc/apt/sources.list.d/sbt.list
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 642AC823
sudo apt-get update
sudo apt-get install sbt
@mmizutani
mmizutani / .profile
Created November 19, 2016 11:18 — forked from bmhatfield/.profile
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
@mmizutani
mmizutani / git-gpg.md
Created November 19, 2016 11:28 — forked from bcomnes/git-gpg.md
my version of gpg on the mac
  1. brew install gnupg21, pinentry-mac (this includes gpg-agent and pinentry)

  2. Generate a key: $ gpg --gen-key

  3. Take the defaults. Whatevs

  4. Tell gpg-agent to use pinentry-mac:

    $ vim ~/.gnupg/gpg-agent.conf 
    
@mmizutani
mmizutani / GPG and git on macOS.md
Created November 19, 2016 12:08 — forked from danieleggert/GPG and git on macOS.md
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
@mmizutani
mmizutani / development.js
Created February 28, 2017 22:42 — forked from yuroyoro/development.js
webpakcer.gemにscssのビルドを加えて、大きめの依存ライブラリを別ファイルに分けて吐くようにしたwebpack.cnofig
// Note: You must restart bin/webpack-watcher for changes to take effect
var path = require('path')
var webpack = require('webpack')
var merge = require('webpack-merge')
var config = require('./shared.js')
var devconfig = {
devtool: 'sourcemap',
@mmizutani
mmizutani / ssl_puma.sh
Created May 20, 2017 13:54 — forked from tadast/ssl_puma.sh
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@mmizutani
mmizutani / mine-open.desktop
Created May 27, 2017 14:06
#Better Errors #Rubymine #Ubuntu
[Desktop Entry]
Encoding=UTF-8
Version=1.0
Type=Application
Terminal=false
Exec=/home/max/scripts/mine-open.sh %u
Name[en_US]=MineOpen
Comment[en_US]=Small, easy-to-use program to access Rubymine
Name=MineOpen
Comment=Small, easy-to-use program to access Rubymine
@mmizutani
mmizutani / base_controller.rb
Created August 30, 2017 22:43 — forked from dhoelzgen/base_controller.rb
CORS in Rails 4 APIs
class API::V1::BaseController < ApplicationController
skip_before_filter :verify_authenticity_token
before_filter :cors_preflight_check
after_filter :cors_set_access_control_headers
def cors_set_access_control_headers
headers['Access-Control-Allow-Origin'] = '*'
headers['Access-Control-Allow-Methods'] = 'POST, GET, PUT, DELETE, OPTIONS'
@mmizutani
mmizutani / mysql.database.yml
Created September 5, 2017 22:04 — forked from jwo/mysql.database.yml
Sample config/database.yml from Rails. Postgres, MySQL, and SQLite
#
# Install the MYSQL driver
# gem install mysql2
#
# Ensure the MySQL gem is defined in your Gemfile
# gem 'mysql2'
#
# And be sure to use new-style password hashing:
# http://dev.mysql.com/doc/refman/5.0/en/old-client.html
development:
/log
/tmp
*.sqlite3