Skip to content

Instantly share code, notes, and snippets.

View acoyfellow's full-sized avatar
🤖
Building

Jordan Coeyman acoyfellow

🤖
Building
View GitHub Profile
import * as functions from "firebase-functions";
import * as firebase from "firebase-admin";
import {MD5} from "crypto-js";
export const createUserDoc = functions.auth.user().onCreate(event => {
const firebaseUser = event.data;
// Use gravatar as default if photoUrl isn't specified in user data
const gravatarHash = MD5(firebaseUser.email).toString().toLowerCase();
let photoURL = `https://www.gravatar.com/avatar/${gravatarHash}.jpg?s=1024&d=robohash`;
@acoyfellow
acoyfellow / example.html
Created June 13, 2018 15:01
Example of how to embed a .PDF into PhoneSites
<object data="https://go.optkit.com/docs/MarketingSalesFunnelMarketing101QA.pdf" type="application/pdf" width="100%" height="600px">
<p>
This browser does not support PDFs. Please download the PDF to view it: <a href="https://go.optkit.com/docs/MarketingSalesFunnelMarketing101QA.pdf">Download PDF</a>.
</p>
</object>
@acoyfellow
acoyfellow / affiliate-cookie.html
Last active June 18, 2018 21:50
Affiliate parameter into cookies
@acoyfellow
acoyfellow / custom_infusionsoft_snippet.html
Last active July 14, 2018 11:21
For trial sales page. Will inject + lock down any form field that is sent in through the URL (by the input ID)
<script>
function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
@acoyfellow
acoyfellow / example.html
Created July 26, 2018 17:17
How to add hidden fields into PhoneSites forms (add to your Tracking section)
<script>
var hiddenFields= [ // customize these.
{name: 'name1', id: 'id1', value: 'value1' },
{name: 'name2', id: 'id2', value: 'value2' },
];
var formCheck = setInterval(myTimer, 100);
function myTimer() {
if(form && form.noValidate){
@acoyfellow
acoyfellow / affScript.js
Created August 16, 2018 20:02
PhoneSites affiliate script
<script>
function getParameterByName(name, url) {
if (!url) url = window.location.href;
name = name.replace(/[\[\]]/g, "\\$&");
var regex = new RegExp("[?&]" + name + "(=([^&#]*)|&|#|$)"),
results = regex.exec(url);
if (!results) return null;
if (!results[2]) return '';
return decodeURIComponent(results[2].replace(/\+/g, " "));
};
@acoyfellow
acoyfellow / index.js
Created September 15, 2018 13:36
CORS Node.js Google Cloud Function for returning Header information
const cors = require('cors')({origin: true});
exports.getHeaders= (req, res) => {
cors(req, res, () =>
res.status(200).send({ ...req.headers })
);
};
@acoyfellow
acoyfellow / example.json
Last active September 15, 2018 13:42
Example Response from CORS Node.js Google Cloud Function for returning Header information
{
"host":"us-central1-yourproject-prod.cloudfunctions.net",
"user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36",
"accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
"accept-language":"en-US,en;q=0.9,it;q=0.8",
"function-execution-id":"j02ssy1gb5ie",
"if-none-match":"W/\"44c-292EXCcJFqodAMVEau5YE7bcts8\"",
"upgrade-insecure-requests":"1",
"x-appengine-api-ticket":"476fbc0730996f5f",
"x-appengine-city":"philadelphia",
@acoyfellow
acoyfellow / style.html
Last active September 28, 2018 00:59
PhoneSites BG image + color snippet
<style>
body > div{
background: rgba(0, 0, 0, 0.7);
}
body{
background-image: url("http://i68.tinypic.com/2mo7220.jpg");
height: 100%;
background-repeat: repeat;
background-position: center;
background-attachment: fixed;
<style>
body{
background-color: #000000;
background-image: url(https://firebasestorage.googleapis.com/v0/b/phonesites-prod.appspot.com/o/images%2FFRgtdbw6sIPmGD8MKYGGMCW6FHI2%2F1538227506873*background*jpg?alt=media&token=d17f4104-005f-4d4a-8d27-ae7ffb73eb99);
background-size: cover;
background-position: center;
}
body > div{
background: rgba(0, 0, 0, 0.81);
border-radius: 1rem;