Generate the user mailer class
rails generate mailer UserMailer
Define the method for sending emails
class UserMailer < ActionMailer::Base
include SendGrid
sendgrid_category :use_subject_lines
Generate the user mailer class
rails generate mailer UserMailer
Define the method for sending emails
class UserMailer < ActionMailer::Base
include SendGrid
sendgrid_category :use_subject_lines
xcode-select --install
This guide will provide you some basic steps to create a Bitnami RoR Amazon EC2 instance, using Nginx with Passenger.
Create an Amazon EC2 instance using a Community AMI. At the time of writing, the latest Bitnami AMI is: bitnami-rubystack-2.2.4-4-linux-ubuntu-14.04.1-x86_64-hvm-ebs Be careful to open SSH, HTTP and HTTPS ports on the "Step 6: Configure Security Group". You will need to save also the certificate to later connect to the instance.
Log in by SSH to the instance:
WHITELISTED_FORMATS = [ | |
{ name: 'png', first_bytes: '89 50 4E 47 0D 0A 1A 0A' }, | |
{ name: 'jpg1', first_bytes: 'FF D8 FF DB' }, | |
{ name: 'jpg2', first_bytes: 'FF D8 FF E0' }, | |
{ name: 'jpg3', first_bytes: 'FF D8 FF E1' }, | |
{ name: 'ico', first_bytes: '00 00 01 00' }, | |
{ name: 'gif1', first_bytes: '47 49 46 38 37 61' }, | |
{ name: 'gif2', first_bytes: '47 49 46 38 39 61' }, | |
{ name: 'tiff1', first_bytes: '49 49 2A 00' }, | |
{ name: 'tiff2', first_bytes: '4D 4D 00 2A' }, |
before_action :cors_set_access_control_headers | |
def cors_preflight_check | |
return unless request.method == 'OPTIONS' | |
cors_set_access_control_headers | |
render json: {} | |
end | |
protected |
#!/bin/bash | |
# usage: sh test_status_codes.sh URLs.txt | |
# example output: https://www.google.com 200 | |
# It saves all output to url_statuses.txt | |
FILENAME="$1" | |
if [ -z "$FILENAME" ]; then | |
echo "Usage: test_status_codes.sh URLs.txt" | |
exit | |
fi |
const puppeteer = require('puppeteer') | |
const express = require('express') | |
const bodyParser = require('body-parser') | |
const crypto = require('crypto') | |
const fs = require('fs') | |
const port = 3000 | |
var app = express() | |
app.use(bodyParser.json()) |
socket = new WebSocket('ws://localhost:3000/api/v1/action_cable'); | |
const onMessage = (ws, store) => evt => { | |
let msg = JSON.parse(evt.data); | |
if (msg.type === "ping") { | |
return; | |
} | |
console.log("FROM RAILS: ", msg); | |
} | |
socket.onmessage = onMessage(socket); |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>PdfLayout</title> | |
<style> | |
@page { | |
size: A4; | |
margin-top: 56px; | |
margin-bottom: 15px; | |
margin-left: 8px; |