On page 137 of The Little Schemer, this rather convoluted function appears:
(define multirember&co
(lambda (a lat col)
(cond
((null? lat)
(col (quote ()) (quote ())))
With Stash you have always been able to create global variables and evaluate them in the same template using if/else conditionals:
{exp:stash:set_value name="var" value="cheese" type="snippet"}
{if var == "cheese"}
We have cheese!
{if:else}
Where's the cheese, gromit?
{/if}
function Record (template) { | |
if (Record.prototype.isPrototypeOf(this)) { | |
var struct = this; | |
Object.keys(template).forEach(function (key) { | |
Object.defineProperty(struct, key, { | |
enumerable: true, | |
writable: true, | |
value: template[key] | |
}); |
{# 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"> |
I wanted to get a VM configured quickly for building Craft sites, this is what I did:
https://puphpet.com/#deploy-target
I want a local VM working with Vagrant + VirtualBox.
To use Webster's 1913 dictionary on Android, install Colordict 3, an app that accepts this StarDict format. https://play.google.com/store/apps/details?id=com.socialnmobile.colordict
Next download James's S3 archive. https://s3.amazonaws.com/jsomers/dictionary.zip
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.
"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.
<?hh | |
async function stream_check(resource $stream, string $mode, int $usec): Awaitable<void> | |
{ | |
$r = $w = $e = null; | |
do { | |
if ($mode == "r") { | |
$r = Vector{$stream}; | |
} |
Here are a few common tasks you might do in your templates, as they would be written in ExpressionEngine vs. Craft CMS.
$.fn.markerList = function(options) { | |
var titles = {}; | |
var geocoder = new google.maps.Geocoder(); | |
var _default = { | |
map: {}, | |
bounds: new google.maps.LatLngBounds(), | |
lat: false, | |
lng: false, |