- git diff
- git grep
定番!
よく使っているコマンドを調べてみました。(とりあえず トップ20 だけ抜き出し)
$ egrep -o ';g(?:it)?\s\w*' ~/.zsh_history | cut -f 2 -d ' ' | sed -e "s/^co$/checkout/" -e "s/^st$/status/" -e "s/^lg/log/" | sort | uniq -c | sort -r
require 'rspec' | |
module HuntingMonsters | |
class Player | |
attr_reader :weapons | |
def initialize | |
@weapons = [] | |
end |
def sort_with_other_row(table, idx) | |
row = table[idx] | |
# [ソート前のカラムのインデックス値, ...] | |
ex_sort_idxs = row.map | |
.with_index { |e, idx| [e, idx] } | |
.sort_by | |
.with_index { |cell, idx| [cell.first, idx] } | |
.map(&:last) |
<!doctype html> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8"> | |
<title>カレーのレシピ</title> | |
<meta name="description" content="誰でもできる、美味しいカレーの作り方です。旦那も息子もこのカレーが大好物。"> | |
</head> | |
<body> | |
<header> | |
<h1>カレーのレシピ</h1> |
require 'minitest' | |
require 'minitest/autorun' | |
require 'pry' | |
MAX_WIDTH = 5 | |
MAX_HEIGHT = 5 | |
SENTINEL_CHER = -1 | |
def solve(str) | |
init_numbers_field(str) |
include_recipe 'yum' | |
yum_repository 'remi' do | |
baseurl "http://rpms.famillecollet.com/enterprise/#{node[:platform_version].to_i}/remi/#{node[:kernel][:machine]}/" | |
enabled false | |
gpgkey 'http://rpms.famillecollet.com/RPM-GPG-KEY-remi' | |
action :create | |
end |
include_recipe 'yum' | |
# リポジトリは http://wiki.nginx.org/Install#Official_Red_Hat.2FCentOS_packages を参考 | |
yum_repository 'nginx' do | |
baseurl "http://nginx.org/packages/centos/#{node[:platform_version].to_i}/#{node[:kernel][:machine]}/" | |
gpgcheck false | |
enabled false | |
action :create | |
end |
2015/09/04(金)〜2015/09/06(日)の期間でよちよち.rb開発合宿を開催します。 普段は忙しくてなかなか取り込むことができなかったことを各自持ち寄って、いつもとは違う環境でもくもくと取り組みに行きませんか?
2015/09/04(金)〜 2015/09/06(日)
集合場所: 20:30 JR品川駅
#coding: utf-8 | |
class Intersection | |
def to_square(p, q) | |
xs = [p[0], q[0]].min.to_i | |
xe = [p[0], q[0]].max.to_i | |
ys = [p[1], q[1]].min.to_i | |
ye = [p[1], q[1]].max.to_i | |
pos = Array.new(10, 0) | |
line = (xs..xe).inject(0) {|a, i| a + (2**i)} | |
(ys..ye).each {|y| pos[y] = line} |
{-# OPTIONS -Wall #-} | |
-- Not,And,Or,Xor を独自実装 | |
myAnd :: Bool -> Bool -> Bool | |
myAnd True True = True | |
myAnd _ _ = False | |
myNot :: Bool -> Bool | |
myNot False = True | |
myNot _ = False |