Skip to content

Instantly share code, notes, and snippets.

Avatar

Adrienne L. Travis adrienne

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am adrienne on github.
  • I am adrienne (https://keybase.io/adrienne) on keybase.
  • I have a public key whose fingerprint is 2506 5FA4 F592 F37E B339 BBA5 EC64 A25D D83E DC01

To claim this, I am signing this object:

View gist:984c5ee66c21cba830d9

“Well,” Rydra took out a metal tracing plate and a stylus. “I’m simplifying it a little, but let me show you.” She marked the plate. “Let’s say the word for circle is: O. This language has a melody system to illustrate comparatives. We’ll represent this by the diacritical marks: ˇ ¯ ˆ , respectively smallest, ordinary, and biggest. So what would Ǒ mean?”

“Smallest possible circle?” said Calli. “That’s a single point.”

Rydra nodded. “Now, when referring to a circle on a sphere, suppose the word for just an ordinary circle is Ō followed by either of two symbols, one of which means not touching anything else, the other of which means crossing — ║ or X. What would ÔX mean?”

“Great circles that intersect,” said Ron.

“And because all great circles intersect, in this language the word for great circle is always ÔX. It carries the information right in the word. Just like busstop or foxhole carry information in English that la gare or le terrier — comparable words in French—lack.”

@adrienne
adrienne / blogpost.html
Created Sep 16, 2014
Some markup patterns (including schema.org structured data)
View blogpost.html
<article itemscope itemtype="http://schema.org/BlogPosting">
<header>
<a itemprop="url" href="http://blah.org">
<img itemprop="image" src="/images/image.jpg" />
<h1 itemprop="name headline">Post Name</h1>
</a>
</header>
<div itemprop="articleBody">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc mi orci, malesuada elementum accumsan ut, porttitor at dolor.
</div>
@adrienne
adrienne / alt-handy-utilities.php
Created Aug 19, 2010
Some handy PHP utilities that I keep using
View alt-handy-utilities.php
/* === quick & dirty PHP pretty-printer for arrays ========================================================== */
function pp($arr){
$retStr = "<dl>\n";
if (is_array($arr)){
foreach ($arr as $key=>$val){
if (is_array($val)){
$retStr .= "<dt>" . $key . " => </dt>\n<dd>" . pp($val) . "</dd>\n";
}
else{
@adrienne
adrienne / LICENSE.txt
Created Jun 13, 2011 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
View LICENSE.txt
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
View private-dns-masking.markdown

Private DNS Masking

Using Apache Virtual Hosts and mod_proxy for Fun & Profit

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

@adrienne
adrienne / condcomments.txt
Created Dec 19, 2011
Conditional Comments (for reference)
View condcomments.txt
<!--[if IE 7]>
IE7
<![endif]-->
<!--[if gte IE 8]>
IE8 or better
<![endif]-->
<!--[if !IE]><!-->
You are NOT using Internet Explorer
@adrienne
adrienne / count_entries.ee_snip.sql
Created Jan 3, 2012
ExpressionEngine query: count entries
View count_entries.ee_snip.sql
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
@adrienne
adrienne / curl-to-editor.sh
Created Jan 5, 2012
Use cURL to get a remote file into an editor (originally from here: https://github.com/cowboy/dotfiles/blob/master/bin/curlmate)
View curl-to-editor.sh
#!/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,
You can’t perform that action at this time.