An introduction to curl using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
| echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
| . ~/.bashrc | |
| mkdir ~/local | |
| mkdir ~/node-latest-install | |
| cd ~/node-latest-install | |
| curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
| ./configure --prefix=~/local | |
| make install # ok, fine, this step probably takes more than 30 seconds... | |
| curl https://www.npmjs.org/install.sh | sh |
| # WAIT! Do consider that `wait` may not be needed. This article describes | |
| # that reasoning. Please read it and make informed decisions. | |
| # https://www.varvet.com/blog/why-wait_until-was-removed-from-capybara/ | |
| # Have you ever had to sleep() in Capybara-WebKit to wait for AJAX and/or CSS animations? | |
| describe 'Modal' do | |
| should 'display login errors' do | |
| visit root_path |
| class FilterAuth < ::Rack::Auth::Basic | |
| def initialize(app, options = { }, realm=nil, &authenticator) | |
| super(app, realm, &authenticator) | |
| @ip_filter = ::Rack::Access.new(app, options) | |
| end | |
| def call(env) | |
| # only need to do auth if the ip filter blocks the request | |
| response = @ip_filter.call(env) |
An introduction to curl using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
基礎知識
読み物系
| puts "1年は#{365 * 24}時間です" | |
| puts "10年間は#{60 * 24 * 365 * 10}分です" | |
| puts "生まれてから#{Time.new - Time.mktime(1986, 1, 1)}秒経っている" | |
| puts "80年生きるとして、#{(80 * 365) / 7}枚ぐらいかな" | |
| puts "10億3400万秒生きてるとしたら#{1034000000 / 60 / 60 / 24 / 365}歳" |
| <!DOCTYPE html> | |
| <html lang="ja"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>カレーのレシピ</title> | |
| </head> | |
| <body> | |
| <h1>カレーのレシピ</h1> |