Skip to content

Instantly share code, notes, and snippets.

View availit's full-sized avatar

Aaron Vail availit

View GitHub Profile
const transporter = nodemailer.createTransport({
service: 'SendinBlue', // no need to set host or port etc.
auth: {
user: 'YOUR EMAIL',
pass: 'API KEY'
}
});
// Read more on the usage of Nodemailer package here: https://nodemailer.com/usage/
const Cosmic = require('cosmicjs')();
const database = Cosmic.bucket({
slug: 'YOUR BUCKET SLUG',
write_key: 'YOUR BUCKET WRITE KEY',
read_key: 'YOUR BUCKET READ KEY'
})
export default database
@availit
availit / ie-supported-new-me-carousel.markdown
Created November 20, 2018 17:13
IE supported New ME Carousel
@availit
availit / cloudflare-worker-force-lowercase.js
Created October 29, 2018 21:18
Cloudflare worker script to rewrite requests to lowercase, to prevent duplicate page URLs
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
/**
* Fetch and log a request
* @param {Request} request
*/
async function handleRequest(request) {
let url = request.url
@availit
availit / gist:fe868ee679653cf93b03ed0a7b2a143e
Last active October 23, 2018 21:04 — forked from ayamflow/gist:b602ab436ac9f05660d9c15190f4fd7b
Safari border-radius + overflow: hidden + CSS transform fix
// Add on element with overflow
-webkit-mask-image: -webkit-radial-gradient(white, black);
// or translate3d
-webkit-backface-visibility: hidden;
-moz-backface-visibility: hidden;
-webkit-transform: translate3d(0, 0, 0);
-moz-transform: translate3d(0, 0, 0);
@availit
availit / jQueryLightboxDemo.html
Created August 6, 2018 21:24
Demo for a jQuery plugin for creating responsive and touch enabled image galleries
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Lightbox Plugin Demo</title>
<!-- LINK TO REQUIRED PLUGIN CSS FILE -->
<link href='https://www.jqueryscript.net/demo/Responsive-Touch-enabled-jQuery-Image-Lightbox-Plugin/dist/simplelightbox.min.css' rel='stylesheet' type='text/css'>
<!-- LINK TO CUSTOM CSS -->
<link href='https://www.jqueryscript.net/demo/Responsive-Touch-enabled-jQuery-Image-Lightbox-Plugin/demo.css' rel='stylesheet' type='text/css'>
</head>
// set trigger time using https://www.epochconverter.com/ (know the trigger time in GMT)
triggerTime(1496300400000);
function run_script (){
// put your logic here
}
// No need to alter any of this.
function triggerTime(trigger) {
var now = new Date().getTime();
@availit
availit / epoch-trigger.js
Created October 11, 2017 15:42
jQuery Epoch Timestamp Trigger
// set trigger time using https://www.epochconverter.com/ (know the trigger time in GMT)
triggerTime(1496300400000);
function run_script (){
// put your logic here
}
// No need to alter any of this.
function triggerTime(trigger) {
var now = new Date().getTime();