Optional - Set format on save and any global prettier options
npm i -D eslint prettier eslint-plugin-prettier eslint-config-prettier eslint-plugin-node eslint-config-node
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
| <link href="https://unpkg.com/tailwindcss@^1.0/dist/tailwind.min.css" rel="stylesheet"> | |
| <script src="https://cdn.jsdelivr.net/gh/alpinejs/[email protected]/dist/alpine.min.js" defer></script> | |
| <script src="https://cdn.jsdelivr.net/npm/axios/dist/axios.min.js"></script> | |
| <title>Alpine and axios</title> | |
| </head> |
| def is_valid_state(state): | |
| # check if it is a valid solution | |
| return True | |
| def get_candidates(state): | |
| return [] | |
| def search(state, solutions): | |
| if is_valid_state(state): | |
| solutions.append(state.copy()) |
| require 'rails_helper' | |
| RSpec.describe User, type: :model do | |
| describe 'associations' do | |
| it { should have_many(:likes).dependent(:destroy) } | |
| it { should have_attached_file(:image) } | |
| it { | |
| should validate_attachment_content_type(:image) | |
| .allowing('image/png', 'image/gif') | |
| .rejecting('text/plain', 'text/xml') |
| def do_signup(_name, _username, _email, _password) | |
| visit root_path | |
| click_button('SIGN UP') | |
| attach_file('user[image]', "#{Rails.root}/spec/files/attachment.jpeg", visible: false) | |
| find("input[placeholder='Name']").set 'hillary' | |
| find("input[placeholder='Username']").set 'hillary' | |
| find("input[placeholder='Email']").set '[email protected]' | |
| find("input[placeholder='Password']").set '123456' | |
| find("input[placeholder='Password confirmation']").set '123456' | |
| click_button('sign_up') |
An introduction to curl using GitHub's API.
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
Includes HTTP-Header information in the output