- ひがき まさる
- マッパー歴 3ヶ月
- mas_higa
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
| def jangkeng(you, comp) | |
| (you - comp + 4) % 3 - 1; | |
| end | |
| rock, paper, scissors = 0, 1, 2 | |
| win, lose, draw = 1, -1, 0 | |
| matches = [ | |
| # [you, comp, judge] |
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
| ;; load path | |
| (defun add-to-load-path (&rest paths) | |
| (let (path) | |
| (dolist (path paths paths) | |
| (let ((default-directory | |
| (expand-file-name (concat user-emacs-directory path)))) | |
| (add-to-list 'load-path default-directory) | |
| (if (fboundp 'normal-top-level-add-subdirs-to-load-path) | |
| (normal-top-level-add-subdirs-to-load-path)))))) |
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 Array | |
| def name | |
| self[0] | |
| end | |
| def left | |
| self[1] | |
| end | |
| def right |
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 'minruby' | |
| class Array | |
| def op; self[0] end | |
| def left; self[1] end | |
| def right; self[2] end | |
| def leaf? | |
| op == "lit" | |
| 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
| 「設定」-「時刻と言語」-「地域と言語」-「日付、時刻、地域の追加設定」-「言語」-「オプション」-「Microsoft IME オプション」-「詳細設定」-「全般」-「編集操作」-「キー設定」を | |
| - 「Microsoft IME」 | |
| + 「IME Standard」 |
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
| error_prompt() { | |
| local e=$? | |
| tput sc | |
| printf "%*s" $COLUMNS $e | |
| tput rc | |
| return $e | |
| } | |
| PS1='\[$(error_prompt)\]\h$ ' |
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 | |
| require 'date' | |
| module Schedule | |
| def print(contents, start_time, talkers = {}) | |
| end_time = start_time | |
| contents.each do |talk| | |
| talk.start_time = end_time | |
| end_time = talk.end_time |
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 | |
| require 'nokogiri' | |
| html = Nokogiri::XML(open ARGV[0]) | |
| def schedules(html, date, hall) | |
| title = "schedule-item__title" | |
| speaker = "schedule-item-speaker" | |
| xpath = %|//div[@id="%s"]//tbody//td[%d]//div[@class="%s"]| |
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 | |
| require 'open-uri' | |
| module OSRK01 | |
| def self.url venue | |
| q = "%s (肥後橋|うつぼ|靭公園|靱公園)" % venue | |
| "https://www.google.com/search?hl=ja&q=#{URI.encode_www_form_component q}" | |
| end |