INSERT GRAPHIC HERE (include hyperlink in image)
Subtitle or Short Description Goes Here
| $ flask run | |
| * Environment: production | |
| WARNING: This is a development server. Do not use it in a production deployment. | |
| Use a production WSGI server instead. | |
| * Debug mode: off | |
| Usage: flask run [OPTIONS] | |
| Error: While importing "app", an ImportError was raised: | |
| Traceback (most recent call last): |
| # for sending the request | |
| require "uri" | |
| require "net/http" | |
| require "json" | |
| # for loading our environment variables | |
| require "dotenv/load" | |
| # for scraping our blog | |
| require "open-uri" |
| import { fileChecksum } from 'utils/checksum' | |
| const createPresignedUrl = async(file, byte_size, checksum) => { | |
| let options = { | |
| method: 'POST', | |
| headers: { | |
| 'Accept': 'application/json', | |
| 'Content-Type': 'application/json', | |
| }, | |
| body: JSON.stringify({ |
| import CryptoJS from 'crypto-js' | |
| // Note that for larger files, you may want to hash them incrementally. | |
| // Taken from https://stackoverflow.com/questions/768268/ | |
| const md5FromFile = (file) => { | |
| // FileReader is event driven, does not return promise | |
| // Wrap with promise api so we can call w/ async await | |
| // https://stackoverflow.com/questions/34495796 | |
| return new Promise((resolve, reject) => { | |
| const reader = new FileReader() |
| class UsersController < ApplicationController | |
| def create | |
| resume = params[:pdf] | |
| params = user_params.except(:pdf) | |
| user = User.create!(params) | |
| user.resume.attach(resume) if resume.present? && !!user | |
| render json: user.as_json(root: false, methods: :resume_url).except('updated_at') | |
| end | |
| private |
| class DirectUploadController < ApplicationController | |
| def create | |
| response = generate_direct_upload(blob_params) | |
| render json: response | |
| end | |
| private | |
| def blob_params | |
| params.require(:file).permit(:filename, :byte_size, :checksum, :content_type, metadata: {}) |
| const url = 'http://localhost:3000/toys'; | |
| document.addEventListener("DOMContentLoaded", () => { | |
| const toyCollection = document.querySelector('#toy-collection') | |
| fetch(url) | |
| .then(resp => resp.json()) | |
| .then(toys => { | |
| for(const toy of toys) { | |
| const toyDiv = document.createElement('div') |
| curl 'https://q0tmlopf1j-dsn.algolia.net/1/indexes/*/queries?x-algolia-agent=Algolia%20for%20vanilla%20JavaScript%20(lite)%203.27.0%3BJS%20Helper%202.25.1&x-algolia-application-id=Q0TMLOPF1J&x-algolia-api-key=30a0c84a152d179ea8aa1a7a59374d08' -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:68.0) Gecko/20100101 Firefox/68.0' -H 'Accept: application/json' -H 'Accept-Language: en-US,en;q=0.5' --compressed -H 'content-type: application/x-www-form-urlencoded' -H 'Origin: https://www.carnegiehall.org' -H 'Connection: keep-alive' -H 'DNT: 1' -H 'Cache-Control: max-age=0, no-cache' -H 'Pragma: no-cache' --data '{"requests":[{"indexName":"sitecore-events","params":"query=&hitsPerPage=10&page=0&facets=%5B%22eventtype%22%2C%22seasonnumber%22%2C%22facilityfacet%22%2C%22genre%22%2C%22instrument%22%5D&tagFilters=&facetFilters=%5B%22eventtype%3ACarnegie%20Hall%20Presents%22%2C%22eventtype%3AFree%20Events%22%2C%22facilityfacet%3AOffsite%22%2C%5B%22facilityfacet%3AOffsite%22%5D%5D&numericFilters=%5B%22startdate%3E15724417131 |
| ForegroundColour=62,69,78 | |
| BackgroundColour=253,241,212 | |
| CursorColour=62,69,78 | |
| Black=62,69,78 | |
| BoldBlack=58,72,91 | |
| Red=102,0,0 | |
| BoldRed=128,0,0 | |
| Green=133,153,0 | |
| BoldGreen=133,153,0 | |
| Yellow=102,68,0 |