Rarst.net https://www.rarst.net/ Recent content on Rarst.net Hugo -- gohugo.io en-us Wed, 08 Jun 2022 18:00:00 +0300 Hashtag #bachelorcooking — one lone man's quest for food https://www.rarst.net/thoughts/bachelorcooking/ Wed, 08 Jun 2022 18:00:00 +0300 https://www.rarst.net/thoughts/bachelorcooking/ <p><em>Compiled and lightly edited from <a href="https://twitter.com/Rarst">my twitter account</a>.</em></p> <hr> <p>This pasta smells kinda weird&hellip; My mistake — that is just kitchen towel in my hands on fire.</p> Compiled and lightly edited from my twitter account.


This pasta smells kinda weird… My mistake — that is just kitchen towel in my hands on fire.


Today I learned how much soy sauce is too much.


Mix random things, cook until slightly burnt. :(


Chop & char.


Before getting stuff from the package on the frying pan, package needs to be opened. #protip


“Fry until fully cooked” — define “fully cooked”! :(


I usually approach such as “slightly char, subtract two minutes from next attempt”.


Hot things burn.


  1. Place eggs on a towel, so they don’t roll of a table.
  2. Grab the towel.
  3. :(

Still can’t find soy sauce dose between “can’t feel it” and “gosh, like biting a salt block”. :(


Apparently my bookmarks on cooking hadn’t been visited in 900-1000 days… No wonder.


Time pasta and scrambled eggs to be cooked at the same time… Mission impossible. :(


Narrowly dodged hot frying pan. Pulse is racing.


It’s time to sharpen the knives! No, literally — they are dull. Using dull kitchen knife is dangerous, people.


I have fresh bread. Surprised me!


Whatever it is, you can probably add eggs to it.


I have tea and meat.


Fridge has more food than estimated. #winning


Sometimes I wish I could order month worth of food supply in a bag like I do for my cat.


Aaaaand burnt the meat. #FML


Fry X with eggs — creative and open-ended like that.


Cleaned stove went flames-of-hell on my dinner… uniformly warm food!


The Friday menu is being… rice-centric.


Longly heated parts of mutilated bird corpses.


Today on a quest for more condiments — tartar sauce with chopped pickles. Not bad for a stupid name.


Salt food with hand without open cut. #protip


In my quest for condiments bought hummus today. Tastes about as weird as its name.


Hummus is growing on me.


Apply heat until you are sure it’s dead.


I am out of frying oil. That is a crisis, next only to being out of tea.


Oh crap… The lid on steamer broke, that’s the only way I can manage to cook fish!


Procedure for stale bread: heat in microwave, throw out.


Ate nectarine with a fork. Civilized.


Meat broke out of my dinner alien style. o_0


Smetana was about to expire, so I attempted to drown blini in it, not without success.


Cut finger with an egg.


Last time I boiled khinkali to the explosion point. I guess this time I am having them near-frozen for the opposite data point.


Observes recurrently exploded khinkali …I start to question accuracy of instructions on packaging.


Too much hot liquid on flat plate — not good.


I will not explode khinkali this time, I will not explode khinkali this time…


I have a fork, I need a knife… …I have two forks?


Fried too much fries.


When you suddenly recall a forgotten food item in the fridge and are afraid to look.


I don’t eat much, but when I do it’s because stuff is about to expire.


I think my cooking evolution is missing a path to take from “apply heat” to something more… Advanced.


Found & fried.


Mystery injury — when you look at that burn and struggle to reconstruct an earlier kitchen action.


I have sugar! I just forgot what it’s used for.


Eastern veggies and green tea. Not because fancy, but because that’s what’s left.


When you grab a pan, expect it empty and washed, and weight tells you it’s not, and suddenly the fear of opening it shoots through.


Pain works in a stupid ways. I got the point, only touched that frying pan for like fraction of a second! No need to go on!


Fried chicken… components.


Set pasta on fire. :(


A. Dying in a fireball. Q. Really, what’s the worst that could happen while charging kitchen lighter?


How I see culinary — technique for reducing expenses by diluting meat with other materials.


Polishes meh pizza with bleh ice-cream.


How does one eat without microwave?


Was ordering meat grinder for grandmother and added air grill for myself. Excited to ruin meat in a new way this evening.


Strangely, overcooked meat and undercooked rice don’t add up to average meal.


The mission “Meat 2” into the new air grill is a go. Wish it luck.

The “Meat 2” mission had begun re–entry into kitchen space, thermal equalization in progress

“Meat 2” has no signs of ruinous heat damage and is detectably edible. The dinner future is secure.


Discovered the one true purpose of the air grill thing and it’s heating up frozen pizza (yes, it’s hawaiian, deal with it).


Snacked with a chunk of cold rigid dry meat like a man.


The Far Away Corners of the Fridge — episode number about next to last “Fish Sticks”.


Finally got both meat and marinade at the same time!


Calorie bomb class lasagna dinner to recharge after week of barely eating.


Gotta say I am not too fond of this “will meat marinate before I starve” game.


Had finally found the perfect 12 minutes mark on the convection oven timer (11 minutes is half-frozen, 13 minutes is charred).


Getting comfortable at using convection oven. I should bake something.


Potatoes are high–maintenance delicacy.


Is there expression for preemptive comfort food? anyway — pizza for breakfast.


Cut through the plate. Better than arm or something, I suppose.


Sharpened the kitchen knives. #scared


Think I am past “baking” stage here and simply am torturing this apple pie out of its misery. :(


Pro — edible.

Con — soul draining failure in the next galaxy to what it should be.


Rules:

  1. Everything can cut you
  2. Everything is flammable
  3. There are no exceptions to 1 & 2

Pie is a lie. :(


There is always something to fry in far corner of the fridge.


Ah, the crisp feeling of kitchen towel just out of laundry… drops it into mayo …it doesn’t last.


Cracked egg. With a knife. I recently sharpened. Split egg in two & stopped short of doing same to my hand. #nearmiss


All food can explode.


I don’t peel.


Hmmm… Hmmm… Hmmm… Forgot salt. >_<


Cook rice without salt for one day and you facepalm once. Cook rice without salt for five days and, well, you get the math.


Pack of veggies with mini corns. NOPE. with one single piece of mini corn. Boo.


Rather irrational pang of wanting to do the cooking over, because I started the timer with a wrong label (right duration).


After family event yesterday mom packed me raw meat to air grill. This is what happens when you admit to know what to do…


YouTube spams “how to master 5 basic cooking skills” video for me to watch… there are FIVE?


My most polished skill in the kitchen is stopping just short of hitting my head on open cupboards’ doors. Practice!


Made breakfast plans. Set things on fire. Made other breakfast plans.


Bought new frying pan. I wish these things just broke in two after a while instead of that coating subtly going to shit.


Good time for fried eggs — week you bought them.

Not good time — week you remembered you have some from long ago.


I had just figured out today that they actually sell pre–made pasta sauces. Wow.


Can You Eat Nothing But Cookies All Day, One Man’s Quest To Find Out


My general peeling technique is roughly “chop to the the cube form”.


941 0 days since pasta was set on fire.


Degradation of dinner plans:

  • cooking

  • cooking, but not dishes

  • not cooking, not dishes

  • …something?

  • bowl of hummus


My digital kitchen scales are weird. I weight spaghetti, break it in half, put it back, and and it weights less. What.


My omelets somehow got worse lately, I didn’t think there was a room for regress there.


Blew up a plate in the microwave. That’s new.


Morale boost dinner (ice cream).


A theory: people who diss soylent move houses instead of cleaning their stove.


(eggs) have a nice day!

(me) don’t make this awkward… approaches with a knife

They still print random stuff on them.


Pro — kitchen is not on fire.

Con — smoke and burnt plastic smell hint that it was the last pot of tea I got out of my tea maker earlier. :(


Got bunch of things done all over and picked up replacement tea maker. May this one not catch fire.


  1. Don’t do it naked
  2. Don’t ask about rule 4

Current level of having it together — cake for breakfast because I screwed up with groceries yesterday.


Finally unpacking and setting up the replacement tea maker, may it not catch fire…


Dodged a shower of boiling oil and, while I need a new frying pan, this is most alive I’ve felt in a while.


Steamer lid crumbled into pieces. AGAIN. seriously, could they just make it from the same stuff as the rest of it?..


Reminded I am incapable of cooking beef.


I’ve learned that asparagus is expensive because it takes multiple years to grow and you need to have a specific gene to notice that it makes pee smell bad.

Worst. Superpower. Ever.


Got ingredients for honey garlic chicken thighs with green pepper and site with explanation how to cook them is down. Swell. :(

fries a pack of frozen veggies for lunch


  1. Don’t eat in the dark and a good shirt

Caught a falling sandwich. With my hip. Guess which side down.


I drowned the last stroopwafel in the tea cup, and everyone is mad at me.


Made guacamole, but forgot to buy potatoes for chips, so it had to be refactored into avocado egg salad.


Missed groceries run due to back pain, and my remaining foods are eggs, bacon, and bunch of grains. I can totally cook three meals out of this today! As long as one of them is ordering pizza.


Made banana pancakes, in spirit, if not in shape.


For a lunch salad I chopped vegetables onto a plate and squeezed mayonnaise onto myself, let’s call it a partial success.


Schrödinger’s kitchen mess — when you drop an open pack of Philadelphia upside down and you don’t know until you lift it…


The good news there was cheese to go with lunch, the bad news I found out what was smelling up the fridge. 🤢


Been scanning all the food barcodes into calorie tracker and I can happily report it confirmed that bar of chocolate is a valid dinner.


It’s nice that I was learning math for like 17 years of my life, so I can do complex calculations, like fit a pizza into diet’s daily calories limit…


Grabbed a small frozen pizza with groceries on weekend and discovered it was made with “cheese analogue”. LIES. there is no cheese analogue, there is only cheese and not cheese!!


Brown rice,

I tried to love you,

but no.


It’s been a while since I held a brush… painting BBQ sauce on a chicken breast.


Honestly, I was skeptical, but “pound chicken with your fist” is indeed an essential recipe step. it doesn’t cook as well if you don’t establish dominance upfront.


Culinary I am on intersection of:

  1. sick of same stuff

  2. shopping for groceries twice less often sucks

  3. cooking the easiest stuff I can look up doesn’t look easy enough

#plague


The secret ingredient in the bachelor cooking is being hungry enough to eat it.


My cooking recipes rating system:

⭐ Yes, I would like to join you on a lifelong culinary journey, starting with a charming anecdote from your family travel history.

⭐⭐⭐⭐⭐ FFS, I just want lunch and this doesn’t need a spice rack.


Had this kitchen scale for years, I thought, what if one day it just runs out of battery in the middle of cooking and GUESS WHAT.


Working on a bachelor cooking bullshit scale:

  • every ingredient after third: +1 point
  • every 10 minutes prep after first ten: +2 points
  • needs to be flipped or other involved manipulation in process: +3 points
  • needs to be transferred between stove/oven: +infinity points

While back I paid not for some potatoes, but a reminder that I would not peel potatoes.


Got the thingy that cuts entire apple into slices and using it feels a bit violent and slightly sexy.


Are we sure a moisture absorber pad is not edible, if fried with a nice steak.


Why are recipe sites always like “that’s enough to feed three people!”, then I add it up and “that’s 600 freaking calories total, ARE YOUR PEOPLE OK?”


Tried camembert bites for lunch, so lunch is camembert bites shells and camembert coated oven.


Apparently my bachelor cooking tweets give impression of a disaster. You only hear the failures! I eat fine and quite healthy, no worries. :)

]]>
What can bite you moving from WordPress to Hugo https://www.rarst.net/wordpress/to-hugo/ Mon, 09 Mar 2020 18:00:00 +0300 https://www.rarst.net/wordpress/to-hugo/ <p>I had recently migrated this site to <a href="https://gohugo.io/">Hugo static site generator</a>, after 11+ years run on WordPress. I am happy with the result and didn&rsquo;t want to write an obligatory migration post for the sake of it.</p> <p>There had been several interesting nuances for me as experienced WP dev. This means to give you heads up on some challenges, not cover WordPress/Hugo completely.</p> I had recently migrated this site to Hugo static site generator, after 11+ years run on WordPress. I am happy with the result and didn’t want to write an obligatory migration post for the sake of it.

There had been several interesting nuances for me as experienced WP dev. This means to give you heads up on some challenges, not cover WordPress/Hugo completely.

No native WordPress import

WordPress has a target on its back in regards to other systems eager to import its content. Hugo isn’t concerned though. It suggests third party solutions or migrating WP to Jekyll first, then to import that.

As an experienced wheel reinventor, I ended up rolling own wprss2hugo importer. That took care of everything I needed and PHP implementation ensures I can reuse and adjust.

No categories in post URLs

The /category-name/post-name link structure is very popular in WordPress sites. Unfortunately, Hugo does not support it.

There are two possible approaches to handle it.

Split into sections

Hugo sections are a level of file organization and establish content types, an analogue of WP post types.

It might make sense to split posts from categories into sections and get URLs working that way.

But if the posts are similar or identical in nature, many different content types would be pointless.

There might be a way to find a good balance with subsections here, but I hadn’t found it yet.

Set URL per post

A strong Hugo feature is the ability to assign any page to any arbitrary URL in the front matter. This makes it trivial to import existing posts and keep URLs working.

For new posts, you can start using a different link structure or continue to specify URL in the front matter.

I decided to stick with manual approach and use archetypes to pre–fill it.

No hierarchical taxonomies

You can nest terms in WordPress taxonomies, creating comprehensive layered organization.

Terms in Hugo are flat, they all live on a single level.

I got lucky that I only used terms in a flat way, this could get messy with manual URL assignments.

No hierarchical post types

This one got a little mind–bendy for me. The concepts do not completely align between WordPress and Hugo.

WordPress post types can be hierarchical, with posts nested within each other. WordPress post archives only contain posts.

Hugo content sections determine, among other things, the content type of the pages. You can nest pages within sections, but sections can also contain other sections.

Said in WordPress terminology, you cannot nest posts in Hugo, but you can nest post archives.

It is possible to convert this. Would not be a trivial operation. The logic of nesting levels will change from post–like to archive–like. That impacts templates and more.

No autoembeds (out of the box)

In WordPress, a raw link to some online services in content turns into embedded content.

Hugo does not do this, but it will be possible with Markdown hooks when the feature works for autolinks.

[updated 2022-06-10] This got ironed out and embeds can now be implemented with combination of autolinks and markdown render hooks, see example.

Taxonomy and term templates named backwards

Taxonomy templates naming is a small thing, that nearly fried my brain.

In WordPress, a taxonomy archive template shows posts in a term of a taxonomy. There is no archive showing terms in a taxonomy.

In Hugo, taxonomy list template shows pages in a term of a taxonomy. Taxonomy terms template shows terms in a taxonomy.

Problem is — a list of pages in a term is taxonomy kind and list of terms in a taxonomy is taxonomyTerm kind. taxonomyTerm templates apply to taxonomies (not terms) and taxonomy templates apply to terms (not taxonomies).

I repeatedly wailed “why” before, during, and after figuring this out.

Coming from WordPress you use taxonomy template for your terms. Consider disabling taxonomyTerm via disableKinds, since there is no analogue in the WP site structure.

Go templates are a challenge

Hugo is written in Go programming language and uses html/template package for its templating.

The syntax is not at all C–like, conventions common to PHP and JavaScript are out of the window.

It closer to logic–less Mustache templates and meant for display of passed context data. Problem is — in Hugo you do not have direct control over the passed context. You do not have control over “back–end” implementation at all.

I use Twig and Mustache over native WordPress templates, so I did not expect the learning curve to be that steep. Coming from WordPress, expect this part to hurt.

Overall

It was a great experience, moving from a very open system like WordPress to a very closed like Hugo. I see constraints as important as goals, both in the design of my code and projects I use.

At the moment Hugo is viable alternative for WordPress content site. It aligns better with my current priorities. The learning curve was worth it, for the results I achieved.

Be ready to roll your eyes quite a few times, and have your mind blown a few more.

]]>
Closures crash course for WordPress developers https://www.rarst.net/wordpress/closures-crash-course/ Mon, 01 Apr 2019 18:00:21 +0300 https://www.rarst.net/wordpress/closures-crash-course/ <p>WordPress core is about to <a href="https://make.wordpress.org/core/2018/12/08/updating-the-minimum-php-version/">raise minimum PHP requirement to version 5.6</a>. That brings a wider access to cutting–edge nine years old features, such as <a href="https://www.php.net/manual/en/functions.anonymous.php">anonymous functions</a> (aka closures).</p> <p>Closures had immediately generates some push back against using them with WordPress hooks. That is where they can shine though!</p> WordPress core is about to raise minimum PHP requirement to version 5.6. That brings a wider access to cutting–edge nine years old features, such as anonymous functions (aka closures).

Closures had immediately generates some push back against using them with WordPress hooks. That is where they can shine though!

Inline callbacks

Closure in PHP is a callable. You can use closure like any other callable. Both simpler (functions) and more complex (invokable classes).

In WordPress the common use of callable is a hook callback:

add_filter( 'answer', function () {
	return 42;
} );

So closure can be a quick way to write a callback inline. Closures have many more uses, such as strategies and lazy service definitions.

Scope inheritance

A trivial function callback will only have access to its argument. And a global scope, which is a bad idea.

Closure has another way — it can inherit from parent scope:

foreach ( [ 32, 42, 52 ] as $answer ) {

	add_filter( "answer_{$answer}", function () use ( $answer ) {
		return $answer;
	} );
}

This will create three different callbacks from one definition. Technically anonymous function is a Closure instance. So every time we create a new instance and it can inherit what we want from the current scope.

This is very powerful way to build elaborate callbacks that combine logic with data.

Object binding

Wait, if a closure is an object, does it have $this ? Not a random question. A closure defined inside a class binds to the object’s context so $this refers to the object, not closure itself:

class Answer {

	private $answer = 42;

	public function __construct() {
		add_filter( 'answer', function () {
			return $this->answer;
		} );
	}
}

This is also a very powerful feature. We can build complex callbacks with access to object’s private methods and properties without exposing them as public API.

Removing from hooks

And here is the downside. In WordPress to remove an object–based callback from a hook you need access to the original instance. Without it there is no way to communicate to API which callback you want to be removed.

With closures this can be a challenge. More so when interacting with callbacks from code that is not your own.

But it is shortsighted to consider this downside of a closure! It is much more of a shortcoming on the side of WordPress core.

If you worry about this aspect there are both solid materials on removing closures and a ticket to improve this in WordPress core.

Overall

Anonymous function is a powerful PHP feature. It can be used to build both trivial and elaborate callbacks. Closures have unique abilities to inherit from parent scope and access the object where they were defined.

In WordPress context you don’t want to use closures excessively for hook callbacks, due to current API limitations.

But don’t hesitate to explore them for complex use cases! The benefits of closure outweigh the downsides.

]]>
A month of expenses in Kyiv https://www.rarst.net/thoughts/expenses-in-kiev/ Thu, 31 Jan 2019 19:34:54 +0200 https://www.rarst.net/thoughts/expenses-in-kiev/ <p>The public diaries of monthly expenses seem to be all the rage (and outrage) these days. Money is a touchy subject. I often mention to people from wealthier countries that my living expenses are very different from theirs.</p> <p>So I decided to make a record of my expenses for a month and post it for a more detailed look.</p> The public diaries of monthly expenses seem to be all the rage (and outrage) these days. Money is a touchy subject. I often mention to people from wealthier countries that my living expenses are very different from theirs.

So I decided to make a record of my expenses for a month and post it for a more detailed look.

Living situation

I live in Kyiv, Ukraine. Latest number on average income in the city is $500/mo and country average is $330/mo. The minimum pay is set by government at $151/mo or $0.91/h for 2019.

I am self–employed and my income is relatively high but very uneven.

I live alone in 52 square meters apartment, which I inherited. I cook my meals, I work from home, and I don’t drive.

My largest expense by far is conference travel. I don’t have any this month, so this will be more focused on actual living expenses.

So here we go.

Week 1

  • $10.69 Kiva loan (plus $18 in repaid loans credit)
  • $0.58 metro two ways, family dinner, getting loaded with leftovers :)
  • $39.76 groceries
  • $5.48 household stuff (soap, mouthwash, papers binder)

Week total: $56.51

Week 2

  • $23.95 groceries
  • $17.76 dentist, braces adjustment
  • $2.69 mobile app, no–ads version of workout app, got annoying
  • $1.35 drink, cocoa to go with free meetup pizza
  • $23.27 groceries
  • $7.09 game night, bus, pizza
  • $6.04 uber home, 17km

Week total: $82.15

Week 3

  • $87.11 fixed social tax for last quarter, so let’s count as $29 for the month; don’t owe income tax since had no incoming payments in the period
  • $37.54 groceries
  • $60 Calm subscription, annual so let’s count as $5 for the month
  • $54.30 dentist, deep clean
  • $78.09 utilities
    • $6.73 territory upkeep
    • $47.78 central heating
    • $0.93 garbage pickup
    • $5.99 natural gas (kitchen stove)
    • $2.10 cold water
    • $5.63 hot water (this is off, been a mess and shows I overpaid last month)
    • $3.72 electricity (this is off, they are messing with it at the moment)
    • $3.36 phone landline
    • $1.63 commission for paying online
  • $6.44 charity donation
  • $35.23 groceries
  • $13.86 household stuff (mouthwash, toilet paper, laundry detergent)

Week total: $259.46

Week 4

  • $11.36 netflix
  • $34.06 dentist, braces adjustment
  • $16.04 groceries
  • $4.92 household stuff (dishwashing liquid, tissues)
  • $5.51 PC game, 7 Billion Humans was on Steam sale
  • $44.43 groceries

Week total: $116.32

Week 5

  • $168.86 medical insurance, annual so let’s count as $14.07 for the month
  • $46.56 online course, ES6 from Wes Bos, on sale + poor country discount
  • $32.92 groceries

Week total: $93.55

Annual costs

Some more things and their share in this month:

  • $36.10 internet (100Mbit/s) annual, so $3.01 a month
  • $32.49 mobile pre–paid total for last year, so about $2.71 a month
  • web hosting I paid for 3 years, worked out to something like $23 a month

Other total: $28.72

Summary

Month total: $636.71

Yikes, that’s definitely up, no thanks to endless vortex of dental work.

My food expenses are up. I could spend less by buying more raw ingredients and shopping outside of city center (where I live), but that would waste more time. High food expenses relative to low income are typical in Ukraine. I’ve read studies show on average people spend over 50% of income on food. That’s working half the time just to eat. :(

Also this puts in perspective resources priced to richer countries. For example that JS course is $137 at full price. That’s more than couple weeks of food or bills for nearly two months on my scale.

]]>
Link to the latest GitHub release binary https://www.rarst.net/code/link-latest-github-release-binary/ Mon, 12 Nov 2018 18:00:57 +0200 https://www.rarst.net/code/link-latest-github-release-binary/ <div class="alert alert-info text-center">You can now link directly to a download in the latest release: <code>https://github.com/[USER]/[REPOSITORY]<wbr>/releases/latest<wbr>/download/[FILENAME]</code></div> <p>These days I build my WordPress plugins for Composer install. I still provide standalone releases for people who don’t use it. Now and then people skip over install instructions and download the source of the plugin. Which does not work by itself.</p> <p>I decided to improve this and provide a more visible direct download option in the readme files.</p> You can now link directly to a download in the latest release: https://github.com/[USER]/[REPOSITORY]/releases/latest/download/[FILENAME]

These days I build my WordPress plugins for Composer install. I still provide standalone releases for people who don’t use it. Now and then people skip over install instructions and download the source of the plugin. Which does not work by itself.

I decided to improve this and provide a more visible direct download option in the readme files.

Latest release URL

To host standalone release I generate a zip archive and attach it to a GitHub release. Before I linked to the releases section, e.g. https://github.com/Rarst/laps/releases.

That page can look very busy and in current design links to attached assets are tiny.

You can now use a link that will always go to the latest release, e.g. https://github.com/Rarst/laps/releases/latest.

But it still points to a page, not a direct download.

Latest binary URL

Direct download URL is available via GitHub API though. We need to get to it and a way to send a client to it.

The latest release API call will give us all the information about that, e.g. https://api.github.com/repos/rarst/laps/releases/latest.

GitHub readme files are very static and cannot retrieve this information. For that, I had added a simple WordPress redirect endpoint to my own site. It queries GitHub API and a sends client to the direct download. I have added a white list and caching to it, so that the whole Internet doesn’t start to pipe things through my site. :)

