Skip to content

Instantly share code, notes, and snippets.

View tkfm-yamaguchi's full-sized avatar

Takafumi Yamaguchi tkfm-yamaguchi

View GitHub Profile
HDD の購入後チェック:
・購入直後にSMARTのチェック。
・WDのLifeGuardツールを使って、全体を0fill。
・再度SMARTのチェック。
・WDのLifeGuardツールを使って、全体を検査。
・再度SMARTのチェック。
・クイックフォーマット後に使用開始。
http://bbs.kakaku.com/bbs/K0000186013/SortID=15423934/#tab
@tkfm-yamaguchi
tkfm-yamaguchi / git.hist.regit.sh
Created January 31, 2014 16:45
history command of git
# git config --global alias.hist "log --graph --all --color --date=short --pretty='%x09%ad %Cgreen%h%Creset %cn%x09%s %Cred%d%Creset'"
# git config --global alias.hist "log --graph --all --color --date=short --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%aN>%Creset'"
git config --global alias.hist "log --graph --all --color --date=short --pretty=format:'%Cred%h%Creset %C(bold blue)|%aN| %Creset%s%C(yellow)%d%Creset'"
git config --global alias.history "log --graph --all --color --date=short --pretty=format:'%Cred%h%Creset %C(bold blue)|%aN| %Creset%s%C(yellow)%d%Creset %Cgreen(%cr)'"
require 'open-uri'
require 'nokogiri'
$stdout.sync = true
def download(page=1)
url = "https://github.com/boxen?page=#{page}"
charset = ""
html = open(url) do |f|

This sometimes happens when I open the file into new buffer.

function gitgutter#gitgutter..<SNR>204_repo_type_of_file..gitgutter#git#is_in_a_repo..vimproc#system..<SNR>276_system..vimproc#pgroup_open..<SNR>276_pgroup_open..vimproc#plineopen3..<SNR>276_plineopen..vimproc#fopen..<SNR>276_vp_file_open..<SNR>276_libcall, 行 16
vimproc: vp_file_open: ['open() error: 入力/出力エラーです']
Error occured while executing action!
Action name is open
cat Rails.gitignore \
Ruby.gitignore \
Global/Emacs.gitignore \
Global/Linux.gitignore \
Global/OSX.gitignore \
Global/SASS.gitignore \
Global/vim.gitignore > gitignore
@tkfm-yamaguchi
tkfm-yamaguchi / middleman_ext.rb
Last active August 29, 2015 13:56
This lets middleman's `url_for` see the locale parameter even if `relative_url` option is true.
# coding: utf-8
module MiddlemanExt
module Util
def self.included(base)
base.send :include, ClassMethods
base.send :alias_method, :url_for_without_locale, :url_for
base.send :alias_method, :url_for, :url_for_with_locale
end
[1] pry(main)> require 'rspec/mocks/standalone'
=> true
[2] pry(main)> class A; def m; "a" ; end; end
=> :m
[3] pry(main)> class B < A; def m; super + "b"; end; end
=> :m
[4] pry(main)> A.any_instance.stub(:m).and_return("c")
=> #<RSpec::Mocks::AnyInstance::StubChain:0x007fa8eba258f0
@expectation_args=[:m],
@expectation_block=nil,

圧縮->転送->解凍の比較

準備

ダミーファイルの作成

$ dd if=/dev/zero of=dammy1g bs=1024M count=1
sudo mount -t cifs //<SmbServerName>/share TmpSrv -o username=me,iocharset=utf8,defaults
sudo umount TmpSrv
  • cifs-utils が必要
    • smbfs は obsoleted
  • cifs では codepage オプションがなくなっている
  • kernel: [88450.269004] CIFS: Unknown mount option "codepage=cp932" @ syslog
#compdef tmuxinator mux
# zsh completion for tmuxinator
# Install:
# $ mkdir -p ~/.tmuxinator/completion
# $ cp _tmuxinator ~/.tmuxinator/completion
# $ vi ~/.zshrc # add the following codes
# fpath=($HOME/.tmuxinator/completion ${fpath})
# autoload -U compinit