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
);
}
},
} );
} )();
view raw nepali-date-block.js hosted with ❤ by GitHub

Gender-fair WordPress: Fixing translation inequality at the core

At WordCamp US 2017, I took the stage to argue that it’s time that WordPress enables translators to add gender-variable translations, and that we can do this in a way compatible with our existing translation ecosystem.

The slides:

A couple of days later, during contributor day, I was joined by several amazing WordPress (and GlotPress) contributors, and we firmed the proposal which is now up on trac.

Relevant links

Right To Left in WordPress – The Right Way

Here’s the short talk I gave about languages written from right-to-left at WordCamp Europe 2017. I’m visibly nervous — this was the largest crowd I’ve ever presented to.

The slides:

While the slides make it clear that I go from talking about rtl.css — the file, used in WordPress themes, to RTLCSS — the node module, I realize that it’s somewhat hard to understand when watching the video. Sorry about that!

Helpful links:

Some relevant academic research on the effects of reading direction:

  • Influence of reading habits on line bisection – PDF
  • Reading habits influence aesthetic preference – PDF
  • Scanning direction and line bisection: a study of normal subjects and unilateral neglect patients with opposite reading habits – PDF
  • Native reading direction influences lateral biases in the perception of shape from shading – HTML

 

Greg Lake, Epitaph

King Crimson’s In the Court of the Crimson King is the album that made me fall in love with Prog Rock. Greg Lake‘s powerful vocals on the track Epitaph have much to do with this.

Written around 1969, the lyrics (by Pete Sinfield) are almost prophetic:

The wall on which the prophets wrote
Is cracking at the seams
Upon the instruments of death
The sunlight brightly gleams
When every man is torn apart
With nightmares and with dreams,
Will no one lay the laurel wreath
As silence drowns the screams

[…]

Knowledge is a deadly friend
If no one sets the rules
The fate of all mankind I see
Is in the hands of fools

Greg Lake passed away this week, at 69.

Tip: typing a long Google password into a new Android device

I use a password manager and create very long passwords where possible, including for my Google account. The problem? when setting up a new Android phone, I can’t download the password manager app until I’ve logged into my Google account, which is nearly impossible without the password manager app.

The workaround? Enable USB debugging on the phone, and use ADB to enter the password:


./adb shell input text "LONG COMPLICATED PASSWORD"

Is it safe enough? Probably not. Use at your own risk 🙂

%d bloggers like this: