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 'mechanize' | |
| require 'twitter' | |
| require 'oauth' | |
| require 'dotenv' | |
| class RestClient | |
| KEY_FILE_NAME = 'key' | |
| TOKEN_FILE_NAME = '.token' | |
| def initialize |
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 'niconico' | |
| require 'mechanize' | |
| require 'benchmark' | |
| require 'dotenv' | |
| class NicoDown | |
| def initialize | |
| Dotenv.load | |
| @nico = Niconico.new(ENV['NICO_USER'], ENV['NICO_PASS']) | |
| @mech = Mechanize.new |
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 'dotenv' | |
| require 'mechanize' | |
| Dotenv.load | |
| mech = Mechanize.new | |
| mech.user_agent_alias = 'Windows IE 7' | |
| url = 'https://web.ib.mizuhobank.co.jp/servlet2/CASBNK60000B.do' | |
| page = mech.get(url) | |
| if page.form.nil? |
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 'mechanize' | |
| require 'open-uri' | |
| $file = 'article_list' | |
| $amember_file = 'amember_article_list' | |
| def main | |
| print 'Enter target ameba id: ' | |
| target = gets.chomp | |
| print 'And archive from amember article? ' |
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 'mechanize' | |
| require 'dotenv' | |
| require 'date' | |
| class AmebaNow | |
| BASE_URL = 'http://now.ameba.jp' | |
| LIMIT = 10 | |
| def initialize | |
| print 'Enter ameba 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
| alias ..='cd ..' | |
| alias ...='cd ../..' | |
| alias ....='cd ../../..' | |
| alias cd..='cd ..' | |
| alias cp='cp -irv' | |
| alias du='du -h --max-depth=1' | |
| alias ll='ls -FGahl --show-control-chars --color=always' | |
| alias ls='ls -AF --show-control-chars --color=always' | |
| alias md='mkdir -p' | |
| alias mv='mv -iv' |
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
| # inspired by: https://speakerdeck.com/jmatsu/git-and-sierusukuriputo | |
| GITHUB_USERNAME="qtik" | |
| LF=$'\\\x0A' | |
| function git_ig(){ | |
| gibo -l | tr '\t', '\n' | sed -e '/^$/d' | sort | sed -e '1,2d' | peco --prompt "Select Language >" | xargs gibo >> .gitignore | |
| } | |
| function git_license(){ | |
| curl -H "Accept: application/vnd.github.drax-preview+json" -X GET https://api.github.com/licenses | jq ".[].url" | peco --prompt "Select License >" | sed -e "s/\"//g" | xargs -J % curl -H "Accept: application/vnd.github.drax-preview+json" -X GET % | jq ".body" | sed -e 's/^\"//' | sed -e 's/\"$//' | sed -e 's/\\\"/\"/g' | sed -e 's/\\n'/"$LF"'/g' > LICENSE |
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
| ruby -rmechanize -e 'm=Mechanize.new;m.get "https://ja.wikipedia.org/wiki/%E5%85%A8%E5%9B%BD%E3%83%9D%E3%82%B1%E3%83%A2%E3%83%B3%E5%9B%B3%E9%91%91%E9%A0%86%E3%81%AE%E3%83%9D%E3%82%B1%E3%83%A2%E3%83%B3%E4%B8%80%E8%A6%A7";puts "("+m.page.search("table")[0].css("td/a").map{|a|a.text}.join("|")+")";' |
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
| for f in test/*.in ; do ; diff <(cat $f | ./a.out) ${f%.in}.out ; done |
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 bash | |
| MACHINE=default | |
| IMAGE=texlive2015 | |
| if docker-machine ls | grep $MACHINE | grep -q "Runnning"; then | |
| docker-machine start $MACHINE | |
| fi | |
| docker ps 2> /dev/null | |
| if [ $? -ne 0 ]; then | |
| eval $(docker-machine env $MACHINE) |
OlderNewer