facebook.com/dtw.hello
A Pen by Constantine on CodePen.
| 'use strict'; | |
| const puppeteer = require('puppeteer'); | |
| async function scrapeLinks(destination) { | |
| const browser = await puppeteer.launch({headless: true}); | |
| const page = await browser.newPage(); | |
| await page.goto(destination); | |
| <div class="keys"> | |
| <div data-key="65" class="key"> | |
| <kbd>A</kbd> | |
| <span class="sound">good evening</span> | |
| </div> | |
| <div data-key="83" class="key"> | |
| <kbd>S</kbd> | |
| <span class="sound">just a man</span> | |
| </div> | |
| <div data-key="68" class="key"> |
| exports.getGizmos = async (req, res) => { | |
| const gizmos = await Gizmo.find().catch(next); | |
| res.json(gizmos); | |
| }; |
| // GENERAL WORKFLOW MANAGER ************************* | |
| // Helping you automate the start of a new work ticket and moving | |
| // the relevant files to preproduction & production. | |
| const gulp = require('gulp'), | |
| open = require('gulp-open'), | |
| fs = require('fs') |
| const request = require('request'); | |
| const fs = require('fs'); | |
| request.get('https://sytantris.github.io/http-examples/future.jpg') | |
| .on('error', (err) => { throw err }) | |
| .on('data', (data) => console.log( 'Downloading ...', data.length )) | |
| .on('response', (res) => { | |
| let body = ""; | |
| body += 'status: ' + res.statusCode; | |
| body += '\nmessage: ' + res.statusMessage; |
| CarrierWave.configure do |config| | |
| config.fog_provider = 'fog/aws' | |
| config.fog_credentials = { | |
| provider: 'AWS', | |
| aws_access_key_id: ENV['AWS_SECRET_KEY_ID'], | |
| aws_secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'], | |
| region: 'eu-west-1' | |
| } | |
| config.fog_directory = 'credible-images' | |
| config.fog_public = false |
| class AvatarUploader < CarrierWave::Uploader::Base | |
| # Include RMagick or MiniMagick support: | |
| include CarrierWave::RMagick | |
| # include CarrierWave::MiniMagick | |
| process resize_to_fit: [200, 200] | |
| # Choose what kind of storage to use for this uploader: | |
| # storage :file | |
| storage :fog |
| class AddAssociationsToReview < ActiveRecord::Migration[5.1] | |
| def change | |
| add_reference :reviews, :author, foreign_key: true | |
| add_reference :reviews, :receiver, foreign_key: true | |
| add_reference :reviews, :catagory, foreign_key: true | |
| end | |
| end |
| class CreateUsers < ActiveRecord::Migration[5.1] | |
| def change | |
| create_table :users do |t| | |
| t.string :first_name | |
| t.string :last_name | |
| t.string :email | |
| t.string :password_digest | |
| t.string :username | |
| t.boolean :admin | |
facebook.com/dtw.hello
A Pen by Constantine on CodePen.