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
| #!/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
| 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
| $ npm install | |
| npm WARN engine xmlbuilder@2.2.1: wanted: {"node":"0.8.x || 0.10.x"} (current: {"node":"0.12.4","npm":"2.10.1"}) | |
| node-webkit-winstate@1.1.1 node_modules\node-webkit-winstate | |
| intelli-espower-loader@0.6.0 node_modules\intelli-espower-loader | |
| parse-github-event@0.2.0 node_modules\parse-github-event | |
| bluebird@2.9.27 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
| "ひらがな・カタカナ・全角アルファベットによるコマンド入力を有効にする | |
| 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
| 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
| 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
| #!/bin/sh | |
| story_id=$(git rev-parse --abbrev-ref HEAD | sed -n 's#.*stories/\([0-9]\+\).*#\1#p') | |
| if [ -n "$story_id" ]; then | |
| echo user story: https://www.pivotaltracker.com/story/show/$story_id >> $1 | |
| fi |
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
| function! GoToPreviousWindowWhenQf() abort | |
| if &filetype == 'qf' | |
| wincmd p | |
| endif | |
| endfunction | |
| let g:quickrun_config = { | |
| \ "_": { | |
| \ "outputter/quickfix/open_cmd" : "cwindow | call GoToPreviousWindowWhenQf()" | |
| \ }, | |
| \ } |
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
| " Alternative to http://vim.wikia.com/wiki/Automatic_session_restore_in_git_directories for Windows. | |
| " I created this because automatic session restore didn't work On my windows environment. | |
| " | |
| " Save a bat file to reopen the last opened files on exit. | |
| " I consulted unite.vim\plugin\unite\buffer.vim for which events to autocmd and how to handle them. | |
| if !( has('win32') || has('win64') ) | |
| finish | |
| end |