Skip to content

Instantly share code, notes, and snippets.

View scriptmaster's full-sized avatar
💭
git commit -am “… ai generated comment here …”

ScriptMaster scriptmaster

💭
git commit -am “… ai generated comment here …”
View GitHub Profile
<?php
require 'phpmailer/class.phpmailer.php';
if(empty($_POST['email']) || empty($_POST['title']) || empty($_POST['first_name']) || empty($_POST['last_name'])) return;
$mail = new PHPMailer;
$mail->isSMTP(); // Set mailer to use SMTP
// $mail->SMTPDebug = 2;
@scriptmaster
scriptmaster / vunits.js
Created November 7, 2017 06:19 — forked from LeaVerou/vunits.js
Static polyfill for vw, vh, vm units
/**
* Polyfill for the vw, vh, vm units
* Requires StyleFix from -prefix-free http://leaverou.github.com/prefixfree/
* @author Lea Verou
*/
(function() {
if(!window.StyleFix) {
return;
@scriptmaster
scriptmaster / KeystoneApiExample.md
Last active November 7, 2017 23:01 — forked from JedWatson/KeystoneApiExample.md
Example of how to scaffold API endpoints for Posts in a Keystone project (based on the yo keystone example).

This is an example of how to scaffold API endpoints to list / get / create / update / delete Posts in a Keystone website.

It's a modification of the default project created with the yo keystone generator (see https://github.com/JedWatson/generator-keystone)

Gists don't let you specify full paths, so in the project structure the files would be:

routes-index.js        -->    /routes/index.js         // modified to add the api endpoints
routes-api-posts.js    -->    /routes/api/posts.js     // new file containing the Post API route controllers