- src/main/scala/Main.scala
object Main {
def main(args: Array[String]): Unit = {
println("hello scala!")
source "https://rubygems.org" | |
gem "google-api-client", "0.8.6" | |
gem "pry" | |
gem "oauth2" |
# これを config/application.rb 内にコペピする | |
# 参考: http://guides.rubyonrails.org/generators.html#customizing-your-workflow-by-changing-generators-templates | |
config.generators do |g| | |
g.controller helper: false, assets: false | |
g.rspec view_specs: false, helper_specs: false | |
end |
require 'formula' | |
class Grep < Formula | |
url 'http://ftp.gnu.org/gnu/grep/grep-2.18.tar.xz' | |
sha1 'fdb12580714966745635da7d9db55060f88db28b' | |
version '2.18' | |
depends_on 'pcre' | |
def install |
require 'active_support/core_ext' | |
require 'minitest/unit' | |
String.instance_eval do | |
define_method :method_missing do |method, *args| | |
ActiveSupport::StringInquirer.new(self).send(method) | |
end | |
end | |
Symbol.instance_eval do |
class User < ActiveRecord::Base | |
include ValidationContext | |
with_context :first do |context| | |
context.validates_presence_of :name | |
end | |
with_context :second do |context| | |
context.validates_presence_of :email | |
end |
--- | |
- name: ensure required packages are installed for Java 7 | |
apt: name=$item state=latest update_cache=yes | |
with_items: | |
- python-software-properties | |
- name: Add Java repository to sources | |
action: apt_repository repo='ppa:webupd8team/java' |
OmniAuth.config.full_host = ->(env) { | |
scheme = if env['HTTPS'] == 'on' or env['HTTP_X_FORWARDED_SSL'] == 'on' | |
'https' | |
elsif env['HTTP_X_FORWARDED_PROTO'].present? | |
env['HTTP_X_FORWARDED_PROTO'].split(',').first.strip | |
else | |
env['rack.url_scheme'] | |
end | |
hostname = env['HTTP_X_FORWARDED_HOST'].present? ? env['HTTP_X_FORWARDED_HOST'] : env['HTTP_HOST'] |
31年、人生で生きてきて一人暮らし歴が長く、避けたほうが良い物件は以下の形になる
class User < ActiveRecord::Base | |
has_secure_password validations: false | |
validates :password, | |
presence: {if: :password_required?, on: :create}, | |
confirmation: {if: :password_required?} | |
validates :password_confirmation, | |
presence: {if: :password_present?} |