Now I had the link that would always go to the latest release download: https://www.rarst.net/download/laps.

Dynamic image

While I researched this I had noticed that Shields badge service has a dynamic option. It can query arbitrary JSON file, extract data with jsonpath from it, and put into a badge image.

I already use Shields badges on readme pages. That looked like a good way to create a prominent image for the download button.

After some tinkering, I have made a button that queries GitHub API and extracts release file name from it:

https://img.shields.io/badge/dynamic/json.svg?<br></br>label=download<br></br>&url=https://api.github.com/repos/rarst/laps/releases/latest<br></br>&query=$.assets[0].name<br></br>&style=for-the-badge

And the result looks like this:

Large download button with file name in it.

All together

Now I combine the two and get a download button in the readme. It is completely static and GitHub is ok with it. But it will always show and send a client to the very latest release download.

]]> A letter from Fear https://www.rarst.net/thoughts/letter-from-fear/ Mon, 15 Oct 2018 18:00:18 +0300 https://www.rarst.net/thoughts/letter-from-fear/ <p>Couple weeks ago I took some days off the computer to coddle a round of seasonal depression. In that time I listened through the <a href="https://www.calm.com/masterclass">Calm Masterclass</a> “Creative Living Beyond Fear” by <a href="https://www.elizabethgilbert.com/">Elizabeth Gilbert</a>.</p> <p>In it she suggests an interesting exercise to let your fear write you a letter. Here is what my fear wrote and my reply to it.</p> Couple weeks ago I took some days off the computer to coddle a round of seasonal depression. In that time I listened through the Calm Masterclass “Creative Living Beyond Fear” by Elizabeth Gilbert.

