Skip to content

Instantly share code, notes, and snippets.

Avatar

Kevin Leary Kevinlearynet

View GitHub Profile
@Kevinlearynet
Kevinlearynet / fw-config.php
Last active Aug 17, 2021
Folderwave server setup related files
View fw-config.php
<?php
/**
* FW Connector Config
*
* Add this to: /wordpress/wp-content/mu-plugins/fw-config.php
*/
$host = $_SERVER['SERVER_NAME'];
$api_host = ($host === 'student.student-1.com') ? 'https://www17.student-1.com' : 'https://www46.student-1.com';
if (!defined('FW_ENV')) {
@Kevinlearynet
Kevinlearynet / 1-identify
Last active Jul 19, 2021
Specification for creating a "Application Updated" event sent in to Segment by TAP/ArrayWorks.
View 1-identify
Analytics.Client.Identify("{UserID}", new Traits() {
{ "id", "{UserID}" },
{ "firstName", "Kevin" },
{ "lastName", "Leary" },
{ "email", "info@kevinleary.net" },
{ "age", 35 },
{ "birthday", "1986-04-22" },
{ "createdAt", "YYYY-MM-DD" }, // Date of initial "application sent"
{ "gender", "Male" },
{ "phone", "7814896630" },
@Kevinlearynet
Kevinlearynet / media-types-filter.js
Last active Jun 23, 2021 — forked from danielbachhuber/collection-filter.js
Add a custom taxonomy dropdown filter to the WordPress Media Library
View media-types-filter.js
(function(){
/**
* Create a new MediaLibraryTaxonomyFilter we later will instantiate
*/
var MediaLibraryTaxonomyFilter = wp.media.view.AttachmentFilters.extend({
id: 'media-attachment-taxonomy-filter',
createFilters: function() {
var filters = {};
// Formats the 'terms' we've included via wp_localize_script()
@Kevinlearynet
Kevinlearynet / 502.html
Created Nov 13, 2019
Response body of 502 error
View 502.html
<!DOCTYPE html>
<html>
<head>
<title>Error Loading Site | 502 Bad Gateway</title>
</head>
<body>
<style>
@import url(//fonts.googleapis.com/css?family=Open+Sans:300);
body {
color: #343434;
@Kevinlearynet
Kevinlearynet / gist:29b44003ce45821c369a7064ac7b3313
Created Apr 30, 2019
Apple News BannerAdvertisement Example
View gist:29b44003ce45821c369a7064ac7b3313
{
"role": "banner_advertisement",
"anchor": "https://www.tripadvisor.com/",
"animation": "fade_in",
"bannerType": "standard",
"identifier": "tripadvisor-cta",
"style": {
"backgroundColor": "#ffffff",
"border": {
"all": {
View How to save a webpage as PDF file using Puppeteer.js
// Save PDF from HTML Microservice
https://addaptive-microservices.herokuapp.com/api/html-to-pdf
const puppeteer = require('puppeteer');
class Webpage {
static async generatePDF(html) {
const browser = await puppeteer.launch({ headless: true }); // Puppeteer can only generate pdf in headless mode.
const page = await browser.newPage();
@Kevinlearynet
Kevinlearynet / locale-en_uk.json
Last active Aug 15, 2018
String translations needed for each locale.
View locale-en_uk.json
{
"itunes_app": "https://itunes.apple.com/us/app/tripadvisor-hotels-flights/id284876795?mt=8",
"google_play_app": "https://play.google.com/store/apps/details?id=com.tripadvisor.tripadvisor&hl=en_uk",
"twitter_handle": "tripadvisoruk",
"facebook_link": "https://www.facebook.com/TripAdvisor",
"img_tripadvisor_blog": "tripadvisor-blog.svg",
"img_tripadvisor_tagline": "tripadvisor-tagline.svg",
"hotels": "Hotels",
"flights": "Flights",
"rentals": "Rentals",
View gist:034ddeb718ad8c6da7a3c3c3068f069e
blockquote p {
...
&:before {
content: "\201C";
text-indent: -.65em;
display: inline-block;
}
&:after {
@Kevinlearynet
Kevinlearynet / php.rb
Last active May 9, 2018
Homebrew php formula that supports --with-homebrew-curl
View php.rb
class Php < Formula
desc "General-purpose scripting language"
homepage "https://secure.php.net/"
url "https://php.net/get/php-7.2.5.tar.xz/from/this/mirror"
sha256 "af70a33b3f7a51510467199b39af151333fbbe4cc21923bad9c7cf64268cddb2"
bottle do
sha256 "bbd116d08df396ba4048f073974fbb9f72873f6fa7dd562276ef542d1b3d6449" => :high_sierra
sha256 "d61496a1f613f6bd1bf103f9985d1758ed298a2b1c2cf9b0d1bb1cf675974396" => :sierra
sha256 "158fa211bde0818ff0ed97c65735b1b649955db68a9868af8a9ca572f78d34c3" => :el_capitan
View gist:321eb1cd898b2b2e67a7af15a4a3e5ec
{
"anonymousId": "29c35577-99a5-4228-8333-2958e0fda1c4",
"context": {
"library": {
"name": "analytics.js",
"version": "3.4.0"
},
"page": {
"path": "/life-insurance-calculator/questions/",
"referrer": "https://www.sbli.com/?utm_source=google&utm_medium=cpc&utm_term=SBLI&utm_content=TQ_Branded_TL_PINHV_Our-Accel-Underwriting&utm_campaign=SBLI_NJ_Search_Branded&gclid=Cj0KCQjw-uzVBRDkARIsALkZAdkDr81kvsw5xlQ1oWUBKPu_JzwTc3XIrFNU8JfyxSO1fEykUN5oABEaAgEcEALw_wcB",