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
| RSpec.configure do |c| | |
| c.example_status_persistence_file_path = "./tmp/rspec-example-status.txt" | |
| 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
| require 'tempfile' | |
| require 'fileutils' | |
| def insert path, start_line, data | |
| pid = Process.pid.to_s | |
| Tempfile.create pid, File.dirname(path) do|temp| | |
| File.open(path) do|input| | |
| start_line.times do | |
| if line = input.gets | |
| temp.write line |
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
| "ひらがな・カタカナ・全角アルファベットによるコマンド入力を有効にする | |
| noremap あ a | |
| noremap い i | |
| noremap う u | |
| noremap え e | |
| noremap お o | |
| noremap ア a | |
| noremap イ i | |
| noremap ウ u | |
| noremap エ e |
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
| $ npm install | |
| npm WARN engine [email protected]: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"0.12.4","npm":"2.10.1"}) | |
| [email protected] node_modules\node-webkit-winstate | |
| [email protected] node_modules\intelli-espower-loader | |
| [email protected] node_modules\parse-github-event | |
| [email protected] node_modules\bluebird |
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
| data:text/html,<html contenteditable><script>window.onbeforeunload = function(){ return 'Close window?'; }</script> |
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/bash | |
| current_branch=$(git rev-parse --abbrev-ref HEAD) | |
| warn_branch() { | |
| echo "You can't commit on '$current_branch'!" | |
| } | |
| case $current_branch in | |
| master) warn_branch; exit 1 ;; # Of cource you can add any other important branches as you need. |
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 'strscan' | |
| =begin | |
| 神奈川Ruby会議01のペアプロ問題から。 http://nabetani.sakura.ne.jp/kanagawa.rb/evalex/ | |
| ちょうど今読んでいる http://www.amazon.co.jp/Programming-Principles-Practice-Using-Edition/dp/0321992784 | |
| に電卓を作る例があったので、ほとんど写経するような形で書いてみた。 | |
| 書いておきながら細かいところをちゃんと説明できないので途中まで書いていてすごく不安だった... | |
| =end | |
| Token = Struct.new(:kind, :string) |
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
| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
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/ruby | |
| # -*- coding: utf-8 -*- | |
| # GistID: 6203578 | |
| =begin | |
| Rubyのリファレンスマニュアル( http://doc.ruby-lang.org/ja/2.0.0/doc/spec=2fdef.html#alias ) | |
| 「別名を付けられたメソッドは、その時点でのメソッド定義を引き継ぎ、元のメソッドが再定義されても、 | |
| 再定義前の古いメソッドと同じ働きをします。あるメソッドの動作を変え、 | |
| 再定義するメソッドで元のメソッドの結果を利用したいときなどに利用されます。」 | |
| の通り、 |