Skip to content

Instantly share code, notes, and snippets.

@blueprintmrk
blueprintmrk / hhvm.conf
Last active August 29, 2015 14:27 — forked from tomazzaman/hhvm.conf
Monit configurations for commonly used services
check process hhvm with pidfile /var/run/hhvm/pid
group hhvm
start program = "/usr/sbin/service hhvm start" with timeout 60 seconds
stop program = "/usr/sbin/service hhvm stop"
if failed unixsocket /var/run/hhvm/hhvm.sock then restart
if mem > 400.0 MB for 1 cycles then restart
if 5 restarts with 5 cycles then timeout
@blueprintmrk
blueprintmrk / linkscape-google-apps-script.js
Created October 11, 2015 04:11 — forked from wrttnwrd/linkscape-google-apps-script.js
Linkscape in Google Apps Script
function getLinkscape() {
lastRow = FindRows();
startRow = lastRow + 1;
var active_spreadsheet = SpreadsheetApp.getActiveSpreadsheet();
var utility_sheet = active_spreadsheet.getSheetByName("Utilities");
params = utility_sheet.getRange(5,3,7,3).getValues();
url = params[2][0];
AccessID = params[0][0];
secret = params[1][0];
method = "HMAC_SHA_1";
@blueprintmrk
blueprintmrk / browser-redirect.js
Created October 19, 2015 23:24 — forked from sickOscar/browser-redirect.js
WPML - browser-redirect.js - Fix
/*globals wpml_browser_redirect_params */
jQuery(document).ready(function () {
if (jQuery.cookie !== undefined) {
// Check if cookie are enabled
jQuery.cookie('wpml_browser_redirect_test', '1');
var cookie_enabled = jQuery.cookie('wpml_browser_redirect_test') === '1';
jQuery.removeCookie('wpml_browser_redirect_test');
if (cookie_enabled) {
@blueprintmrk
blueprintmrk / gf-salesforce-web-to-lead-datetime.php
Created November 3, 2015 00:46 — forked from zackkatz/gf-salesforce-web-to-lead-datetime.php
Use DateTime for Gravity Forms Salesforce Web-to-Lead Addon
<?php
/**
* 1. Tell the plugin to use DateTime instead of Date for the "MyPrefix__Date_and_Time__c" field
*
* @param string $boolean Whether to use DateTime instead of Date (default: false)
* @param string $key The Field Name (or API Name if a custom field) used in Salesforce
* @param array $additional_info Associative array with form, entry, field, feed data
*/
function modify_gf_salesforce_use_datetime( $boolean = false, $key = '', $additional_info = array() ) {
@blueprintmrk
blueprintmrk / hreflang="es-419"
Created November 12, 2015 17:48
hreflang="es-419"
<!DOCTYPE html>
<!-- saved from url=(0051)http://support.google.com/chrome/?hl=en#topic=14680 -->
<html lang="en" class="streamlined streamlined-3"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script src="./Google Chrome Help_files/cb=gapi.loaded_0" async=""></script><script type="text/javascript">serverResponseTimeDelta=window.external&&window.external.pageT?window.external.pageT:-1;pageStartTime=new Date().getTime();</script>
<title>Google Chrome Help</title>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="description" content="Official Google Chrome Help Center where you can find tips and tutorials on using Google Chrome and other answers to frequently asked questions.">
<link rel="canonical" href="http://support.google.com/chrome/?hl=en">
<link rel="alternate" hreflang="ar" href="http://support.google.com/chrome/?hl=ar">
@blueprintmrk
blueprintmrk / es-419
Last active December 15, 2016 06:45
examplesite.com/es-419 hreflang
Google gives us some examples where rel=”alternate” hreflang=”x” is recommended:
The entire website is fully translated in another language, i.e. one version in Spanish – http://www.examplesite.com/es and one version in German http://www.examplesite.com/de.
You have regional variations within a single language, i.e. one version in Spanish for users in Mexico – http://www.examplesite.com/es-419-mx and one version in Spanish for users in Spain – http://www.examplesite.com/es-es.
Your site is partially translated with the main content being in a single language i.e. sites with translated site temple only (navigation menu/footer). This is very common on user-generated sites like forums and discussion boards.
So, how does an SEO implement hreflang correctly? Google gives us three methods:
1. HTML Link Element In Header
@blueprintmrk
blueprintmrk / wp-config.php
Created December 16, 2015 05:54 — forked from joshkoenig/wp-config.php
This is the wp-config.php supplied by Pantheon to allow automagic operation with WordPress
<?php
/**
* This config file is yours to hack on. It will work out of the box on Pantheon
* but you may find there are a lot of neat tricks to be used here.
*
* See our documentation for more details:
*
* http://helpdesk.getpantheon.com/
*/
@blueprintmrk
blueprintmrk / gist:3386f18a086ddd8ab93d
Created January 12, 2016 00:12 — forked from shanselman/gist:5422230
Evil Blog Comment Spammer just exposed his template through some error and the whole thing showed up in my comments.
{
{I have|I've} been {surfing|browsing} online more than {three|3|2|4} hours today, yet I never found any interesting article like yours. {It's|It
is} pretty worth enough for me. {In my opinion|Personally|In my view}, if all {webmasters|site owners|website owners|web owners} and bloggers made good content as
you did, the {internet|net|web} will be {much more|a lot more}
useful than ever before.|
I {couldn't|could not} {resist|refrain from} commenting. {Very well|Perfectly|Well|Exceptionally well} written!|
{I will|I'll} {right away|immediately} {take hold of|grab|clutch|grasp|seize|snatch}
your {rss|rss feed} as I {can not|can't} {in finding|find|to find} your {email|e-mail} subscription {link|hyperlink} or {newsletter|e-newsletter} service. Do {you have|you've} any?
{Please|Kindly} {allow|permit|let} me {realize|recognize|understand|recognise|know} {so that|in order that} I {may just|may|could} subscribe.
Thanks.|
@blueprintmrk
blueprintmrk / PagerDutyWebhookToEmail.php
Last active April 18, 2016 02:49 — forked from eurica/PagerDutyWebhookToEmail.php
Simple example of using PagerDuty webhooks and PHP to forward all incident state changes to an email address.
Sample PHP code to accept PagerDuty webhooks and send out notifications by email on state changes.
For more information, see http://developer.pagerduty.com/documentation/rest/webhooks
This example threads emails based on "$status: $description on $service" so each update to each incident would start a new thread.
This code is unsupported by PagerDuty.
<?php
$emailAddress = "[email protected]";
@blueprintmrk
blueprintmrk / criticalcss-bookmarklet-devtool-snippet.js
Created February 7, 2016 18:25 — forked from PaulKinlan/criticalcss-bookmarklet-devtool-snippet.js
CriticalCSS Bookmarklet and Devtool Snippet.js
(function() {
var CSSCriticalPath = function(w, d, opts) {
var opt = opts || {};
var css = {};
var pushCSS = function(r) {
if(!!css[r.selectorText] === false) css[r.selectorText] = {};
var styles = r.style.cssText.split(/;(?![A-Za-z0-9])/);
for(var i = 0; i < styles.length; i++) {
if(!!styles[i] === false) continue;
var pair = styles[i].split(": ");