A Pattern Language – book recommendation

I stumbled on the Cool Tools review of the book “A Pattern Language” a couple of years ago. Knowing then that we’ll soon be planning and building our house, I was excited to learn of a book that could help me build-up some basic knowledge and understanding of architecture.

A Pattern Language - Book Cover

“A Pattern Language” is fantastic! The amount of practical yet easy-to-digest information is staggering, and the book’s structure makes it very easy to use. The authors describe 253 patterns with varying importance, spanning across three main sections (Towns, Buildings, Construction). Each pattern references the patterns it’s built on top of and the patterns it affects.

Reading through “A Pattern Language” (and going back to it again and again) has given me the confidence I needed to critically look at our house plans, noticing how the patterns are applied (or not!). If you’re ever going to be involved in a construction or serious remodeling project, I recommend getting yourself a copy.

My Breakfast

When it comes to food, I’m not a person of habits. But this recipe has been my breakfast of choice for the last few months, and surprisingly, I’m still enjoying it very much.

Yoghurt with Tahini, Banana, Walnuts, and Honey



Ingredients

  • 125 gr yoghurt (I use dairy-free plain yoghurt)
  • 1 banana, sliced, diced, or smashed
  • A handful of walnuts
  • 2 tsp raw tahini
  • 1 tsp honey

Directions

  1. Pour yoghurt in bowl
  2. Add Tahini and mix
  3. Add banana
  4. Crush the walnuts in your hand (or chop to your preferred size), and add to the bowl
  5. Drizzle honey on top

Your first Gutenberg Block – WC Kathmandu presentation

I was fortunate to attend WordCamp Kathmandu 2019 last weekend in Nepal. As promised, here are my slides and the code for the “Nepali Date” block I created for my session “Your first Gutenberg Block”.

Here’s the code for the block javascript file:

// Nepali calendarFunctions() made available by loading the latest version of https://github.com/leapfrogtechnology/Nepali-Date-Picker
( function() {
const { __ } = wp.i18n;
const el = wp.element.createElement
const blockStyle = {
backgroundColor: '#DC143C',
color: '#fff',
padding: '20px',
};
wp.blocks.registerBlockType( 'wcktm/nepali-date-block', {
title: __( 'Nepali Date', 'gutenberg-examples' ),
icon: 'calendar-alt',
category: 'widgets',
attributes: {
nepaliDate: {
type: 'string'
},
englishDate: {
type: 'string'
}
},
edit: function( { isSelected, attributes, setAttributes } ) {
const saveDate = function( englishDate ) {
const englishDateObject = new Date( englishDate );
const nepaliDate = calendarFunctions.getBsDateByAdDate(
englishDateObject.getFullYear(),
englishDateObject.getMonth() + 1,
englishDateObject.getDay()
);
setAttributes( {
'englishDate': englishDate,
'nepaliDate' : calendarFunctions.bsDateFormat(
"%y-%m-%d",
nepaliDate.bsYear,
nepaliDate.bsMonth,
nepaliDate.bsDate
),
} );
}
if ( isSelected ) {
return el(
wp.components.DatePicker, {
onChange: saveDate,
currentDate: typeof attributes.englishDate !== 'undefined' ?
new Date( attributes.englishDate ) : new Date()
});
} else {
const text = typeof attributes.nepaliDate !== 'undefined' ?
attributes.nepaliDate :
__( 'Click to select a date' );
return el(
'p',
{ style: blockStyle },
text
);
}
},
save: function( props ) {
if ( props.attributes.nepaliDate !== undefined ) {
return el(
'p',
{ style: blockStyle },
props.attributes.nepaliDate
);
}
},
} );
} )();

%d bloggers like this: