| /** | |
| * 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 |
| {exp:stash:set name='ids'}0 | |
| {exp:playa:children entry_id="{structure:page:entry_id}" field="page_featured_employee"} | |
| |{entry_id} | |
| {exp:stash:append_list name='featured-list'} | |
| {stash:team_member_urltitle}{url_title}{/stash:team_member_urltitle} | |
| {stash:team_member_name}{person_firstname} {person_lastname}{/stash:team_member_name} | |
| {stash:team_member_title}{person_title}{/stash:team_member_title} | |
| {stash:team_member_bio}{person_bio}{/stash:team_member_bio} | |
| {stash:team_member_email}{person_email}{/stash:team_member_email} |
| {!-- 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'}" } | |
| {stash:entry} | |
| <li><a href="{page_url}">{title}</a> {entry_date format="%d/%m/%y"}</li> | |
| {/stash:entry} | |
| {/exp:stash:append_list} | |
| {/exp:channel:entries} |
| @echo off | |
| if exist n:\home goto DISCONNECTME else goto CONNECTME | |
| :CONNECTME | |
| REM NOTE: in all of the below variables EXCEPT for mydrivename , double-quote the values! | |
| REM This is the name of the VPN you've got set up | |
| set myvpnname="Name of your VPN connection" |
| (function(){ | |
| if(window.myBookmarklet!==undefined){myBookmarklet();}else{ | |
| // the minimum version of jQuery we want | |
| var v = "1.71"; | |
| // check prior inclusion and version | |
| if (window.jQuery === undefined || window.jQuery.fn.jquery < v) { | |
| var done = false; | |
| var script = document.createElement("script"); | |
| script.src = "https://ajax.googleapis.com/ajax/libs/jquery/" + v + "/jquery.min.js"; |
| #!/bin/bash | |
| if [[ ! "$1" || "$1" == "-h" || "$1" == "--help" ]]; then cat <<HELP | |
| Curl a remote file into an editor. | |
| http://benalman.com/ | |
| echo "Usage: $(basename "$0") [curloptions...] url" | |
| Curl a remote file into the editor of your choice. The filename will be based | |
| on the URL's filename. If a file extension can't be determined from the URL, |
| SELECT | |
| SUM(entries) AS alltime, | |
| SUM(IF((YEAR(entrydate) = YEAR(CURDATE())),entries,0)) AS thisyear, | |
| SUM(IF((MONTH(entrydate) = MONTH(CURDATE()) && YEAR(entrydate) = YEAR(CURDATE())),entries,0)) AS thismonth, | |
| SUM(IF((WEEKOFYEAR(entrydate) = WEEKOFYEAR(CURDATE()) && YEAR(entrydate) = YEAR(CURDATE())),entries,0)) AS thisweek, | |
| SUM(IF((DAYOFYEAR(entrydate) = DAYOFYEAR(CURDATE()) && YEAR(entrydate) = YEAR(CURDATE())),entries,0)) AS thisday | |
| FROM | |
| (SELECT | |
| DATE(FROM_UNIXTIME(entry_date)) AS entrydate, | |
| COUNT(entry_id) AS entries |
| <!--[if IE 7]> | |
| IE7 | |
| <![endif]--> | |
| <!--[if gte IE 8]> | |
| IE8 or better | |
| <![endif]--> | |
| <!--[if !IE]><!--> | |
| You are NOT using Internet Explorer |
So I realized the other day that I was typing the same URLs about a zillion times a day. Even with address bar completion in Firefox and/or Chrome, there is still a lot of wasted effort trying to get to a given site. (URL completion doesn't help much when one of your sites is http://server.somethingorother.net/~atravis/ThingOne and another is http://server.somethingorother.net/~atravis/ThingTwo, for example.)
What I wanted was to be able to type in, say, http://thing1.dev and have my system just know that that actually meant I wanted to go to my ThingOne development site. I knew of a lot of ways to do part of that, but no way to solve the whole problem.
Then, in a fit of serendipity (and research), I hit upon this technique!
Note that the directions below presuppose a fair level of comfort with your operating system. I've tried to make the directions clear, and gone into a lot of detail about (lik