Skip to content

Instantly share code, notes, and snippets.

View kostimarko's full-sized avatar

Kosti Marko kostimarko

View GitHub Profile
@kostimarko
kostimarko / script error
Created March 14, 2019 14:49
This script errors during foreach while using illustrator
var destFolder, sourceFolder, files, fileType, sourceDoc, targetFile, epsSaveOpts, doc;
sourceFolder = Folder.selectDialog( 'Select the folder with Illustrator files you want to convert to png', '~' );
if ( sourceFolder != null )
{
files = new Array();
fileType = "*.ai";
// Global Variables to use.
var destFolder, sourceFolder, files, fileType, sourceDoc, svgSaveOpts, doc, layers;
// The folder where all of the Illustrator files are.
sourceFolder = Folder.selectDialog( 'Select the folder with Illustrator files you want to convert to SVG', '~' );
// Function that sets up the exporting process
function init(){
// Check to see if sourceFolder has any files in it
function hideAllLayers(){
// Loop through doc layers and turn them off
for(var l = 0; l < doc.layers.length; l++){
doc.layers[l].visible = false;
}
}
// Work horse for exporting layers
function exportLayers(){
for(var e = 0; e< doc.layers.length; e++){
// Set the selected layer on
doc.layers[e].visible = true;
// Store layername
var layerName = doc.layers[e].name;
// Function returns a new file name
function getNewName(layerName){
// Local Variables
var docName;
// Set docName to the source doc name
docName = sourceDoc.name;
// Set newName to empty string
var newName = "";
function getSVGOptions(){
var exportOpts = new ExportOptionsSVG();
return exportOpts;
}
npm install -g firebase-tools
const functions = require("firebase-functions");
const nodemailer = require("nodemailer");
const axios = require("axios");
const moment = require("moment");
const momentTZ = require("moment-timezone");
// // Create and Deploy Your First Cloud Functions
// // https://firebase.google.com/docs/functions/write-firebase-functions
//
exports.sendEmail = functions.pubsub
.schedule("every monday, tuesday, wednesday, thursday, friday 06:45")
.timeZone("America/Chicago")
.onRun(async context => {
})
const now = moment().format("YYYYMMDD");
const mailList = [
"yourEmailAddress@gmail.com"
];
const transporter = nodemailer.createTransport({
service: "gmail",
auth: {
user: "********",
pass: "********"
}