This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| x | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (when (executable-find "rubocop") | |
| (defun rubocop-after-save-hook() | |
| (shell-command | |
| (format | |
| "/usr/local/var/rbenv/shims/rubocop %s" | |
| (buffer-name(current-buffer)))))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class ActiveRecord::Base | |
| def to_factory_girl | |
| ignores = %w(id created_at updated_at) | |
| array = [] | |
| array << "FactoryGirl.define do" | |
| array << " factory :#{self.class.model_name.underscore} do" | |
| attributes.each do |key, value| | |
| next if ignores.include?(key) | |
| if key =~ /_id$/ | |
| array << " association :#{key.gsub(/_id$/, '')}" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'pdf/reader' | |
| require 'bigdecimal' | |
| def pt2mm(pt) | |
| (pt2inch(pt) * BigDecimal.new("25.4")).round(2) | |
| end | |
| def pt2inch(pt) | |
| (pt / BigDecimal.new("72")).round(2) | |
| end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| find . -type f -name '*.rb' -print0 | xargs -0 sed -i '' '/^#.*coding.*[uU][tT][fF]\-8/d' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # An example hook script to verify what is about to be pushed. Called by "git | |
| # push" after it has checked the remote status, but before anything has been | |
| # pushed. If this script exits with a non-zero status nothing will be pushed. | |
| # | |
| # This hook is called with the following parameters: | |
| # | |
| # $1 -- Name of the remote to which the push is being done | |
| # $2 -- URL to which the push is being done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defvar installing-package-list | |
| '( | |
| ;; ここに使っているパッケージを書く。 | |
| ;; popwin | |
| ;; helm | |
| )) | |
| (let ((not-installed (loop for x in installing-package-list | |
| when (not (package-installed-p x)) | |
| collect x))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| class String | |
| def colorize(color_code) | |
| "\e[#{color_code}m#{self}\e[0m" | |
| end | |
| def red ; colorize(31) ; end | |
| def green ; colorize(32) ; end | |
| def yellow ; colorize(33) ; end | |
| def pink ; colorize(35) ; end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module C | |
| extend ActiveSupport::Concern | |
| module ClassMethods | |
| def c | |
| "c" | |
| end | |
| end | |
| end |