This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable no-console */ | |
import getFolderSize from 'get-folder-size'; | |
async function checkCost() { | |
const myFolder = 'dist'; // your prod assets folder: can be folder or zip file | |
const size = await getFolderSize.loose(myFolder); | |
console.log(`The project is ${size} bytes large`); | |
console.log(`Cost: ${675 * size * 10 * (1 / 1000000000)}Eth at 10Gwei`); | |
console.log(`Cost: ${675 * size * 50 * (1 / 1000000000)}Eth at 50Gwei`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "mock package.json project", | |
... | |
"scripts": { | |
"screenshots": "node screenshots.mjs" | |
}, | |
... | |
"devDependencies": { | |
"puppeteer": "^10.1.0" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Standard Smooth scroll JS - I know kinda verbose D.S. | |
(function() { | |
'use strict'; | |
// Feature Test | |
if ('querySelector' in document && 'addEventListener' in window && Array.prototype.forEach) { | |
// Function to animate the scroll | |
var smoothScroll = function(anchor, duration) { | |
// Calculate how far and how fast to scroll | |
var startLocation = window.pageYOffset; | |
var endLocation = anchor.offsetTop; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// if you want to function for location later on you can use the $loc var and uncomment the if (if arr_key) code below | |
function showJobvite(){ | |
/* Jobvite url to start with: Update your Job api key and secret, we start by filtering open and externally facing jobs */ | |
$url = "https://api.jobvite.com/api/v2/job?api=company_jobfeedapi_key&sc=secretKey&jobStatus=Open&availableTo=External&callback=?"; | |
// Initiate curl | |
$ch = curl_init(); | |
// Disable SSL verification |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Taken from http://developers.marketo.com/blog/restrict-free-email-domains-on-form-fill-out/ | |
// Prepared by Ian Taylor and Murtza Manzur on 9/9/2014 - Modified Dillan Simmons 8/15/17 | |
(function (){ | |
// Please include the email domains you would like to block in this list | |
var invalidDomains = ["@gmail.","@yahoo.","@hotmail.","@live.","@aol.","@outlook.","@test."]; | |
MktoForms2.whenReady(function (form){ | |
form.onValidate(function(){ | |
var email = form.vals().Email; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JS for grabbing utm params and parsing into url | |
var getRefQueryParam = function() { | |
var temp = {}; | |
document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g, function() { | |
var decode = function(s) { | |
return decodeURIComponent(s.split("+").join(" ")); | |
}; | |
temp[decode(arguments[1])] = decode(arguments[2]); | |
}); | |
return temp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JS for grabbing utm params | |
var getRefQueryParam = function() { | |
var temp = {}; | |
document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g, function() { | |
var decode = function(s) { | |
return decodeURIComponent(s.split("+").join(" ")); | |
}; | |
temp[decode(arguments[1])] = decode(arguments[2]); | |
}); | |
return temp; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
UPDATE wp_options SET option_value = replace(option_value, 'http://olddomain.com', 'http://newdomain.com') WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, 'http://olddomain.com','http://newdomain.com'); | |
UPDATE wp_posts SET post_content = replace(post_content, 'http://olddomain.com', 'http://newdomain.com'); | |
UPDATE wp_postmeta SET meta_value = replace(meta_value, 'http://olddomain.com', 'http://newdomain.com'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Load the Google reCAPTCHA API : Make sure it loads somewhere above the insert code--> | |
<script src="https://www.google.com/recaptcha/api.js" async defer></script> | |
*/ | |
/* Main code that inserts the reCAPTCHA into the marketo form */ | |
// Wait for Marketo form to load | |
MktoForms2.whenReady(function (form) { | |
// Insert the recap div after the last form row | |
$( '<div id="recap"></div>' ).insertAfter( ".mktoFormRow:last-of-type" ); | |
// render the recap : replace with your site key |
NewerOlder