Skip to content

Instantly share code, notes, and snippets.


Evan Donovan evandonovan

View GitHub Profile
# get entire website via wget
# from
# replace EXAMPLE.COM with your site
wget \
--recursive \
--no-clobber \
--page-requisites \
--html-extension \
--convert-links \
evandonovan / menu-include.js
Created May 21, 2019
Javascript to dynamically include content on an Unbounce page
View menu-include.js
/* Example code - by Evan Donovan, public domain
Adjust the paths and selectors below as needed.
* Get HTML from another URL -
* Uses the vanilla JS XMLHttpRequest
* The first parameter is a URL to fetch, the second is the JS function that is called to handle the data that is received.
* @param {String} url The URL
evandonovan / themename_addressfield_formatter__components.php
Created Jan 10, 2019
Cleaner formatting for addressfield (plus RDFa microdata)
View themename_addressfield_formatter__components.php
// Override addressfield_tokens themeing function
// Requires addressfield_tokens module as well as addressfield
// Add to template.php and change THEMENAME to name of your theme, then clear cache
function THEMENAME_addressfield_formatter__components($vars) {
$loc = $vars['address'];
$out = '';
// Note added RDFa microdata -
// Organization name if present (nothing in first or last name fields)
#!/usr/bin/expect -f
# exp_internal 1 ;# uncomment to turn on expect debugging
set timeout -1
# creates an rsync process that will rsync with excluded directories
#! /bin/bash
# set user
# set port
# set remote IP (put yours here)
View gist:6135556
module DMOZ
"dmoz.csv" => [ do
def name
end, do
def name
View gist:6135383
class JobExecutor
attr_reader :data_store, :fields
def initialize(fields)
@jobs = []
@threads_working = 0
@lock =
@data_store =
@fields = fields
View gist:6135344
## Task class
require 'mysql'
module OrgSocGraph
"orgs.csv" => [ do
def name
evandonovan / gist:1562280
Created Jan 4, 2012
Leads code for Round Robin Record Assignment
View gist:1562280
// leadsRoundRobin.trigger:
trigger leadRoundRobin on Lead (before insert, before update) {
//Check if assignment owner has changed
Map<Integer,Id> queueIds = new Map<Integer,Id>(); //Trigger index --> Queue ID
Integer idx = 0;
for (Lead l :
evandonovan / gist:1515657
Created Dec 23, 2011
Assignment of Contacts Class
View gist:1515657
/* Class */
public with sharing class CityvisionContactAssigner {
static final Id OWNER_NYOUNG;
static final Id OWNER_AWEBB;
static {
List<User> users = [SELECT Id, Alias FROM User WHERE Alias = 'nyoung' OR Alias = 'awebb' OR Alias = 'MOmori' OR Alias = 'ASears'];
for(User u : users) {
// Switch which user to use based on whether we are in production environment, since partner users don't carry across to sandboxes.
if((CityvisionConstants.onProduction == true && u.Alias == 'nyoung')