In it she suggests an interesting exercise to let your fear write you a letter. Here is what my fear wrote and my reply to it.

Dear Andrey,

This is your Fear writing. You have chased some things to the corners of our mind. I would like to put them straight.

You lack direction. You don’t know where are you headed. And if you did — you wouldn’t know how to start.

You are at the limit of your “smart”. Which was always about enough to get you a pat on the head. And not enough to make a difference.

You question your ambitions in life. And the truth is you have none. Which is for the better, because having them would be but a disappointment of not being able to reach them.

You get to speak out because the Internet gives a megaphone to everyone these days. You don’t get for that to matter any.

You make things no one cares for. And after that, you abandon them to rot.

You are tired of people leaving you. And it won’t be long before the rest of them do.

You are terrified that this is it. And it is.

Dear Fear,

Thank you for getting in touch!

You have been trying to discuss this for a while. And I am sorry that I neglected to participate.

You seem to talk a lot about outcomes. And let us be honest here… When did we ever care about those? When did we care to do anything for a bestowed carrot and not a smug satisfaction of nailing it?

You talk about racing for significance. And I understand that the time for that is finite.

And I am an insignificant strand in the fabric of this marvelous humanity lifeform. Which fascinates me so much whenever I care to look. That left the caves, reached the skies, and heads for the stars.

(You got me a little teary–eyed here, you jerk.)

I might not matter any more as that tiny invisible strand.

But I cannot matter any less.

You talk about things and words we make for others. And they are not for the others, are they?

The things I do I believe in. The things I believe in I would do alone, in the dark, to the audience of a wind blowing them apart. And have a blast.

Many had left us. It was not for nothing. They left all the feelings, and memories, and lessons for us to thrive on.

And everyone who had left… we had to find first. And we will find the people to walk along with us, again and again.

Is this it? Well… this is plenty!

It’s a lovely sunny morning too. Let’s go find something to make.

]]>
External post on light WordPress profilers https://www.rarst.net/wordpress/light-profilers/ Thu, 12 Jul 2018 19:20:54 +0300 https://www.rarst.net/wordpress/light-profilers/ Christie Chirinos had invited me to write a guest post on light WordPress profilers for Caldera Forms blog. Read it there. :) Christie Chirinos had invited me to write a guest post on light WordPress profilers for Caldera Forms blog.

Read it there. :)

]]>
Meditation and naps in an ordinary life https://www.rarst.net/thoughts/meditation-and-naps/ Mon, 15 Jan 2018 18:00:42 +0200 https://www.rarst.net/thoughts/meditation-and-naps/ <p>Internet is full of great material on things like meditation. Delivered by extraordinary people. We listen to the <a href="https://www.ted.com/speakers/matthieu_ricard">happiest in the world scientist Tibetan monk</a>. We get inspired&hellip; For about 15 minutes. We go back to a grey routine.</p> <p>This is my&hellip; ordinary perspective. Meditation, naps, and getting well. From someone who gets through the days, too much screen time, and not enough sun.</p> Internet is full of great material on things like meditation. Delivered by extraordinary people. We listen to the happiest in the world scientist Tibetan monk. We get inspired… For about 15 minutes. We go back to a grey routine.

This is my… ordinary perspective. Meditation, naps, and getting well. From someone who gets through the days, too much screen time, and not enough sun.

Misery credentials

That said there needs to be some challenge to make for an interesting story. Over recent years quite a few things had besieged my mind.

Fear, as my country went through the civil unrest and the hot phase of the war.

Grief, as my grandfather, father, and uncle had passed away.

Loneliness, as my small circle of friends almost disappeared.

Heartbreak, as loneliness veered me into unproductive and unwise romantic crushes.

Burnout, as the job that was everything I (thought I) wanted fizzled out.

Pain, as my body presented a bill for keeping up — in physical suffering.

Perspective

Curiously through all of it I still… functioned. I could make a good living, travel, exercise, and even dress better.

In the ways many people would call vital I was fine.

It just… got hard to think. To dream. To write. To imagine and do.

In the ways that are vital to me I was not.

On immutable

Genes determine about half of us. This number comes up again and again. 50% of alcoholism is genetic. So is 50% of happiness. 50% of this. 50% of that.

This locks us up into challenges that will be with us for life.

This frees us to be ourselves as we are. Embrace the parts of us that are constant. Regardless if we want them to be.

I had to face that I will never be a cheery and upbeat person. I had to stop trying.

On malleable

The half of us might be set in stone. That means the other half is up to us.

We neglect what we can change, as we regret what we cannot.

I had to remember and look for what makes me better. Focus on what gets me through a single day and what improves me over a string of many.

Rest for the body

For much of my life I perceived my mind as borderline separate from concerns of the body. It is easy for obsessive thinker type to do that.

Sooner or later life hammers into you the reality of their connection. As I aged and got buried in problems that became much more clear.

In practical terms that made me pay serious attention to getting enough rest. I always knew I need a good night of sleep. It was hard to commit to that also being an “owl”.

It was harder to face that sometimes I need the rest. Maybe before I even get to the bedtime.

I had practiced naps for a long time and wrote about my staple naps app pzizz before. As things got tough I had to revisit the habit and admit it can be a necessity, not luxury.

Training for the mind

I wrote about meditation site Calm before as well. And turned out it took me a several months more of steady practice to get to the benefits.

The main downfall of an obsessive thinker is the obsessive part. It is second nature to burn away hours and days to spin the thoughts.

And all the thinking tends to leave little time and practice for feeling things.

Mindfulness meditation trains the mind to slow down.

To catch yourself. To draw a line between yourself and a thought. To draw a line between yourself and a feeling.

I realized how much I needed that once I learned to.

Moving forward

As promised this was an ordinary story. I made no heroic effort. I accomplished no heroic achievement.

Things that bring me down are still with me. Some of them will be with me for many years more.

Yet I find my way back to the things that are important to me.

I find my way forward through the things that are hard.

Such is life?

TL;DR

  1. Accept what you cannot change about yourself.
  2. Improve what you can.
  3. Let yourself rest to be able to.
  4. You think, but you are not your thoughts.
  5. You feel, but you are not your feelings.
  6. Exercise your mind to see the difference.
  7. There are apps for that.
]]>
Quest for the wardrobe of my thirties https://www.rarst.net/thoughts/wardrobe/ Mon, 31 Jul 2017 18:00:55 +0300 https://www.rarst.net/thoughts/wardrobe/ <p>This year I had some downtime and finally got to pack up and donate my late father’s clothes. That also prompted me to look at my own wardrobe.</p> <p>Some lurking observations grasped for the spotlight. My closet was full of things I hadn’t worn in years (or ever). What I did wear had degraded to jeans and conference t–shirts.</p> This year I had some downtime and finally got to pack up and donate my late father’s clothes. That also prompted me to look at my own wardrobe.

Some lurking observations grasped for the spotlight. My closet was full of things I hadn’t worn in years (or ever). What I did wear had degraded to jeans and conference t–shirts.

Learn up

For something that we do every single day wardrobe gets little organized effort. Even less so for men, with lower social pressure on them about it.

I didn’t wear things outright ugly, or shoddy, or cheap, or otherwise problematic. But my concept of clothes was primitive:

  1. Formal (suit), which I don’t need.
  2. Not formal, which I have jeans and tees for, right?

I started to read information online for men like me — looking to update their messy ways.

The most helpful resources were:

I realized that my “polar” view of formality wrong:

I had confined myself to most casual and least flexible bottom of the range.

The other important aspects I neglected were:

  1. Fit, which I had realized when I started to exercise.
  2. Color/print, a lot of things I had I didn’t want to wear because of it.

So the steps I needed to take were:

  1. Figure out which style and level of formality is comfortable and functional for me.
  2. Clear out clothes that are useless to me.
  3. Buy clothes that fit my needs well.

While I had no need to go all the way to top of formal, I needed an upgrade from the bottom of informal.

Clear out

All clothes I had passed through a critical look and several questions.

If I hadn’t worn this in years, why so?

Some things needed fixes. Or be remembered. :) A lot were too old to be presentable or still be something I would wear.

Does this fit my body well?

With some time and actual effort I improved about judging what does and doesn’t fit me. Some things with poor fit I liked… hanging in the closet, but not to actually wear. I needed to shorten all my jeans for a perfect fit on length.

Does this work with the rest of clothes I have?

One of the most important lessons was that clothes in neutral look and color work well with each other. Anything bright or ornamented clashes with most other things. Especially other clothes of such kind.

Everything that didn’t pass got the attention it needed or packed up and donated away. This is more of a continuous process though. Some things that did pass initial clear I still get rid of.

Shop

After clear out I went over I had left. This gave me some general idea on what types of clothes I prefer and what brands work well for me.

In recent years many clothes brands postponed entering our market or left it.

After some research I settled on one of the large mall. Among other thing it hosts shops from same “network” which share bonuses and discounts.

I did the two “kinds” of shopping — targeted and exploring.

For targeted I made a list of basics I need to get or replace and shopped for them.

For exploring I wait for sales and make an effort to explore respective store inside out. Note that I don’t buy things because they are on sale. I still look for things that fit in with what I need. Sales make it easier to explore and look for items that are not a priority.

On the cost one big change was thinking in cost per wear. Cheap thing that I won’t wear is an actual waste of money. Something of good quality and flexible will see a lot of use for a long time.

Top things

While it is too much to go over everything item by item, some things made a quick and easy difference for me.

Plain t–shirts

I preferred plain tees before conference ones started to pile up.

Back to plain! They can be harder to find in a sea of colorful and trendy, but worth it. Quality cotton feels great and neutral colors are easy to combine with anything.

Blazer

Blazer is a suit jacket without matching trousers. Modern blazers are available in more casual styles. It makes them perfect upgrade up a level of formal.

I have also discovered that blazer is very flattering item in an older age. More of those shoulders, less of that waist. Suits are menswear staple for a reason. Blazer gets you in on some advantages, without going all formal.

Chinos

Trousers that are not jeans. If all you wear for years is jeans, anything makes for a refreshing and stylish change.

Challenging for me to find a good fit on these. But even first pair in staple khaki color added a lot of flexibility to the wardrobe.

Matchy leather

I put together two baseline shoes–belt–watch “sets” in black and brown. It is a minor detail, but it feels good and serves as a skeleton for an outfit. Pick black or brown, fill in the rest with what goes well with them.

Results

Still a cave–dwelling work–from–home creature on an average day. But being out and about, changes I made to the wardrobe are a lot of difference.

It is easier to pick what I wear and it adds up together to a better put together looks. Day over day I can now switch through outfits, not different tees. :)

I almost fit in at the parties now.

I almost fit in at the parties now. With Sonja Leix at WordCamp Europe 2017.

