Skip to content

Instantly share code, notes, and snippets.

View EdEichman's full-sized avatar

Ed Eichman EdEichman

View GitHub Profile
@EdEichman
EdEichman / zopim_defer.js
Last active May 19, 2022 12:54
Defer Loading Zopim until page is loaded (to avoid long load delay), based on article http://www.feedthebot.com/pagespeed/defer-loading-javascript.html
//basic zopim widget code, from their site
window.$zopim||(function(d,s){var z=$zopim=function(c){z._.push(c)},$=z.s=
d.createElement(s),e=d.getElementsByTagName(s)[0];z.set=function(o){z.set.
_.push(o)};z._=[];z.set._=[];$.async=!0;$.setAttribute('charset','utf-8');
$.src='//v2.zopim.com/?26Smu9lv0NXQEOOg8IAZrMPh9yQstAcV';z.t=+new Date;$.
type='text/javascript';e.parentNode.insertBefore($,e)})(document,'script');
//make sure zopim does not show till we know we have department agents
var intial_zopim_hiding_done = false;
# Based on https://gist.github.com/fernandoaleman/5083680
# Start the old vagrant
$ vagrant init ubuntu_saucy
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
@martinbean
martinbean / google-feed.php
Created December 20, 2012 12:14
Building a Google RSS feed with DOMDocument.
<?php
$xml = new DOMDocument('1.0', 'UTF-8');
$xml->formatOutput = true;
$rss = $xml->createElement('rss');
$rss->setAttribute('version', '2.0');
$rss->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:g', 'http://base.google.com/ns/1.0');
$xml->appendChild($rss);