Skip to content

Instantly share code, notes, and snippets.

Adrienne L. Travis adrienne

Block or report user

Report or block adrienne

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
adrienne / perftips.js
Last active Dec 15, 2015
some quick Javascript/jQuery performance tips
View perftips.js
// Some references here:
// Using native getElementByID to create a jQuery collection is faster than jQuery's ID selector!
// -------------------------------------------------------------------------------------------------------------
// prefer:
// to:
View .htaccess
# ----------------------------------------------------------------------
# @
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
# ----------------------------------------------------------------------
<IfModule mod_rewrite.c>
RewriteEngine On
adrienne / EE RSS Feed (Dynamic)
Last active Dec 15, 2015
EE sample feed; multiple entries if no third segment, otherwise comments from single entry. REQUIRES STASH.
View EE RSS Feed (Dynamic)
<?xml version="1.0" encoding="{charset}"?>
<rss version="2.0"
adrienne / gist:3977777
Created Oct 30, 2012
How to follow an organization on gitHub
View gist:3977777
Paste this into the console in your browser:
adrienne / gist:3950202
Created Oct 25, 2012
Quick Stash thing
View gist:3950202
{!-- putting the items in lists --}
{exp:channel:entries channel="clinical_trials" orderby="ct_last_updated" sort="desc" status="not Closed"}
{exp:stash:append_list name='ct_recruitment_list'}
{exp:stash:append_list name='ct_agegroups_list'}
adrienne / string_manipulation_AND_json_output.sql
Created Aug 29, 2012
Things NOT to do with MySQL, generally speaking
View string_manipulation_AND_json_output.sql
ia.descriptor_id, descriptor_name,
MAX(pkg_override_id) AS pkg_id, MAX(version_type_id) AS version,
CASE WHEN MAX(version_type_id) > 1 THEN 1 ELSE 0 END AS overridden,
WHEN cat_override_id IS NOT NULL AND cat_override_id > 0
THEN CONCAT('{"',ia.item_id,'" : [ {"iname" : "',item_name,'"} , {"icat" : "',
adrienne / gist:3312817
Created Aug 10, 2012 — forked from ckimrie/gist:3312619
Example extension that allows you to modify the final ExpressionEngine CP output
View gist:3312817
* Modifying the final CP Output
* This extension demonstrates how you can access and modify the final ExpressionEngine
* CP output. It is not a hack, but it is a new technique that to my knowledge has not
* been used before in an EE addon.
* This has not been road tested and its side effects are unknown, so use this at your own risk.
adrienne / gist:3180103
Created Jul 26, 2012
Haversine formula (PHP/MySQL)
View gist:3180103
* Generates the string for the Haversine function. We assume that the `zipcode`, `latitude`,
* and `longitude` columns are named accordingly. We are also not doing much error-checking
* here; this is a simple text cruncher to make things prettier.
* We may also be integrating some extra SQL in, passed in via the $extra parameter
* @param string $table The table to search in
* @param float $lat The latitude part of the reference coordinates
* @param float $lng The longitude part of the reference coordinates
* @param int $radius The radius to search within
adrienne / gist:3180040
Created Jul 26, 2012
Stash template (complicated)
View gist:3180040
{exp:stash:set name='ids'}0
{exp:playa:children entry_id="{structure:page:entry_id}" field="page_featured_employee"}
{exp:stash:append_list name='featured-list'}
{stash:team_member_name}{person_firstname} {person_lastname}{/stash:team_member_name}
adrienne / gist:2888431
Created Jun 7, 2012 — forked from greendesigned/gist:2888220
stash events filtered by day of the week
View gist:2888431
{!-- Controller --}
{exp:channel:entries channel="events" dynamic="off" show_future_entries="yes" order_by="entry_date" sort="asc" }
{!-- group into lists by day of the week --}
{exp:stash:append_list name="events_list" context="{entry_date format='%D'}" }
<li><a href="{page_url}">{title}</a> {entry_date format="%d/%m/%y"}</li>
You can’t perform that action at this time.