Skip to content

Instantly share code, notes, and snippets.

<?php
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require '../extras/PHPMailer/src/Exception.php';
require '../extras/PHPMailer/src/PHPMailer.php';
require '../extras/PHPMailer/src/SMTP.php';
$mail = new PHPMailer;
@RocketFever22
RocketFever22 / models.js
Last active July 14, 2020 06:04
A simple way to approach routing in express.js
// This file should be in routes/models.js
const routes = require('express').Router();
const data = require('../data.json');
routes.get('/', (req, res) => {
res.status(200).json(data.models);
});
routes.get('/:modelId', (req, res) => {
@RocketFever22
RocketFever22 / LaravelDuskSteps
Last active April 27, 2017 18:16
Laravel/Dusk instal step by step summary
This is a step by step summary of:
https://laravel.com/docs/5.4/dusk
1. $ composer require laravel/dusk
2. $ php artisan make:provider DuskServiceProvider
3. Inside app/Providers/DuskServiceProvider, register() method:
if ($this->app->environment('local', 'testing')) {
$this->app->register(DuskServiceProvider::class);
}
4. app/config/app.php -> providers array:
@RocketFever22
RocketFever22 / autoheight.css
Created April 21, 2017 18:47
Animate height to 100% of content
.section {
overflow:hidden;
height:auto;
transition:max-height 0.3s ease-out; // max-height animation
max-height:100px; // still have to hard-code a value
}
.section.collapsed {
max-height: 600px;