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
# | |
# Sets Prezto options. | |
# | |
# Authors: | |
# Sorin Ionescu <[email protected]> | |
# | |
# | |
# General | |
# |
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
const puppeteer = require('puppeteer'); | |
const columnify = require('columnify'); | |
const url = 'https://www.google.co.jp/'; | |
const args = process.argv.slice(2); | |
(async () => { | |
const browser = await puppeteer.launch(); | |
let results = await Promise.all(args.map(async (word) => { |
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 ruby | |
require 'open3' | |
class NmapResult | |
IP_ADDRESS_PATTERN = /\d+\.\d+\.\d+\.\d+/ | |
MAC_ADDRESS_PATTERN = /([\dA-F]{2}:){5}[\dA-F]{2}/ | |
attr_reader :lines | |
def self.parse(stdout) |
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
# (あえて境界値がうるう日前後になるように) 今日の日付が 2020/02/29 (土) だと仮定する。 | |
today = Date.parse('2020/02/29') | |
User.order(:birthday).each { |user| puts("#{user.birthday.strftime('%Y/%m/%d')} #{user.name}")} | |
# 1989/02/28 ピカチュウ | |
# 1989/03/01 カイリュー | |
# 2000/02/29 ヤドラン | |
# 2000/03/01 ピジョン | |
age_from = 20 # 20 歳から |
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
import MeCab as mc | |
from matplotlib import pyplot as plt | |
from wordcloud import WordCloud | |
def mecab_analysis(text): | |
t = mc.Tagger('-Ochasen -d /usr/local/lib/mecab/dic/mecab-ipadic-neologd/') | |
t.parse('') | |
node = t.parseToNode(text) | |
output = [] | |
while node: |
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
const puppeteer = require('puppeteer'); | |
const moment = require('moment'); | |
const today = moment(); | |
const url = 'https://www.panasonic.com/jp/corporate/history/founders-quotes.html'; | |
const titleSelector = '.h2Title'; | |
const bodySelector = '#day-after-day-content'; | |
(async () => { | |
const browser = await puppeteer.launch(); |
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
from slackbot.bot import Bot | |
from slackbot.bot import listen_to | |
import subprocess | |
import daemon | |
def main(): | |
bot = Bot() | |
bot.run() |
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
{ | |
"member_id": "JM0693349", | |
"user_id": "30588", | |
"password": "ここにパスワードを入力する" | |
} |
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
/* | |
* Kindle 版「まんがで読破」シリーズの 11 円セールで、すべての書籍を読み込んだのち 11 円の書籍だけを表示する。 | |
* 「1-Click で今すぐ買う」ボタンをクリックしても画面遷移せずに、購入後の画面が別タブで開くようにするおまけつき。 | |
* https://www.amazon.co.jp/gp/product/B07K2K2RSN?ref_=dbs_r_series&storeType=ebooks | |
*/ | |
const removeAllExcept11yen = () => { | |
Array.from(document.querySelectorAll('.a-color-price')).filter(el => el.innerText !== '¥11').forEach(el => el.closest('.series-childAsin-item').remove()); | |
}; | |
const makeSubmitButtonsOpenNewTab = () => { | |
Array.from(document.querySelectorAll('.series-childAsin-item form')).forEach(el => el.setAttribute('target', '_blank')); |
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
HANDS = { | |
0 => 'グー', | |
1 => 'チョキ', | |
2 => 'パー' | |
}.freeze | |
DRAW = 0 | |
LOSE = 1 | |
WIN = 2 |