@jewel_x12 です。
最近はPHPを書いています。Niigata.pmにいたりしてました。Perlは書きません。
今後ともよろしくお願い申し上げます。
今開いているファイルがテストのファイルっぽくなかったら、テストファイルっぽいのをhelm-ls-gitの入力にする。
| function age() { | |
| if [ $# -eq 1 ]; then | |
| ag --noheading $1 | percol | sed 's/^\(.*\):\(.*\):.*/\1 +\2/' | xargs $EDITOR | |
| else | |
| echo "Usage: age QUERY" | |
| fi | |
| } | |
| // 同じアプリケーションで別のウィンドウにフォーカスする | |
| S.bind('n:alt,ctrl', function() { | |
| function get_next_win(windows) { | |
| truth_values_of_is_main = _.map(windows, function(w){ return w.isMain(); }) | |
| next_idx = _.indexOf(truth_values_of_is_main, 1) + 1; | |
| if (next_idx >= _.size(windows)) { return windows[0]; } | |
| return windows[next_idx]; | |
| } | |
| windows = []; | |
| slate.app().eachWindow(function(win){ windows.push(win); }); |
| ; Project Euler 1 | |
| (defn multiple-numbers-of-3-or-5 [] | |
| (defn whole-numbers [] (iterate inc 1)) | |
| (defn multiple-of-3-or-5? [x] | |
| (if (or (zero? (rem x 3)) | |
| (zero? (rem x 5))) | |
| true false)) | |
| (filter multiprable? (whole-numbers))) |
| (defun join-words-by-underscore () | |
| (interactive) | |
| (save-excursion | |
| (save-restriction | |
| (looking-back "[\s-\]*\\(\[a-zA-Z0-9\s-\]+\\)" nil t) | |
| (narrow-to-region (match-beginning 1) (match-end 1)) | |
| (beginning-of-line) | |
| (replace-string " " "_")))) |
| # コマンドを実行し、標準出力をlessに流す | |
| function _exec_cmd_with_less () { | |
| BUFFER+='|less' | |
| zle accept-line | |
| } | |
| zle -N _exec_cmd_with_less | |
| bindkey '^L' _exec_with_less |
| def yabai: Int = { | |
| if (1==2) 100 | |
| else throw new Exception | |
| } |
| # -*- coding: utf-8 -*- | |
| module StringsOfJewelve | |
| COLOR_NUMBERS = (0..7).to_a | |
| def to_jewelve | |
| return self.split('').map(&:to_random_colored).shuffle.join | |
| end | |
| def to_random_colored |
| # -*- coding: utf-8 -*- | |
| class Player | |
| module MovingMode | |
| def self.create(velocity) | |
| return lambda{ |direction, position| | |
| case direction | |
| when :up | |
| position[:y] -= velocity[:y] | |
| when :down | |
| position[:y] += velocity[:y] |
| // アプリにフォーカスする。アプリが起動していなければ起動する。 | |
| var launch_and_focus = function(app_name) { | |
| var launch = function(app_names, win) { | |
| if( _.any(app_names, function(name){ return name == app_name; }) ) { | |
| return; | |
| } | |
| win.doOperation( | |
| slate.operation('shell', { | |
| 'command' : '/usr/bin/open -a ' + app_name, |