Указываем свое имя и почту
git config --global user.name "Your Name Comes Here"
git config --global user.email you@yourdomain.example.com
Делаем алиасы на команды
module HasRelations | |
module ClassMethods | |
def has_relations | |
include InstanceMethods | |
has_many :relations, :as => :from | |
end | |
end | |
module InstanceMethods | |
def related(relation_type = nil) |
# -*- coding: utf-8 -*- | |
class Ticket | |
# Дложно выполняться условие: | |
# Пары Edges[0], Edges[2] должны быть уникальны. | |
Edges = [ [ :new, :open, 'confirm' ], | |
[ :new, :closed, 'throw_away' ], | |
[ :open, :assigned, 'assign' ], | |
[ :assigned, :solved, 'solve' ], | |
[ :solved, :closed, 'close' ], | |
[ :solved, :assigned, 'assign' ], |
# autoload concerns | |
module YourApp | |
class Application < Rails::Application | |
config.autoload_paths += %W( | |
#{config.root}/app/controllers/concerns | |
#{config.root}/app/models/concerns | |
) | |
end | |
end |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Ant sim ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |
; Copyright (c) Rich Hickey. All rights reserved. | |
; The use and distribution terms for this software are covered by the | |
; Common Public License 1.0 (http://opensource.org/licenses/cpl.php) | |
; which can be found in the file CPL.TXT at the root of this distribution. | |
; By using this software in any fashion, you are agreeing to be bound by | |
; the terms of this license. | |
; You must not remove this notice, or any other, from this software. | |
;dimensions of square world |
require 'resolv' | |
class Domain | |
def mxers(domain) | |
mxs = Resolv::DNS.open do |dns| | |
ress = dns.getresources(domain, Resolv::DNS::Resource::IN::MX) | |
ress.map { |r| [r.exchange.to_s, IPSocket::getaddress(r.exchange.to_s), r.preference] } | |
end | |
return mxs |
namespace :app do | |
namespace :error_pages do | |
desc "Generates static pages 500, 403, 404, 422" | |
task :generate => :environment do | |
av = ActionView::Base.new | |
av.class_eval do | |
include ApplicationHelper | |
include Rails.application.routes.url_helpers | |
end |
# app/controllers/users/password_controller.rb | |
class Users::PasswordsController < Devise::PasswordsController | |
def resource_params | |
params.require(:user).permit(:email, :password, :password_confirmation) | |
end | |
private :resource_params | |
end |
# lib/tasks/deploy.rake | |
namespace :deploy do | |
desc 'Deploy to staging environment' | |
task :staging do | |
exec 'mina deploy -f config/deploy/staging.rb' | |
end | |
end |