Out at the conferences I gathered a lot of compliments for the changes I made. Both for the specific items (“Nice shirt/shoes/sweater!”) and the look (“You look different/nice/dapper!”). Which happened before never.

TL;DR

]]>
Calm — site and app for guided meditation https://www.rarst.net/web/calm/ Mon, 10 Jul 2017 18:00:34 +0300 https://www.rarst.net/web/calm/ <p>I had tried meditation several times over past years. In a usual attempt it knocked me out asleep. :)</p> <p>There had been a new breed of meditation apps and services, offering a more guided experience.</p> <p>Calm is such a website/app.</p> I had tried meditation several times over past years. In a usual attempt it knocked me out asleep. :)

There had been a new breed of meditation apps and services, offering a more guided experience.

Calm is such a website/app.

What it does

Site offers selection of background sounds and narrated meditation guides. You can combine the two — ambiance that works for your taste and guide on specific topic.

Calm web site interface.

Calm web site interface.

There is an introductory seven day program. It walks you through concepts and practice of mindfulness meditation.

Strong features

The selection of background sounds is most comprehensive. You are bound to find the one you like. My personal favorite is “rain on leaves”.

I had found guides to be very practical. The tone and pace are right to be instructional, but not overbearing or boring. If you need some background without voice, there is a couple of options without guidance.

Mobile app repeats functionality of the site. That makes for a little clunky interface (more site than app), but everything is there and works.

Downsides

Site is quite pushy to sell you a subscription and is mostly behind a paywall. Even programs, that used to be free before, are now under a paid subscription.

Outside of introductory course only unguided tracks and some samples are free. At $13 monthly price (less if paying for a longer time) it isn’t quite a no–brainer either.

Overall

My profile tells me I had 72 sessions, totaling 15+ hours. So I would say the site is quite nice to use and habit forming. I hadn’t found that much mental benefit, but it fits my day well to wind down after exercise.

If you are looking for more serious practice you would likely have to pony up for subscription. If the price tag is worth will be a quite individual decision.

