Skip to content

Instantly share code, notes, and snippets.


Adrienne L. Travis adrienne

View GitHub Profile
mildlygeeky / gist:14b814ec8c815a1f5c6f
Last active Jan 3, 2019
Dynamic Navigation using native Craft CMS and Twig templates
View gist:14b814ec8c815a1f5c6f
{# For this, I wanted the nav to show the top-level node and second-level nodes #}
{# when on level 1, and then show the second-level and its children when on #}
{# level 2 or level 3 (so we get good parent, child, and sibling navigation. #}
{# Requires string 'sectionName' to be passed with Structure section name #}
{% if entry.showLeftNavigation %}
<nav class="interior-page__nav">
tylerwillingham /
Last active Sep 14, 2016
PuPHPet: Craft CMS VM

PuPHPet for Craft Development

I wanted to get a VM configured quickly for building Craft sites, this is what I did:

Deploy Target: Local VM

I want a local VM working with Vagrant + VirtualBox.

Local VM Details

jsomers /
Last active Dec 13, 2019
Instructions for using Webster's 1913 on Android

To use Webster's 1913 dictionary on Android, install Colordict 3, an app that accepts this StarDict format.

Next download James's S3 archive.

You will need to extract the .dict file from inside three containers - .dz, .tar, .bz2 from innermost to outermost. 7zip handles all of these formats.

Place the .dict, .idx and .ifo files in the dictdata directory on your sdcard or local storage root. This is where colordict looks for dictionaries.

When the files are in the right place, you can run Colordict and tap the folder icon in the top right to see the dictionaries installed and set the dictionary priority. I put the 1913 dictionary above the defaults "Wordnet" and "Wikipedia." When you look up a word, ColorDict shows the definition, if available, from these multiple sources.

croxton /
Last active Aug 29, 2018
Battle-tested cPanel VPS server configuration for medium traffic ExpressionEngine websites

"Medium traffic" = able to handle around 50 concurrent users on average.

If you want to handle 100+ concurrent users with the same modest hardware see the Varnish section below.


  • 4096 MB memory
  • 125GB SSD
  • 4 CPUs
  • Cpanel
View hhvm-async-test.php
async function stream_check(resource $stream, string $mode, int $usec): Awaitable<void>
$r = $w = $e = null;
do {
if ($mode == "r") {
$r = Vector{$stream};
brandonkelly /
Last active Aug 6, 2020
Templating in EE vs. Craft
View gist:8062739
$.fn.markerList = function(options) {
var titles = {};
var geocoder = new google.maps.Geocoder();
var _default = {
map: {},
bounds: new google.maps.LatLngBounds(),
lat: false,
lng: false,
0xabad1dea /
Last active Aug 29, 2019
Weird Machines in Video Games

Abadidea's Index of Weird Machines in Video Games

A "weird machine" is when user-supplied input is able to create an arbitrary new program running within an existing program due to Turing-completeness being exposed. Sometimes such functionality was deliberately included but it is often the result of exploitation of memory corruption. You can learn more at the langsec site. There is a good argument for weird machines being inherently dangerous, but this index is just for fun.

It is broken into two categories: intentional gameplay features which may be used as weird machines, and exploit-based machines which can be triggered by ordinary player input (tool-assisted for speed and precision is acceptable). Games with the sole purpose of programming (such as Core Wars) are not eligible and plugin APIs don't count. If you know of more, feel free to add a comment to this gist.

Intentional Gameplay Mechanics

mikeal / gist:7724521
Last active Dec 29, 2015
Inclusive by Exclusion
View gist:7724521

When you build a community you're creating a culture. That culture will be about more than the code, the modules, or the language. The people you draw in will have their own biases and behaviors that impact the kinds of people you continue to draw as you grow.

Cultures will naturally fight behavior that is divisive. That is, behavior that is divisive to the established members of that community. As a community grows larger it is harder and harder to change what the culture finds acceptable because changing it, even if it is inclusive in nature, is disturbing and divisive to existing membership. Fighting for change in established cultures means dealing with a lot of dismissive language and attacks for the "tone" of your argument.

That is why it is so important that a culture becomes comfortable with aggressively fighting exclusionary behavior. While it is certainly more beneficial to make pro-active steps to increase diversity we cannot be dismissive of the effect that passionate reactions to poor behavior

robotlolita /
Last active Jul 6, 2020
Why `xs.each(f)` should not be considered a "loop".

First and foremost, let's take a look at the following pieces of code. The first one is something you should be rather familiar with, and the second one is also a somewhat familiar idiom these days (at least in languages with higher-order functions):

// Example 1:
30 + 12

// Example 2:
You can’t perform that action at this time.