Skip to content

Instantly share code, notes, and snippets.

View visitdigital's full-sized avatar

Lee Woodman visitdigital

View GitHub Profile
@visitdigital
visitdigital / encrypt-with-zapier-code-app.js
Last active September 9, 2022 11:13
Encrypt data with Zapier using Zapier Code App
var crypto = require("crypto")
function encrypt(key, data) {
var cipher = crypto.createCipher('aes-256-cbc', key);
var crypted = cipher.update(data, 'utf-8', 'hex');
crypted += cipher.final('hex');
return crypted;
}
var key = "supersecretkey";
@visitdigital
visitdigital / intercom.js
Last active July 20, 2018 06:27
Intercom with Custom Parameters
<script>
/* --------------------------------------------------
:: Track Referrers
-------------------------------------------------- */
function getParameterByName(name) {
name = name.replace(/[\[]/, "\\[").replace(/[\]]/, "\\]");
var regex = new RegExp("[\\?&]" + name + "=([^&#]*)"),
results = regex.exec(location.search);
return results === null ? "" : decodeURIComponent(results[1].replace(/\+/g, " "));
@visitdigital
visitdigital / webhook.php
Last active September 20, 2022 02:51
Very Simple Facebook Chat Bot PHP Webhook Script Example
<?php
$challenge = $_REQUEST['hub_challenge'];
$verify_token = $_REQUEST['hub_verify_token'];
// Set this Verify Token Value on your Facebook App
if ($verify_token === 'testtoken') {
echo $challenge;
}
$input = json_decode(file_get_contents('php://input'), true);
@visitdigital
visitdigital / bulk-find-replace-mysql.php
Last active July 23, 2021 09:41
Mass Find and Replace MySQL
<?php
/*
* MySQL Mass Find and Replace
* Author: Lee Woodman - https://www.linkedin.com/in/leewoodman
* License: GNU
*/
// Connect to your MySQL database.
$hostname = "localhost";
$username = "root";