This file contains 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
# https://history.google.com/history/ | |
# 上のリンクのギアアイコンからダウンロードできる検索履歴のzipを全て表示するやつ | |
require 'kconv' | |
require 'json' | |
require 'cgi' | |
zip_path = ARGV[0] | |
raise "Googleからダウンロードした.zipファイルを指定してください。" unless /検索-20.*\.zip/ === zip_path |
This file contains 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/ruby | |
# require: diff-lines.sh: https://gist.github.com/KenshoFujisaki/169326eb2fdde5182153 | |
# constants | |
MAX_FILE_LINES = 1000000 | |
# get args | |
unless ARGV.length == 2 | |
puts "usage: #{$0} [before_revision_hash] [after_revision_hash]" | |
puts "e.g.: #{$0} '212dfa0' '0bc3dc7'" |
This file contains 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 | |
# Ref: Using git diff, how can I get added and modified lines numbers? - Stack Overflow - | |
# http://stackoverflow.com/questions/8259851/using-git-diff-how-can-i-get-added-and-modified-lines-numbers | |
path= | |
line= | |
while read; do | |
esc=$'\033' | |
if [[ $REPLY =~ ---\ (a/)?.* ]]; then | |
continue | |
elif [[ $REPLY =~ \+\+\+\ (b/)?([^[:blank:]]+).* ]]; then |
This file contains 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
# cd [RAILS_ROOT] | |
db_name="db_name" | |
db_user="db_user" | |
db_pass="db_pass" | |
diff -U10000 \ | |
<(ls db/migrate/ | sort | ruby -nle 'print $_.split("_").first') \ | |
<(mysql -u${db_user} -p${db_pass} -D${db_name} -e"select * from schema_migrations;") |
This file contains 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
# remove | |
$ find . -name '.*.sw*' -exec rm {} \; | |
# remove interactive | |
$ find . -name '.*.sw*' -ok rm {} \; |
This file contains 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/ruby | |
require "readline" | |
message_file = ARGV[0] | |
message = File.read(message_file) | |
# コミットメッセージ確認 | |
regex_matches = /^#(\d+)/.match(message) | |
unless regex_matches |
This file contains 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
#!/opt/gitlab/embedded/bin/ruby | |
# Fix the PATH so that gitlab-shell can find git-upload-pack and friends. | |
ENV['PATH'] = '/opt/gitlab/bin:/opt/gitlab/embedded/bin:' + ENV['PATH'] | |
#!/usr/bin/env ruby | |
# This file was placed here by GitLab. It makes sure that your pushed commits | |
# will be processed properly. | |
# You can add your own hooks to this file, but be careful when updating gitlab-shell! |
This file contains 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 python | |
# -*- coding: utf-8 -*- | |
import logging | |
import sys | |
import os.path | |
import bz2 | |
from gensim.corpora import WikiCorpus | |
from gensim.corpora.wikicorpus import filterWiki |
This file contains 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
# ------------------------------------------------------------------------ | |
# svndiff | |
# ------------------------------------------------------------------------ | |
function svndiff() { | |
help() { | |
echo "Usage: svndiff [option] [filename]" | |
echo "Customize: ~/.zshrc" | |
return | |
} | |
if [ $# -eq 0 ] ; then |
NewerOlder