Q1. Assume that the following code must have the stated execution result.
__(1)__
x.each_line { |line| puts line }
[Execution Result]
apple
| # ... | |
| # https://github.com/exAspArk/batch-loader | |
| gem 'batch-loader' |
| require 'openssl' | |
| require 'base64' | |
| # Read the dummy file | |
| data = File.read("test.txt") | |
| # Create an encrypter | |
| cipher = OpenSSL::Cipher::AES.new(256, :CBC) | |
| cipher.encrypt | |
| key = cipher.random_key |
| cat <<EOF >> /etc/apt/sources.list | |
| deb http://archive.ubuntu.com/ubuntu precise main restricted universe | |
| deb http://archive.ubuntu.com/ubuntu precise-updates main restricted universe | |
| deb http://security.ubuntu.com/ubuntu precise-security main restricted universe multiverse | |
| EOF | |
| apt-get update | |
| apt-get remove \ | |
| apache2 \ |
| #!/bin/bash | |
| #================================================================ | |
| # Let's Encrypt renewal script for Apache/Nginx on Ubuntu/Debian | |
| # @author Erika Heidi<[email protected]> | |
| # Usage: ./le-renew.sh [base-domain-name] | |
| # More info: http://do.co/1mbVihI | |
| #================================================================ | |
| domain=$1 | |
| le_path="/opt/letsencrypt" | |
| le_conf='/etc/letsencrypt' |
| / app/views/posts/index.html.haml | |
| / Centered pagination in Bootstrap 3.x | |
| .text-center | |
| = will_paginate @posts, {:class => 'pagination', :version => :bootstrap3 } | |
| / Centered pagination in Bootstrap 2.x | |
| = will_paginate @posts, {:class => 'pagination pagination-centered', :version => :bootstrap2 } |
| // easy way to get current pages HTML | |
| $.get('#', function(html) { | |
| // emulate form post | |
| var formData = new FormData(); | |
| formData.append('out', 'json'); | |
| formData.append('content', html); | |
| // make ajax call | |
| $.ajax({ |
| / app/views/posts/_form.html.haml | |
| = simple_form_for(@post) do |f| | |
| = f.error_notification | |
| .form-inputs | |
| = f.input :title | |
| = f.input :content, :as => :text | |
| = render 'shared/recaptcha' | |
| .form-actions |