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 'uri' | |
require 'mechanize' | |
start_url = ARGV[0] || 'https://wikiwiki.jp/kancolle/%E8%89%A6%E5%A8%98%E3%82%AB%E3%83%BC%E3%83%89%E4%B8%80%E8%A6%A7' | |
agent = Mechanize.new | |
index_page = agent.get(start_url) | |
uri = URI.parse(start_url) | |
vessels = [] |
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
;; highlight-indent | |
(require 'highlight-indent-guides) | |
(setq highlight-indent-guides-method 'column) | |
(setq highlight-indent-guides-auto-enabled t) | |
(setq highlight-indent-guides-responsive 'top) | |
(add-hook 'ruby-mode-hook 'highlight-indent-guides-mode) |
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
# set CircleCI token to $CIRCLECI_TOKEN | |
function ci-rebuild () { | |
BUILDID=$(curl -s "https://circleci.com/api/v1/recent-builds?circle-token=$CIRCLECI_TOKEN" |jq -r '.[] | "\(.username)/\(.reponame)/\(.build_num) \(.subject)"' | peco | cut -f 1 -d ' ') | |
if test "${BUILDID}" != ""; then | |
curl -X POST "https://circleci.com/api/v1/project/$BUILDID/retry?circle-token=$CIRCLECI_TOKEN" | |
fi | |
} | |
zle -N ci-rebuild |
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
query_params = [['pochi', 'dog', 'black'], ['tama', 'cat', 'mike'], ['baron', 'horse', 'kurige']] | |
placeholder = query_params.map { (?, ?, ?) } | |
args = ["SELECT id FROM animals WHERE (name, race, color) IN (#{placeholder})", *query_params] | |
ids = ActiveRecord::Base.connection.select_all(ActiveRecord::Base.send(:sanitize_sql_array, args)).map {|x| x['id'] } |
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 'yaml' | |
def stringify(hash, prefix = nil) | |
hash.map { |k, v| | |
scope = prefix ? "#{prefix}.#{k}" : k | |
if v.is_a?(Hash) | |
stringify v, scope | |
else | |
"#{scope}: #{v}" | |
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
@searchForm = (trigger) -> | |
field = $($(trigger).data('field')) | |
opts = {} | |
opts[field.attr('name')] = field.val() | |
$(field).on 'input', () => | |
opts[field.attr('name')] = field.val() | |
$(trigger).on 'click', () => | |
$.ajax({ |
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
diff -Nrc emacs-24.4.orig/configure.ac emacs-24.4/configure.ac | |
*** emacs-24.4.orig/configure.ac 2014-10-13 09:14:08.000000000 +0900 | |
--- emacs-24.4/configure.ac 2014-11-03 16:08:44.000000000 +0900 | |
*************** | |
*** 1782,1788 **** | |
INSTALL_ARCH_INDEP_EXTRA= | |
fi | |
! NS_OBJC_OBJ="nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o $macfont_file" | |
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
# Commands: | |
# p, pick = use commit | |
# r, reword = use commit, but edit the commit message | |
# e, edit = use commit, but stop for amending | |
# s, squash = use commit, but meld into previous commit | |
# f, fixup = like "squash", but discard this commit's log message | |
# x, exec = run command (the rest of the line) using shell |
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 | |
date=`date "+%Y%m%d-%H%M%S"` | |
branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') | |
host=`hostname -s` | |
git checkout -b "wip-${date}" | |
git add . | |
git add -u |
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 peco-kill () { | |
kill $(ps aux | peco --query "$LBUFFER" | awk '{ print $2 }') | |
} | |
zle -N peco-kill | |
alias pk="peco-kill" |
NewerOlder