@jewel_x12 です。
最近はPHPを書いています。Niigata.pmにいたりしてました。Perlは書きません。
今後ともよろしくお願い申し上げます。
今開いているファイルがテストのファイルっぽくなかったら、テストファイルっぽいのをhelm-ls-gitの入力にする。
| (defvar path-to-dayone "/usr/local/bin/dayone" | |
| "Executable path to DayOne CLI") | |
| (defun dayone-save-new-entry () | |
| "Save buffer as a new DayOne entry" | |
| (interactive) | |
| (if (executable-find path-to-dayone) | |
| (call-process-region | |
| 1 (point-max) path-to-dayone nil nil nil "new"))) |
| require 'json' | |
| probs = Hash.new { |h,k| h[k] = {} } | |
| STDIN.each do |l| | |
| d = JSON.load(l.chomp) | |
| probs[d['l']][d['r']] = (d['prob'] * 1000).to_i | |
| end | |
| def gen(probs) |
| # coding: utf-8 | |
| import random | |
| import difflib | |
| import json | |
| import csv | |
| import sort_runner as sr | |
| GAMMA = 0.8 | |
| EPSILON_INIT = 1 |
| (defun blank-line? () | |
| (string-match "^\n$" (substring-no-properties (thing-at-point 'line)))) | |
| (defun move-to-next-blank-line () | |
| (interactive) | |
| (progn (forward-line 1) | |
| (if (blank-line?) () (move-to-next-blank-line)))) | |
| (defun move-to-previous-blank-line () | |
| (interactive) |
| module ConsistentHash where | |
| import Data.Map as M | |
| import Data.List as L | |
| import Data.ByteString.Lazy.Char8 | |
| import Data.Digest.Pure.MD5 hiding (hash) | |
| type Key = String | |
| type Node = Key | |
| type Nodes = [Node] |
| 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 " " "_")))) |