Skip to content

Instantly share code, notes, and snippets.

View lasershow's full-sized avatar

Akihiro Shimizu lasershow

View GitHub Profile
@lasershow
lasershow / sample.ipynb
Created September 8, 2018 07:54
sample.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
The MIT License (MIT)
Copyright (c) [2015] [chuck]
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@lasershow
lasershow / classify_junk_mail.ipynb
Last active September 4, 2017 08:29
迷惑メール 回答例
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@lasershow
lasershow / blog.py
Created January 24, 2017 01:40
Python基礎 〜関数まで 超簡易ブログ機能
def create(blogs):
print('1:ブログを作成する')
blog = {}
print(blog)
blog["title"] = input()
blog["content"] = input()
print(blog)
blogs.append(blog)
blogs = []
require 'mechanize'
require 'spreadsheet'
# http://qiita.com/shizuma/items/d04facaa732f606f00ff
agent = Mechanize.new
page = agent.get('https://www.tripadvisor.jp/Restaurants-g298158-Chiba_Chiba_Prefecture_Kanto.html')
anker_tags = page.search('.shortSellDetails h3 a')
restaurants_url = []
@lasershow
lasershow / file0.txt
Last active February 17, 2016 06:32
【初心者】railsのvalidatesのpresenceでエラーメッセージが重複するのを防ぐ方法 ref: http://qiita.com/lasershow/items/0229855720aaf2be5fc8
VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-.]+\.[a-z]+\z/i
validates :email, presence: true, format: {with: VALID_EMAIL_REGEX}
@lasershow
lasershow / file0.txt
Created January 29, 2016 14:14
あれっ?降順ってASC?DESC?そんな時は、reverse_orderを使ってみましょう! ref: http://qiita.com/lasershow/items/5bcefcbd6ae86a5ff202
pry(main)> Comment.all
=>
[#<
id: 1,
content: "あ">,
#<
id: 2,
content: "い">,
#<
id: 3,