Site Calm.com

]]>
This XML file does not appear to have any style information associated with it. The document tree is shown below.
<rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0">
<channel>
<title>Rarst.net</title>
<link>https://www.rarst.net/</link>
<description>Recent content on Rarst.net</description>
<generator>Hugo -- gohugo.io</generator>
<language>en-us</language>
<lastBuildDate>Wed, 08 Jun 2022 18:00:00 +0300</lastBuildDate>
<atom:link href="https://www.rarst.net/feed/" rel="self" type="application/rss+xml"/>
<item>
<title>Hashtag #bachelorcooking — one lone man's quest for food</title>
<link>https://www.rarst.net/thoughts/bachelorcooking/</link>
<pubDate>Wed, 08 Jun 2022 18:00:00 +0300</pubDate>
<guid>https://www.rarst.net/thoughts/bachelorcooking/</guid>
<description><p><em>Compiled and lightly edited from <a href="https://twitter.com/Rarst">my twitter account</a>.</em></p> <hr> <p>This pasta smells kinda weird&hellip; My mistake — that is just kitchen towel in my hands on fire.</p></description>
<content:encoded>
<![CDATA[ <p><em>Compiled and lightly edited from <a href="https://twitter.com/Rarst">my twitter account</a>.</em></p> <hr> <p>This pasta smells kinda weird&hellip; My mistake — that is just kitchen towel in my hands on fire.</p> <hr> <p>Today I learned how much soy sauce is too much.</p> <hr> <p>Mix random things, cook until slightly burnt. :(</p> <hr> <p>Chop &amp; char.</p> <hr> <p>Before getting stuff from the package on the frying pan, package needs to be opened. #protip</p> <hr> <p>“Fry until fully cooked” — define “fully cooked”! :(</p> <hr> <p>I usually approach such as “slightly char, subtract two minutes from next attempt”.</p> <hr> <p>Hot things burn.</p> <hr> <ol> <li>Place eggs on a towel, so they don&rsquo;t roll of a table.</li> <li>Grab the towel.</li> <li>:(</li> </ol> <hr> <p>Still can&rsquo;t find soy sauce dose between “can&rsquo;t feel it” and “gosh, like biting a salt block”. :(</p> <hr> <p>Apparently my bookmarks on cooking hadn&rsquo;t been visited in 900-1000 days&hellip; No wonder.</p> <hr> <p>Time pasta and scrambled eggs to be cooked at the same time&hellip; Mission impossible. :(</p> <hr> <p>Narrowly dodged hot frying pan. Pulse is racing.</p> <hr> <p>It&rsquo;s time to sharpen the knives! No, literally — they are dull. Using dull kitchen knife is dangerous, people.</p> <hr> <p>I have fresh bread. Surprised me!</p> <hr> <p>Whatever it is, you can probably add eggs to it.</p> <hr> <p>I have tea and meat.</p> <hr> <p>Fridge has more food than estimated. #winning</p> <hr> <p>Sometimes I wish I could order month worth of food supply in a bag like I do for my cat.</p> <hr> <p>Aaaaand burnt the meat. #FML</p> <hr> <p>Fry X with eggs — creative and open-ended like that.</p> <hr> <p>Cleaned stove went flames-of-hell on my dinner&hellip; uniformly warm food!</p> <hr> <p>The Friday menu is being&hellip; rice-centric.</p> <hr> <p>Longly heated parts of mutilated bird corpses.</p> <hr> <p>Today on a quest for more condiments — tartar sauce with chopped pickles. Not bad for a stupid name.</p> <hr> <p>Salt food with hand without open cut. #protip</p> <hr> <p>In my quest for condiments bought hummus today. Tastes about as weird as its name.</p> <hr> <p>Hummus is growing on me.</p> <hr> <p>Apply heat until you are sure it&rsquo;s dead.</p> <hr> <p>I am out of frying oil. That is a crisis, next only to being out of tea.</p> <hr> <p>Oh crap&hellip; The lid on steamer broke, that&rsquo;s the only way I can manage to cook fish!</p> <hr> <p>Procedure for stale bread: heat in microwave, throw out.</p> <hr> <p>Ate nectarine with a fork. Civilized.</p> <hr> <p>Meat broke out of my dinner alien style. o_0</p> <hr> <p>Smetana was about to expire, so I attempted to drown blini in it, not without success.</p> <hr> <p>Cut finger with an egg.</p> <hr> <p>Last time I boiled khinkali to the explosion point. I guess this time I am having them near-frozen for the opposite data point.</p> <hr> <p><em>Observes recurrently exploded khinkali</em> &hellip;I start to question accuracy of instructions on packaging.</p> <hr> <p>Too much hot liquid on flat plate — not good.</p> <hr> <p>I will not explode khinkali this time, I will not explode khinkali this time&hellip;</p> <hr> <p>I have a fork, I need a knife&hellip; &hellip;I have two forks?</p> <hr> <p>Fried too much fries.</p> <hr> <p>When you suddenly recall a forgotten food item in the fridge and are afraid to look.</p> <hr> <p>I don&rsquo;t eat much, but when I do it&rsquo;s because stuff is about to expire.</p> <hr> <p>I think my cooking evolution is missing a path to take from “apply heat” to something more&hellip; Advanced.</p> <hr> <p>Found &amp; fried.</p> <hr> <p>Mystery injury — when you look at that burn and struggle to reconstruct an earlier kitchen action.</p> <hr> <p>I have sugar! I just forgot what it&rsquo;s used for.</p> <hr> <p>Eastern veggies and green tea. Not because fancy, but because that&rsquo;s what&rsquo;s left.</p> <hr> <p>When you grab a pan, expect it empty and washed, and weight tells you it&rsquo;s not, and suddenly the fear of opening it shoots through.</p> <hr> <p>Pain works in a stupid ways. I got the point, only touched that frying pan for like fraction of a second! No need to go on!</p> <hr> <p>Fried chicken&hellip; components.</p> <hr> <p>Set pasta on fire. :(</p> <hr> <p>A. Dying in a fireball. Q. Really, what&rsquo;s the worst that could happen while charging kitchen lighter?</p> <hr> <p>How I see culinary — technique for reducing expenses by diluting meat with other materials.</p> <hr> <p><em>Polishes meh pizza with bleh ice-cream.</em></p> <hr> <p>How does one eat without microwave?</p> <hr> <p>Was ordering meat grinder for grandmother and added air grill for myself. Excited to ruin meat in a new way this evening.</p> <hr> <p>Strangely, overcooked meat and undercooked rice don&rsquo;t add up to average meal.</p> <hr> <p>The mission “Meat 2” into the new air grill is a go. Wish it luck.</p> <p>The “Meat 2” mission had begun re–entry into kitchen space, thermal equalization in progress</p> <p>“Meat 2” has no signs of ruinous heat damage and is detectably edible. The dinner future is secure.</p> <hr> <p>Discovered the one true purpose of the air grill thing and it&rsquo;s heating up frozen pizza (yes, it&rsquo;s hawaiian, deal with it).</p> <hr> <p>Snacked with a chunk of cold rigid dry meat like a man.</p> <hr> <p>The Far Away Corners of the Fridge — episode number about next to last “Fish Sticks”.</p> <hr> <p>Finally got both meat and marinade at the same time!</p> <hr> <p>Calorie bomb class lasagna dinner to recharge after week of barely eating.</p> <hr> <p>Gotta say I am not too fond of this “will meat marinate before I starve” game.</p> <hr> <p>Had finally found the perfect 12 minutes mark on the convection oven timer (11 minutes is half-frozen, 13 minutes is charred).</p> <hr> <p>Getting comfortable at using convection oven. I should bake something.</p> <hr> <p>Potatoes are high–maintenance delicacy.</p> <hr> <p>Is there expression for preemptive comfort food? anyway — pizza for breakfast.</p> <hr> <p>Cut through the plate. Better than arm or something, I suppose.</p> <hr> <p>Sharpened the kitchen knives. #scared</p> <hr> <p>Think I am past “baking” stage here and simply am torturing this apple pie out of its misery. :(</p> <hr> <p>Pro — edible.</p> <p>Con — soul draining failure in the next galaxy to what it should be.</p> <hr> <p>Rules:</p> <ol> <li>Everything can cut you</li> <li>Everything is flammable</li> <li>There are no exceptions to 1 &amp; 2</li> </ol> <hr> <p>Pie is a lie. :(</p> <hr> <p>There is always something to fry in far corner of the fridge.</p> <hr> <p>Ah, the crisp feeling of kitchen towel just out of laundry&hellip; <em>drops it into mayo</em> &hellip;it doesn&rsquo;t last.</p> <hr> <p>Cracked egg. With a knife. I recently sharpened. Split egg in two &amp; stopped short of doing same to my hand. #nearmiss</p> <hr> <p>All food can explode.</p> <hr> <p>I don&rsquo;t peel.</p> <hr> <p>Hmmm&hellip; Hmmm&hellip; Hmmm&hellip; Forgot salt. &gt;_&lt;</p> <hr> <p>Cook rice without salt for one day and you facepalm once. Cook rice without salt for five days and, well, you get the math.</p> <hr> <p>Pack of veggies with mini corns. NOPE. with <em>one single piece</em> of mini corn. Boo.</p> <hr> <p>Rather irrational pang of wanting to do the cooking over, because I started the timer with a wrong label (right duration).</p> <hr> <p>After family event yesterday mom packed me raw meat to air grill. This is what happens when you admit to know what to do&hellip;</p> <hr> <p>YouTube spams “how to master 5 basic cooking skills” video for me to watch&hellip; there are FIVE?</p> <hr> <p>My most polished skill in the kitchen is stopping just short of hitting my head on open cupboards’ doors. Practice!</p> <hr> <p>Made breakfast plans. Set things on fire. Made other breakfast plans.</p> <hr> <p>Bought new frying pan. I wish these things just broke in two after a while instead of that coating subtly going to shit.</p> <hr> <p>Good time for fried eggs — week you bought them.</p> <p>Not good time — week you remembered you have some from long ago.</p> <hr> <p>I had <em>just</em> figured out today that they actually sell pre–made pasta sauces. Wow.</p> <hr> <p>Can You Eat Nothing But Cookies All Day, One Man’s Quest To Find Out</p> <hr> <p>My general peeling technique is roughly “chop to the the cube form”.</p> <hr> <p><del>941</del> 0 days since pasta was set on fire.</p> <hr> <p>Degradation of dinner plans:</p> <ul> <li> <p>cooking</p> </li> <li> <p>cooking, but not dishes</p> </li> <li> <p>not cooking, not dishes</p> </li> <li> <p>&hellip;something?</p> </li> <li> <p>bowl of hummus</p> </li> </ul> <hr> <p>My digital kitchen scales are weird. I weight spaghetti, break it in half, put it back, and and <em>it weights less</em>. What.</p> <hr> <p>My omelets somehow got worse lately, I didn’t think there was a room for regress there.</p> <hr> <p>Blew up a plate in the microwave. That’s new.</p> <hr> <p>Morale boost dinner (ice cream).</p> <hr> <p>A theory: people who diss soylent move houses instead of cleaning their stove.</p> <hr> <p>(eggs) have a nice day!</p> <p>(me) don’t make this awkward&hellip; <em>approaches with a knife</em></p> <p>They still print random stuff on them.</p> <hr> <p>Pro — kitchen is not on fire.</p> <p>Con — smoke and burnt plastic smell hint that it was the last pot of tea I got out of my tea maker earlier. :(</p> <hr> <p>Got bunch of things done all over and picked up replacement tea maker. May this one not catch fire.</p> <hr> <ol start="4"> <li>Don’t do it naked</li> <li>Don’t ask about rule 4</li> </ol> <hr> <p>Current level of having it together — cake for breakfast because I screwed up with groceries yesterday.</p> <hr> <p>Finally unpacking and setting up the replacement tea maker, may it not catch fire&hellip;</p> <hr> <p>Dodged a shower of boiling oil and, while I need a new frying pan, this is most alive I’ve felt in a while.</p> <hr> <p>Steamer lid crumbled into pieces. AGAIN. seriously, could they just make it from the same stuff as the rest of it?..</p> <hr> <p>Reminded I am incapable of cooking beef.</p> <hr> <p>I’ve learned that asparagus is expensive because it takes multiple years to grow and you need to have a specific gene to notice that it makes pee smell bad.</p> <p>Worst. Superpower. Ever.</p> <hr> <p>Got ingredients for honey garlic chicken thighs with green pepper and site with explanation how to cook them is down. Swell. :(</p> <p><em>fries a pack of frozen veggies for lunch</em></p> <hr> <ol start="6"> <li>Don’t eat in the dark and a good shirt</li> </ol> <hr> <p>Caught a falling sandwich. With my hip. Guess which side down.</p> <hr> <p>I drowned the last stroopwafel in the tea cup, and everyone is mad at me.</p> <hr> <p>Made guacamole, but forgot to buy potatoes for chips, so it had to be refactored into avocado egg salad.</p> <hr> <p>Missed groceries run due to back pain, and my remaining foods are eggs, bacon, and bunch of grains. I can totally cook three meals out of this today! As long as one of them is ordering pizza.</p> <hr> <p>Made banana pancakes, in spirit, if not in shape.</p> <hr> <p>For a lunch salad I chopped vegetables onto a plate and squeezed mayonnaise onto myself, let’s call it a partial success.</p> <hr> <p>Schrödinger’s kitchen mess — when you drop an open pack of Philadelphia upside down and you don’t know until you lift it&hellip;</p> <hr> <p>The good news there was cheese to go with lunch, the bad news I found out what was smelling up the fridge. 🤢</p> <hr> <p>Been scanning all the food barcodes into calorie tracker and I can happily report it confirmed that bar of chocolate is a valid dinner.</p> <hr> <p>It’s nice that I was learning math for like 17 years of my life, so I can do complex calculations, like fit a pizza into diet’s daily calories limit&hellip;</p> <hr> <p>Grabbed a small frozen pizza with groceries on weekend and discovered it was made with “cheese analogue”. LIES. there is no cheese analogue, there is only cheese and not cheese!!</p> <hr> <p>Brown rice,</p> <p>I tried to love you,</p> <p>but no.</p> <hr> <p>It’s been a while since I held a brush&hellip; painting BBQ sauce on a chicken breast.</p> <hr> <p>Honestly, I was skeptical, but “pound chicken with your fist” is indeed an essential recipe step. it doesn’t cook as well if you don’t establish dominance upfront.</p> <hr> <p>Culinary I am on intersection of:</p> <ol> <li> <p>sick of same stuff</p> </li> <li> <p>shopping for groceries twice less often sucks</p> </li> <li> <p>cooking the easiest stuff I can look up doesn&rsquo;t look easy enough</p> </li> </ol> <p>#plague</p> <hr> <p>The secret ingredient in the bachelor cooking is being hungry enough to eat it.</p> <hr> <p>My cooking recipes rating system:</p> <p>⭐ Yes, I would like to join you on a lifelong culinary journey, starting with a charming anecdote from your family travel history.</p> <p>⭐⭐⭐⭐⭐ FFS, I just want lunch and this doesn&rsquo;t need a spice rack.</p> <hr> <p>Had this kitchen scale for years, I thought, what if one day it just runs out of battery in the middle of cooking and GUESS WHAT.</p> <hr> <p>Working on a bachelor cooking bullshit scale:</p> <ul> <li>every ingredient after third: +1 point</li> <li>every 10 minutes prep after first ten: +2 points</li> <li>needs to be flipped or other involved manipulation in process: +3 points</li> <li>needs to be transferred between stove/oven: +infinity points</li> </ul> <hr> <p>While back I paid not for some potatoes, but a reminder that I would not peel potatoes.</p> <hr> <p>Got the thingy that cuts entire apple into slices and using it feels a bit violent and slightly sexy.</p> <hr> <p>Are we sure a moisture absorber pad is not edible, if fried with a nice steak.</p> <hr> <p>Why are recipe sites always like “that&rsquo;s enough to feed three people!”, then I add it up and “that&rsquo;s 600 freaking calories total, ARE YOUR PEOPLE OK?”</p> <hr> <p>Tried camembert bites for lunch, so lunch is camembert bites shells and camembert coated oven.</p> <hr> <p>Apparently my bachelor cooking tweets give impression of a disaster. You only hear the failures! I eat fine and quite healthy, no worries. :)</p> ]]>
</content:encoded>
</item>
<item>
<title>What can bite you moving from WordPress to Hugo</title>
<link>https://www.rarst.net/wordpress/to-hugo/</link>
<pubDate>Mon, 09 Mar 2020 18:00:00 +0300</pubDate>
<guid>https://www.rarst.net/wordpress/to-hugo/</guid>
<description><p>I had recently migrated this site to <a href="https://gohugo.io/">Hugo static site generator</a>, after 11+ years run on WordPress. I am happy with the result and didn&rsquo;t want to write an obligatory migration post for the sake of it.</p> <p>There had been several interesting nuances for me as experienced WP dev. This means to give you heads up on some challenges, not cover WordPress/Hugo completely.</p></description>
<content:encoded>
<![CDATA[ <p>I had recently migrated this site to <a href="https://gohugo.io/">Hugo static site generator</a>, after 11+ years run on WordPress. I am happy with the result and didn&rsquo;t want to write an obligatory migration post for the sake of it.</p> <p>There had been several interesting nuances for me as experienced WP dev. This means to give you heads up on some challenges, not cover WordPress/Hugo completely.</p> <h2 id="no-native-wordpress-import">No native WordPress import</h2> <p>WordPress has a target on its back in regards to other systems eager to import its content. Hugo isn&rsquo;t concerned though. It <a href="https://gohugo.io/tools/migrations/#wordpress">suggests third party solutions</a> or migrating WP to <a href="https://jekyllrb.com/">Jekyll</a> first, then to import that.</p> <p>As an experienced wheel reinventor, I ended up rolling own <a href="https://github.com/Rarst/wprss2hugo">wprss2hugo importer</a>. That took care of everything I needed and PHP implementation ensures I can reuse and adjust.</p> <h2 id="no-categories-in-post-urls">No categories in post URLs</h2> <p>The <code>/category-name/post-name</code> link structure is very popular in WordPress sites. Unfortunately, Hugo does not support it.</p> <p>There are two possible approaches to handle it.</p> <h3 id="split-into-sections">Split into sections</h3> <p>Hugo <a href="https://gohugo.io/content-management/sections/">sections</a> are a level of file organization and establish <a href="https://gohugo.io/content-management/types/">content types</a>, an analogue of WP post types.</p> <p>It might make sense to split posts from categories into sections and get URLs working that way.</p> <p>But if the posts are similar or identical in nature, many different content types would be pointless.</p> <p>There might be a way to find a good balance with subsections here, but I hadn&rsquo;t found it yet.</p> <h3 id="set-url-per-post">Set URL per post</h3> <p>A strong Hugo feature is the ability to <a href="https://gohugo.io/content-management/urls/#set-url-in-front-matter">assign any page to any arbitrary URL in the front matter</a>. This makes it trivial to import existing posts and keep URLs working.</p> <p>For new posts, you can start using a different link structure or continue to specify URL in the front matter.</p> <p>I decided to stick with manual approach and use <a href="https://gohugo.io/content-management/archetypes/">archetypes</a> to pre–fill it.</p> <h2 id="no-hierarchical-taxonomies">No hierarchical taxonomies</h2> <p>You can nest terms in WordPress taxonomies, creating comprehensive layered organization.</p> <p><a href="https://gohugo.io/content-management/taxonomies/">Terms in Hugo</a> are flat, they all live on a single level.</p> <p>I got lucky that I only used terms in a flat way, this could get messy with manual URL assignments.</p> <h2 id="no-hierarchical-post-types">No hierarchical post types</h2> <p>This one got a little mind–bendy for me. The concepts do not completely align between WordPress and Hugo.</p> <p>WordPress <em>post types</em> can be hierarchical, with <em>posts</em> nested within each other. WordPress post <em>archives</em> only contain posts.</p> <p>Hugo <em>content sections</em> determine, among other things, the <em>content type</em> of the <em>pages</em>. You can nest pages within sections, but <strong>sections can also contain other sections</strong>.</p> <p>Said in WordPress terminology, <strong>you cannot nest posts in Hugo, but you can nest post archives</strong>.</p> <p>It is possible to convert this. Would not be a trivial operation. The logic of nesting levels will change from post–like to archive–like. That impacts templates and more.</p> <h2 id="no-autoembeds-out-of-the-box">No autoembeds (out of the box)</h2> <p>In WordPress, a raw link to some online services in content <a href="https://wordpress.org/support/article/embeds/">turns into embedded content</a>.</p> <p>Hugo does not do this, but it will be possible with Markdown hooks <a href="https://github.com/gohugoio/hugo/issues/6667">when the feature works for autolinks</a>.</p> <p><strong>[updated 2022-06-10]</strong> This got ironed out and embeds can now be implemented with combination of autolinks and <a href="https://gohugo.io/templates/render-hooks/">markdown render hooks</a>, <a href="https://gist.github.com/Rarst/3a4af07fa061a1bf2be4dc1beb42311d">see example</a>.</p> <h2 id="taxonomy-and-term-templates-named-backwards">Taxonomy and term templates named backwards</h2> <p><a href="https://gohugo.io/templates/taxonomy-templates/">Taxonomy templates</a> naming is a small thing, that nearly fried my brain.</p> <p>In WordPress, a <em>taxonomy archive</em> template shows <em>posts</em> in a <em>term</em> of a <em>taxonomy</em>. There is <strong>no</strong> archive showing terms in a taxonomy.</p> <p>In Hugo, <em>taxonomy list</em> template shows <em>pages</em> in a <em>term</em> of a <em>taxonomy</em>. <em>Taxonomy terms</em> template shows <em>terms</em> in a <em>taxonomy</em>.</p> <p>Problem is — a list of pages in a term is <code>taxonomy</code> <code>kind</code> and list of terms in a taxonomy is <code>taxonomyTerm</code> <code>kind</code>. <strong><code>taxonomyTerm</code> templates apply to taxonomies (not terms)</strong> and <strong><code>taxonomy</code> templates apply to terms (not taxonomies)</strong>.</p> <p>I repeatedly wailed <em>“why”</em> before, during, and after figuring this out.</p> <p>Coming from WordPress you use taxonomy template for your terms. Consider <a href="https://gohugo.io/content-management/taxonomies/#default-taxonomies">disabling <code>taxonomyTerm</code> via <code>disableKinds</code></a>, since there is no analogue in the WP site structure.</p> <h2 id="go-templates-are-a-challenge">Go templates are a challenge</h2> <p>Hugo is written in <a href="https://golang.org/">Go programming language</a> and uses <a href="https://golang.org/pkg/html/template/">html/template</a> package for <a href="https://gohugo.io/templates/introduction/">its templating</a>.</p> <p>The syntax is not at all C–like, conventions common to PHP and JavaScript are out of the window.</p> <p>It closer to logic–less <a href="https://mustache.github.io/">Mustache</a> templates and meant for display of passed context data. Problem is — <strong>in Hugo you do not have direct control over the passed context</strong>. You do not have control over “back–end” implementation at all.</p> <p>I use <a href="https://twig.symfony.com/">Twig</a> and Mustache over native WordPress templates, so I did not expect the learning curve to be that steep. Coming from WordPress, expect this part to hurt.</p> <h2 id="overall">Overall</h2> <p>It was a great experience, moving from a very open system like WordPress to a very closed like Hugo. I see constraints as important as goals, both in the design of my code and projects I use.</p> <p>At the moment Hugo is viable alternative for WordPress content site. It aligns better with my current priorities. The learning curve was worth it, for the results I achieved.</p> <p>Be ready to roll your eyes quite a few times, and have your mind blown a few more.</p> ]]>
</content:encoded>
</item>
<item>
<title>Closures crash course for WordPress developers</title>
<link>https://www.rarst.net/wordpress/closures-crash-course/</link>
<pubDate>Mon, 01 Apr 2019 18:00:21 +0300</pubDate>
<guid>https://www.rarst.net/wordpress/closures-crash-course/</guid>
<description><p>WordPress core is about to <a href="https://make.wordpress.org/core/2018/12/08/updating-the-minimum-php-version/">raise minimum PHP requirement to version 5.6</a>. That brings a wider access to cutting–edge nine years old features, such as <a href="https://www.php.net/manual/en/functions.anonymous.php">anonymous functions</a> (aka closures).</p> <p>Closures had immediately generates some push back against using them with WordPress hooks. That is where they can shine though!</p></description>
<content:encoded>
<![CDATA[ <p>WordPress core is about to <a href="https://make.wordpress.org/core/2018/12/08/updating-the-minimum-php-version/">raise minimum PHP requirement to version 5.6</a>. That brings a wider access to cutting–edge nine years old features, such as <a href="https://www.php.net/manual/en/functions.anonymous.php">anonymous functions</a> (aka closures).</p> <p>Closures had immediately generates some push back against using them with WordPress hooks. That is where they can shine though!</p> <h2 id="inline-callbacks">Inline callbacks</h2> <p>Closure in PHP is a <a href="https://www.php.net/manual/en/language.types.callable.php">callable</a>. You can use closure like any other callable. Both simpler (functions) and more complex (invokable classes).</p> <p>In WordPress the common use of callable is a hook callback:</p> <div class="highlight"><pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-php" data-lang="php"><span style="display:flex;"><span>add_filter( <span style="color:#2aa198">&#39;answer&#39;</span>, <span style="color:#719e07">function</span> () { </span></span><span style="display:flex;"><span> <span style="color:#719e07">return</span> <span style="color:#2aa198">42</span>; </span></span><span style="display:flex;"><span>} ); </span></span></code></pre></div><p>So closure can be a quick way to write a callback inline. Closures have many more uses, such as strategies and lazy service definitions.</p> <h2 id="scope-inheritance">Scope inheritance</h2> <p>A trivial function callback will only have access to its argument. And a global scope, which is a bad idea.</p> <p>Closure has another way — it can inherit from parent scope:</p> <div class="highlight"><pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-php" data-lang="php"><span style="display:flex;"><span><span style="color:#719e07">foreach</span> ( [ <span style="color:#2aa198">32</span>, <span style="color:#2aa198">42</span>, <span style="color:#2aa198">52</span> ] <span style="color:#719e07">as</span> <span style="color:#268bd2">$answer</span> ) { </span></span><span style="display:flex;"><span> </span></span><span style="display:flex;"><span> add_filter( <span style="color:#2aa198">&#34;answer_</span><span style="color:#2aa198">{</span><span style="color:#268bd2">$answer</span><span style="color:#2aa198">}</span><span style="color:#2aa198">&#34;</span>, <span style="color:#719e07">function</span> () <span style="color:#719e07">use</span> ( <span style="color:#268bd2">$answer</span> ) { </span></span><span style="display:flex;"><span> <span style="color:#719e07">return</span> <span style="color:#268bd2">$answer</span>; </span></span><span style="display:flex;"><span> } ); </span></span><span style="display:flex;"><span>} </span></span></code></pre></div><p>This will create three <em>different</em> callbacks from one definition. Technically anonymous function is a <a href="https://www.php.net/manual/en/class.closure.php">Closure</a> instance. So every time we create a new instance and it can inherit what we want from the current scope.</p> <p>This is <em>very</em> powerful way to build elaborate callbacks that combine logic with data.</p> <h2 id="object-binding">Object binding</h2> <p>Wait, if a closure is an object, does it have $this ? Not a random question. A closure defined inside a class binds to the object’s context so $this refers to the object, not closure itself:</p> <div class="highlight"><pre tabindex="0" style="color:#93a1a1;background-color:#002b36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-php" data-lang="php"><span style="display:flex;"><span><span style="color:#719e07">class</span> <span style="color:#268bd2">Answer</span> { </span></span><span style="display:flex;"><span> </span></span><span style="display:flex;"><span> <span style="color:#719e07">private</span> <span style="color:#268bd2">$answer</span> <span style="color:#719e07">=</span> <span style="color:#2aa198">42</span>; </span></span><span style="display:flex;"><span> </span></span><span style="display:flex;"><span> <span style="color:#719e07">public</span> <span style="color:#719e07">function</span> __construct() { </span></span><span style="display:flex;"><span> add_filter( <span style="color:#2aa198">&#39;answer&#39;</span>, <span style="color:#719e07">function</span> () { </span></span><span style="display:flex;"><span> <span style="color:#719e07">return</span> <span style="color:#268bd2">$this</span><span style="color:#719e07">-&gt;</span>answer; </span></span><span style="display:flex;"><span> } ); </span></span><span style="display:flex;"><span> } </span></span><span style="display:flex;"><span>} </span></span></code></pre></div><p>This is also a very powerful feature. We can build complex callbacks with access to object’s private methods and properties without exposing them as public API.</p> <h2 id="removing-from-hooks">Removing from hooks</h2> <p>And here is the downside. In WordPress to remove an object–based callback from a hook you need access to the original instance. Without it there is no way to communicate to API which callback you want to be removed.</p> <p>With closures this can be a challenge. More so when interacting with callbacks from code that is not your own.</p> <p>But it is shortsighted to consider this downside of a closure! It is much more of a shortcoming on the side of WordPress core.</p> <p>If you worry about this aspect there are both solid <a href="https://inpsyde.com/en/remove-wordpress-hooks/">materials on removing closures</a> and a <a href="https://core.trac.wordpress.org/ticket/46635">ticket to improve this in WordPress core</a>.</p> <h2 id="overall">Overall</h2> <p>Anonymous function is a powerful PHP feature. It can be used to build both trivial and elaborate callbacks. Closures have unique abilities to inherit from parent scope and access the object where they were defined.</p> <p>In WordPress context you don’t want to use closures <em>excessively</em> for hook callbacks, due to current API limitations.</p> <p>But don&rsquo;t hesitate to explore them for complex use cases! The benefits of closure outweigh the downsides.</p> ]]>
</content:encoded>
</item>
<item>
<title>A month of expenses in Kyiv</title>
<link>https://www.rarst.net/thoughts/expenses-in-kiev/</link>
<pubDate>Thu, 31 Jan 2019 19:34:54 +0200</pubDate>
<guid>https://www.rarst.net/thoughts/expenses-in-kiev/</guid>
<description><p>The public diaries of monthly expenses seem to be all the rage (and outrage) these days. Money is a touchy subject. I often mention to people from wealthier countries that my living expenses are very different from theirs.</p> <p>So I decided to make a record of my expenses for a month and post it for a more detailed look.</p></description>
<content:encoded>
<![CDATA[ <p>The public diaries of monthly expenses seem to be all the rage (and outrage) these days. Money is a touchy subject. I often mention to people from wealthier countries that my living expenses are very different from theirs.</p> <p>So I decided to make a record of my expenses for a month and post it for a more detailed look.</p> <h2 id="living-situation">Living situation</h2> <p>I live in Kyiv, Ukraine. Latest number on average income in the city is $500/mo and country average is $330/mo. The minimum pay is set by government at $151/mo or $0.91/h for 2019.</p> <p>I am self–employed and my income is relatively high but very uneven.</p> <p>I live alone in 52 square meters apartment, which I inherited. I cook my meals, I work from home, and I don’t drive.</p> <p>My largest expense by far is conference travel. I don’t have any this month, so this will be more focused on actual living expenses.</p> <p>So here we go.</p> <h2 id="week-1">Week 1</h2> <ul> <li><strong>$10.69 Kiva loan</strong> (plus $18 in repaid loans credit)</li> <li><strong>$0.58 metro two ways</strong>, family dinner, getting loaded with leftovers :)</li> <li><strong>$39.76 groceries</strong></li> <li><strong>$5.48 household stuff</strong> (soap, mouthwash, papers binder)</li> </ul> <p>Week total: <strong>$56.51</strong></p> <h2 id="week-2">Week 2</h2> <ul> <li><strong>$23.95 groceries</strong></li> <li><strong>$17.76 dentist</strong>, braces adjustment</li> <li><strong>$2.69 mobile app</strong>, no–ads version of workout app, got annoying</li> <li><strong>$1.35 drink</strong>, cocoa to go with free meetup pizza</li> <li><strong>$23.27 groceries</strong></li> <li><strong>$7.09 game night</strong>, bus, pizza</li> <li><strong>$6.04 uber</strong> home, 17km</li> </ul> <p>Week total: <strong>$82.15</strong></p> <h2 id="week-3">Week 3</h2> <ul> <li>$87.11 <strong>fixed social tax</strong> for last quarter, so let’s count as <strong>$29</strong> for the month; don’t owe income tax since had no incoming payments in the period</li> <li><strong>$37.54 groceries</strong></li> <li>$60 <strong>Calm subscription</strong>, annual so let’s count as <strong>$5</strong> for the month</li> <li><strong>$54.30 dentist</strong>, deep clean</li> <li><strong>$78.09 utilities</strong> <ul> <li><em>$6.73 territory upkeep</em></li> <li><em>$47.78 central heating</em></li> <li><em>$0.93 garbage pickup</em></li> <li><em>$5.99 natural gas</em> (kitchen stove)</li> <li><em>$2.10 cold water</em></li> <li><em>$5.63 hot water</em> (this is off, been a mess and shows I overpaid last month)</li> <li><em>$3.72 electricity</em> (this is off, they are messing with it at the moment)</li> <li><em>$3.36 phone landline</em></li> <li><em>$1.63 commission</em> for paying online</li> </ul> </li> <li><strong>$6.44 charity donation</strong></li> <li><strong>$35.23 groceries</strong></li> <li><strong>$13.86 household stuff</strong> (mouthwash, toilet paper, laundry detergent)</li> </ul> <p>Week total: <strong>$259.46</strong></p> <h2 id="week-4">Week 4</h2> <ul> <li><strong>$11.36 netflix</strong></li> <li><strong>$34.06 dentist</strong>, braces adjustment</li> <li><strong>$16.04 groceries</strong></li> <li><strong>$4.92 household stuff</strong> (dishwashing liquid, tissues)</li> <li><strong>$5.51 PC game</strong>, 7 Billion Humans was on Steam sale</li> <li><strong>$44.43 groceries</strong></li> </ul> <p>Week total: <strong>$116.32</strong></p> <h2 id="week-5">Week 5</h2> <ul> <li>$168.86 <strong>medical insurance</strong>, annual so let’s count as <strong>$14.07</strong> for the month</li> <li><strong>$46.56 online course</strong>, ES6 from Wes Bos, on sale + poor country discount</li> <li><strong>$32.92 groceries</strong></li> </ul> <p>Week total: <strong>$93.55</strong></p> <h2 id="annual-costs">Annual costs</h2> <p>Some more things and their share in this month:</p> <ul> <li>$36.10 <strong>internet</strong> (100Mbit/s) annual, so <strong>$3.01</strong> a month</li> <li>$32.49 <strong>mobile</strong> pre–paid total for last year, so about <strong>$2.71</strong> a month</li> <li><strong>web hosting</strong> I paid for 3 years, worked out to something like <strong>$23</strong> a month</li> </ul> <p>Other total: <strong>$28.72</strong></p> <h2 id="summary">Summary</h2> <p>Month total: <strong>$636.71</strong></p> <p>Yikes, that’s definitely up, no thanks to endless vortex of dental work.</p> <p>My food expenses are up. I could spend less by buying more raw ingredients and shopping outside of city center (where I live), but that would waste more <em>time</em>. High food expenses relative to low income are typical in Ukraine. I&rsquo;ve read studies show on average people spend over 50% <em>of income</em> on food. That&rsquo;s working half the time just to eat. :(</p> <p>Also this puts in perspective resources priced to richer countries. For example that JS course is $137 at full price. That’s more than couple weeks of food or bills for nearly two months on my scale.</p> ]]>
</content:encoded>
</item>
<item>
<title>Link to the latest GitHub release binary</title>
<link>https://www.rarst.net/code/link-latest-github-release-binary/</link>
<pubDate>Mon, 12 Nov 2018 18:00:57 +0200</pubDate>
<guid>https://www.rarst.net/code/link-latest-github-release-binary/</guid>
<description><div class="alert alert-info text-center">You can now link directly to a download in the latest release: <code>https://github.com/[USER]/[REPOSITORY]<wbr>/releases/latest<wbr>/download/[FILENAME]</code></div> <p>These days I build my WordPress plugins for Composer install. I still provide standalone releases for people who don’t use it. Now and then people skip over install instructions and download the source of the plugin. Which does not work by itself.</p> <p>I decided to improve this and provide a more visible direct download option in the readme files.</p></description>
<content:encoded>
<![CDATA[ <div class="alert alert-info text-center">You can now link directly to a download in the latest release: <code>https://github.com/[USER]/[REPOSITORY]<wbr>/releases/latest<wbr>/download/[FILENAME]</code></div> <p>These days I build my WordPress plugins for Composer install. I still provide standalone releases for people who don’t use it. Now and then people skip over install instructions and download the source of the plugin. Which does not work by itself.</p> <p>I decided to improve this and provide a more visible direct download option in the readme files.</p> <h2 id="latest-release-url">Latest release URL</h2> <p>To host standalone release I generate a zip archive and attach it to a GitHub release. Before I linked to the releases section, e.g. <code>https://github.com/Rarst/laps/releases</code>.</p> <p>That page can look very busy and in current design links to attached assets are tiny.</p> <p>You can now use a link that will always go to the latest release, e.g. <code>https://github.com/Rarst/laps/releases/latest</code>.</p> <p>But it still points to a <em>page</em>, not a direct download.</p> <h2 id="latest-binary-url">Latest binary URL</h2> <p>Direct download URL is available via GitHub API though. We need to get to it and a way to send a client to it.</p> <p>The <a href="https://developer.github.com/v3/repos/releases/#get-the-latest-release">latest release</a> API call will give us all the information about that, e.g. <code>https://api.github.com/repos/rarst/laps/releases/latest</code>.</p> <p>GitHub readme files are very static and cannot retrieve this information. For that, I had added a simple <a href="https://gist.github.com/Rarst/d75dbd6d9c77e5f33940d1e5abc931d0">WordPress redirect endpoint</a> to my own site. It queries GitHub API and a sends client to the direct download. I have added a white list and caching to it, so that the whole Internet doesn’t start to pipe things through my site. :)</p> <p>Now I had the link that would always go to the latest release download: <code>https://www.rarst.net/download/laps</code>.</p> <h2 id="dynamic-image">Dynamic image</h2> <p>While I researched this I had noticed that <a href="https://shields.io/">Shields badge service</a> has a dynamic option. It can query arbitrary JSON file, extract data with <a href="https://www.npmjs.com/package/jsonpath">jsonpath</a> from it, and put into a badge image.</p> <p>I already use Shields badges on readme pages. That looked like a good way to create a prominent image for the download button.</p> <p>After some tinkering, I have made a button that queries GitHub API and extracts release file name from it:</p> <p><code>https://img.shields.io/badge/dynamic/json.svg?&lt;br&gt;&lt;/br&gt;label=download&lt;br&gt;&lt;/br&gt;&amp;url=https://api.github.com/repos/rarst/laps/releases/latest&lt;br&gt;&lt;/br&gt;&amp;query=$.assets[0].name&lt;br&gt;&lt;/br&gt;&amp;style=for-the-badge</code></p> <p>And the result looks like this:</p> <p> <img src="https://img.shields.io/badge/dynamic/json.svg?label=download&amp;url=https%3A%2F%2Fapi.github.com%2Frepos%2Frarst%2Flaps%2Freleases%2Flatest&amp;query=%24.assets[0].name&amp;style=for-the-badge" alt="Large download button with file name in it." loading="lazy"/> </p> <h2 id="all-together">All together</h2> <p>Now I combine the two and get a <a href="https://github.com/Rarst/laps#installation">download button</a> in the readme. It is completely static and GitHub is ok with it. But it will always show and send a client to the very latest release download.</p> ]]>
</content:encoded>
</item>
<item>
<title>A letter from Fear</title>
<link>https://www.rarst.net/thoughts/letter-from-fear/</link>
<pubDate>Mon, 15 Oct 2018 18:00:18 +0300</pubDate>
<guid>https://www.rarst.net/thoughts/letter-from-fear/</guid>
<description><p>Couple weeks ago I took some days off the computer to coddle a round of seasonal depression. In that time I listened through the <a href="https://www.calm.com/masterclass">Calm Masterclass</a> “Creative Living Beyond Fear” by <a href="https://www.elizabethgilbert.com/">Elizabeth Gilbert</a>.</p> <p>In it she suggests an interesting exercise to let your fear write you a letter. Here is what my fear wrote and my reply to it.</p></description>
<content:encoded>
<![CDATA[ <p>Couple weeks ago I took some days off the computer to coddle a round of seasonal depression. In that time I listened through the <a href="https://www.calm.com/masterclass">Calm Masterclass</a> “Creative Living Beyond Fear” by <a href="https://www.elizabethgilbert.com/">Elizabeth Gilbert</a>.</p> <p>In it she suggests an interesting exercise to let your fear write you a letter. Here is what my fear wrote and my reply to it.</p> <blockquote> <p>Dear Andrey,</p> <p>This is your Fear writing. You have chased some things to the corners of our mind. I would like to put them straight.</p> <p>You lack direction. You don’t know where are you headed. And if you did — you wouldn’t know how to start.</p> <p>You are at the limit of your “smart”. Which was always about enough to get you a pat on the head. And not enough to make a difference.</p> <p>You question your ambitions in life. And the truth is you have none. Which is for the better, because having them would be but a disappointment of not being able to reach them.</p> <p>You get to speak out because the Internet gives a megaphone to everyone these days. You don’t get for that to matter any.</p> <p>You make things no one cares for. And after that, you abandon them to rot.</p> <p>You are tired of people leaving you. And it won’t be long before the rest of them do.</p> <p>You are terrified that this is it. And it is.</p> </blockquote> <blockquote> <p>Dear Fear,</p> <p>Thank you for getting in touch!</p> <p>You have been trying to discuss this for a while. And I am sorry that I neglected to participate.</p> <p>You seem to talk a lot about outcomes. And let us be honest here&hellip; When did we ever care about those? When did we care to do anything for a bestowed carrot and not a smug satisfaction of nailing it?</p> <p>You talk about racing for significance. And I understand that the time for that is finite.</p> <p>And I am an insignificant strand in the fabric of this marvelous humanity lifeform. Which fascinates me so much whenever I care to look. That left the caves, reached the skies, and heads for the stars.</p> <p>(You got me a little teary–eyed here, you jerk.)</p> <p>I might not matter any more as that tiny invisible strand.</p> <p>But I cannot matter any less.</p> <p>You talk about things and words we make for others. And they are not for the others, are they?</p> <p>The things I do I believe in. The things I believe in I would do alone, in the dark, to the audience of a wind blowing them apart. And have a blast.</p> <p>Many had left us. It was not for nothing. They left all the feelings, and memories, and lessons for us to thrive on.</p> <p>And everyone who had left&hellip; we had to find first. And we will find the people to walk along with us, again and again.</p> <p>Is this it? Well&hellip; this is plenty!</p> <p>It’s a lovely sunny morning too. Let’s go find something to make.</p> </blockquote> ]]>
</content:encoded>
</item>
<item>
<title>External post on light WordPress profilers</title>
<link>https://www.rarst.net/wordpress/light-profilers/</link>
<pubDate>Thu, 12 Jul 2018 19:20:54 +0300</pubDate>
<guid>https://www.rarst.net/wordpress/light-profilers/</guid>
<description>Christie Chirinos had invited me to write a guest post on light WordPress profilers for Caldera Forms blog. Read it there. :)</description>
<content:encoded>
<![CDATA[ <p><a href="http://christiechirinos.com/">Christie Chirinos</a> had invited me to write a <a href="https://calderaforms.com/2018/07/light-wordpress-profilers-performance-improvement/">guest post on light WordPress profilers</a> for <a href="https://calderaforms.com/">Caldera Forms</a> blog.</p> <p>Read it there. :)</p> ]]>
</content:encoded>
</item>
<item>
<title>Meditation and naps in an ordinary life</title>
<link>https://www.rarst.net/thoughts/meditation-and-naps/</link>
<pubDate>Mon, 15 Jan 2018 18:00:42 +0200</pubDate>
<guid>https://www.rarst.net/thoughts/meditation-and-naps/</guid>
<description><p>Internet is full of great material on things like meditation. Delivered by extraordinary people. We listen to the <a href="https://www.ted.com/speakers/matthieu_ricard">happiest in the world scientist Tibetan monk</a>. We get inspired&hellip; For about 15 minutes. We go back to a grey routine.</p> <p>This is my&hellip; ordinary perspective. Meditation, naps, and getting well. From someone who gets through the days, too much screen time, and not enough sun.</p></description>
<content:encoded>
<![CDATA[ <p>Internet is full of great material on things like meditation. Delivered by extraordinary people. We listen to the <a href="https://www.ted.com/speakers/matthieu_ricard">happiest in the world scientist Tibetan monk</a>. We get inspired&hellip; For about 15 minutes. We go back to a grey routine.</p> <p>This is my&hellip; ordinary perspective. Meditation, naps, and getting well. From someone who gets through the days, too much screen time, and not enough sun.</p> <h2 id="misery-credentials">Misery credentials</h2> <p>That said there needs to be <em>some</em> challenge to make for an interesting story. Over recent years quite a few things had besieged my mind.</p> <p><strong>Fear</strong>, as my country went through the civil unrest and the hot phase of the war.</p> <p><strong>Grief</strong>, as my grandfather, father, and uncle had passed away.</p> <p><strong>Loneliness</strong>, as my small circle of friends almost disappeared.</p> <p><strong>Heartbreak</strong>, as loneliness veered me into unproductive and unwise romantic crushes.</p> <p><strong>Burnout</strong>, as the job that was everything I (thought I) wanted fizzled out.</p> <p><strong>Pain</strong>, as my body presented a bill for keeping up — in physical suffering.</p> <h2 id="perspective">Perspective</h2> <p>Curiously through all of it I still&hellip; <em>functioned</em>. I could make a good living, travel, <a href="https://www.rarst.net/thoughts/exercise-for-nerds/">exercise</a>, and even <a href="https://www.rarst.net/thoughts/wardrobe/">dress better</a>.</p> <p>In the ways many people would call vital I was fine.</p> <p>It just&hellip; got hard to think. To dream. To write. To imagine and do.</p> <p>In the ways that are vital to me I was not.</p> <h3 id="on-immutable">On immutable</h3> <p>Genes determine about half of us. This number comes up again and again. 50% of alcoholism is genetic. So is 50% of happiness. 50% of this. 50% of that.</p> <p>This locks us up into challenges that will be with us for life.</p> <p>This frees us to be ourselves as we are. Embrace the parts of us that are constant. Regardless if we want them to be.</p> <p>I had to face that I will never be a cheery and upbeat person. I had to stop trying.</p> <h3 id="on-malleable">On malleable</h3> <p>The half of us might be set in stone. That means the other half is up to us.</p> <p>We neglect what we can change, as we regret what we cannot.</p> <p>I had to remember and look for what makes me better. Focus on what gets me through a single day and what improves me over a string of many.</p> <h2 id="rest-for-the-body">Rest for the body</h2> <p>For much of my life I perceived my mind as borderline separate from concerns of the body. It is easy for obsessive thinker type to do that.</p> <p>Sooner or later life hammers into you the reality of their connection. As I aged and got buried in problems that became much more clear.</p> <p>In practical terms that made me pay serious attention to getting enough rest. I always knew I need a good night of sleep. It was hard to commit to that also being an “owl”.</p> <p>It was harder to face that sometimes I <em>need</em> the rest. Maybe before I even get to the bedtime.</p> <p>I had practiced naps for a long time and wrote about my staple <a href="https://www.rarst.net/software/pzizz/">naps app pzizz</a> before. As things got tough I had to revisit the habit and admit it can be a necessity, not luxury.</p> <h2 id="training-for-the-mind">Training for the mind</h2> <p>I wrote about <a href="https://www.rarst.net/web/calm/">meditation site Calm</a> before as well. And turned out it took me a several months more of steady practice to get to the benefits.</p> <p>The main downfall of an obsessive thinker is the obsessive part. It is second nature to burn away hours and days to spin the thoughts.</p> <p>And all the thinking tends to leave little time and practice for feeling things.</p> <p>Mindfulness meditation trains the mind to slow down.</p> <p>To catch yourself. To draw a line between yourself and a thought. To draw a line between yourself and a feeling.</p> <p>I realized how much I needed that once I learned to.</p> <h2 id="moving-forward">Moving forward</h2> <p>As promised this was an ordinary story. I made no heroic effort. I accomplished no heroic achievement.</p> <p>Things that bring me down are still with me. Some of them will be with me for many years more.</p> <p>Yet I find my way back to the things that are important to me.</p> <p>I find my way forward through the things that are hard.</p> <p>Such is life?</p> <h2 id="tldr">TL;DR</h2> <ol> <li>Accept what you cannot change about yourself.</li> <li>Improve what you can.</li> <li>Let yourself rest to be able to.</li> <li>You think, but you are not your thoughts.</li> <li>You feel, but you are not your feelings.</li> <li>Exercise your mind to see the difference.</li> <li>There are apps for that.</li> </ol> ]]>
</content:encoded>
</item>
<item>
<title>Quest for the wardrobe of my thirties</title>
<link>https://www.rarst.net/thoughts/wardrobe/</link>
<pubDate>Mon, 31 Jul 2017 18:00:55 +0300</pubDate>
<guid>https://www.rarst.net/thoughts/wardrobe/</guid>
<description><p>This year I had some downtime and finally got to pack up and donate my late father’s clothes. That also prompted me to look at my own wardrobe.</p> <p>Some lurking observations grasped for the spotlight. My closet was full of things I hadn’t worn in years (or ever). What I did wear had degraded to jeans and conference t–shirts.</p></description>
<content:encoded>
<![CDATA[ <p>This year I had some downtime and finally got to pack up and donate my late father’s clothes. That also prompted me to look at my own wardrobe.</p> <p>Some lurking observations grasped for the spotlight. My closet was full of things I hadn’t worn in years (or ever). What I did wear had degraded to jeans and conference t–shirts.</p> <h2 id="learn-up">Learn up</h2> <p>For something that we do every single day wardrobe gets little organized effort. Even less so for men, with lower social pressure on them about it.</p> <p>I didn’t wear things outright ugly, or shoddy, or cheap, or otherwise problematic. But my concept of clothes was primitive:</p> <ol> <li>Formal (suit), which I don’t need.</li> <li>Not formal, which I have jeans and tees for, right?</li> </ol> <p>I started to read information online for men like me — looking to update their messy ways.</p> <p>The most helpful resources were:</p> <ul> <li><a href="http://theessentialman.com/">The Essential Man</a> — short blog which stresses importance of neutral colors and good fit;</li> <li><a href="http://www.artofmanliness.com/category/dress-grooming/">The Art of Manliness</a> — a lot of articles and guides on basics of clothes;</li> <li><a href="http://stylegirlfriend.com/">Style Girlfriend</a> — women’s take on men’s style, a lot of outfit ideas and discussing things.</li> </ul> <p>I realized that my “polar” view of formality wrong:</p> <ul> <li>there is a broad <em>range</em> of formality;</li> <li>you can use same clothes in a more (dress up) or less (dress down) formal way.</li> </ul> <p>I had confined myself to most casual and least flexible bottom of the range.</p> <p>The other important aspects I neglected were:</p> <ol> <li><strong>Fit</strong>, which I had realized when I started to <a href="https://www.rarst.net/thoughts/exercise-for-nerds/">exercise</a>.</li> <li><strong>Color/print</strong>, a lot of things I had I didn’t <em>want</em> to wear because of it.</li> </ol> <p>So the steps I needed to take were:</p> <ol> <li>Figure out which style and level of formality is comfortable and functional <em>for me</em>.</li> <li>Clear out clothes that are useless to me.</li> <li>Buy clothes that fit my needs well.</li> </ol> <p>While I had no need to go all the way to top of formal, I needed an upgrade from the bottom of informal.</p> <h2 id="clear-out">Clear out</h2> <p>All clothes I had passed through a critical look and several questions.</p> <p><strong>If I hadn’t worn this in years, why so?</strong></p> <p>Some things needed fixes. Or be <em>remembered</em>. :) A lot were too old to be presentable or still be something I <em>would</em> wear.</p> <p><strong>Does this fit my body well?</strong></p> <p>With some time and actual effort I improved about judging what does and doesn’t fit me. Some things with poor fit I liked&hellip; hanging in the closet, but not to actually wear. I needed to shorten all my jeans for a perfect fit on length.</p> <p><strong>Does this work with the rest of clothes I have?</strong></p> <p>One of the most important lessons was that clothes in neutral look and color work well <em>with each other</em>. Anything bright or ornamented clashes with most other things. Especially <em>other</em> clothes of such kind.</p> <p>Everything that didn’t pass got the attention it needed or packed up and donated away. This is more of a continuous process though. Some things that did pass initial clear I still get rid of.</p> <h2 id="shop">Shop</h2> <p>After clear out I went over I had left. This gave me some general idea on what types of clothes I prefer and what brands work well for me.</p> <p>In <a href="https://www.rarst.net/thoughts/ukrainian-mess/">recent years</a> many clothes brands postponed entering our market or left it.</p> <p>After some research I settled on one of the large mall. Among other thing it hosts shops from same “network” which share bonuses and discounts.</p> <p>I did the two “kinds” of shopping — targeted and exploring.</p> <p>For targeted I made a list of basics I need to get or replace and shopped for them.</p> <p>For exploring I wait for sales and make an effort to explore respective store inside out. Note that I don’t buy things <em>because</em> they are on sale. I still look for things that <em>fit in with what I need</em>. Sales make it easier to explore and look for items that are not a priority.</p> <p>On the cost one big change was thinking in cost <em>per wear</em>. Cheap thing that I won’t wear is an actual waste of money. Something of good quality and flexible will see a lot of use for a long time.</p> <h2 id="top-things">Top things</h2> <p>While it is too much to go over everything item by item, some things made a quick and easy difference for me.</p> <h3 id="plain-tshirts">Plain t–shirts</h3> <p>I preferred plain tees before conference ones started to pile up.</p> <p>Back to plain! They can be harder to find in a sea of colorful and trendy, but worth it. Quality cotton feels great and neutral colors are easy to combine with anything.</p> <h3 id="blazer">Blazer</h3> <p>Blazer is a suit jacket without matching trousers. Modern blazers are available in more casual styles. It makes them perfect upgrade up a level of formal.</p> <p>I have also discovered that blazer is very <em>flattering</em> item in an older age. More of those shoulders, less of that waist. Suits are menswear staple for a reason. Blazer gets you in on some advantages, without going all formal.</p> <h3 id="chinos">Chinos</h3> <p>Trousers that are not jeans. If all you wear for years is jeans, anything makes for a refreshing and stylish change.</p> <p>Challenging for me to find a good fit on these. But even first pair in staple khaki color added a lot of flexibility to the wardrobe.</p> <h3 id="matchy-leather">Matchy leather</h3> <p>I put together two baseline shoes–belt–watch “sets” in black and brown. It is a minor detail, but it feels good and serves as a skeleton for an outfit. Pick black or brown, fill in the rest with what goes well with them.</p> <h2 id="results">Results</h2> <p>Still a cave–dwelling work–from–home creature on an average day. But being out and about, changes I made to the wardrobe are a lot of difference.</p> <p>It is easier to pick what I wear and it adds up together to a better put together looks. Day over day I can now switch through <em>outfits</em>, not different tees. :)</p> <p> <div class="wp-caption thumbnail alignnone"> <img src="https://www.rarst.net/images/2017/07/wordcamp-europe-with-sonja.jpg" alt="I almost fit in at the parties now." loading="lazy"/> <p class="wp-caption-text caption">I almost fit in at the parties now. With Sonja Leix at WordCamp Europe 2017.</p> </div> </p> <p>Out at the conferences I gathered a lot of compliments for the changes I made. Both for the specific items (<em>“Nice shirt/shoes/sweater!”</em>) and the look (<em>“You look different/nice/dapper!”</em>). Which happened before never.</p> <h2 id="tldr">TL;DR</h2> <ul> <li>wardrobe is a skill which benefits from thoughtful learning and application;</li> <li>informal to formal is a broad and flexible range;</li> <li>have and buy things you need, get rid of everything else;</li> <li>being dressed appropriately for your body, taste, and environment feels amazing.</li> </ul> ]]>
</content:encoded>
</item>
<item>
<title>Calm — site and app for guided meditation</title>
<link>https://www.rarst.net/web/calm/</link>
<pubDate>Mon, 10 Jul 2017 18:00:34 +0300</pubDate>
<guid>https://www.rarst.net/web/calm/</guid>
<description><p>I had tried meditation several times over past years. In a usual attempt it knocked me out asleep. :)</p> <p>There had been a new breed of meditation apps and services, offering a more guided experience.</p> <p>Calm is such a website/app.</p></description>
<content:encoded>
<![CDATA[ <p>I had tried meditation several times over past years. In a usual attempt it knocked me out asleep. :)</p> <p>There had been a new breed of meditation apps and services, offering a more guided experience.</p> <p>Calm is such a website/app.</p> <h2 id="what-it-does">What it does</h2> <p>Site offers selection of background sounds and narrated meditation guides. You can combine the two — ambiance that works for your taste and guide on specific topic.</p> <p> <div class="wp-caption thumbnail alignnone"> <img src="https://www.rarst.net/images/2017/07/calm.jpg" alt="Calm web site interface." loading="lazy"/> <p class="wp-caption-text caption">Calm web site interface.</p> </div> </p> <p>There is an introductory seven day program. It walks you through concepts and practice of mindfulness meditation.</p> <h2 id="strong-features">Strong features</h2> <p>The selection of background sounds is most comprehensive. You are bound to find the one you like. My personal favorite is “rain on leaves”.</p> <p>I had found guides to be very practical. The tone and pace are right to be instructional, but not overbearing or boring. If you need some background without voice, there is a couple of options without guidance.</p> <p>Mobile app repeats functionality of the site. That makes for a little clunky interface (more site than app), but everything is there and works.</p> <h2 id="downsides">Downsides</h2> <p>Site is quite pushy to sell you a subscription and is mostly behind a paywall. Even programs, that used to be free before, are now under a paid subscription.</p> <p>Outside of introductory course only unguided tracks and some samples are free. At $13 monthly price (less if paying for a longer time) it isn’t quite a no–brainer either.</p> <h2 id="overall">Overall</h2> <p>My profile tells me I had 72 sessions, totaling 15+ hours. So I would say the site is quite nice to use and habit forming. I hadn’t found that much mental benefit, but it fits my day well to wind down after <a href="https://www.rarst.net/thoughts/exercise-for-nerds/">exercise</a>.</p> <p>If you are looking for more serious practice you would likely have to pony up for subscription. If the price tag is worth will be a quite individual decision.</p> <p><strong>Site</strong> <a href="https://www.calm.com/">Calm.com</a></p> ]]>
</content:encoded>
</item>
</channel>
</rss>