Skip to content

Instantly share code, notes, and snippets.

@ArthurHoaro
Created July 26, 2020 07:57
Show Gist options
  • Save ArthurHoaro/2c94ba5634c3c0e48065a5ada7d03a25 to your computer and use it in GitHub Desktop.
Save ArthurHoaro/2c94ba5634c3c0e48065a5ada7d03a25 to your computer and use it in GitHub Desktop.
Feed in error for rss extender
<?xml version='1.0' encoding='UTF-8'?>
<?xml-stylesheet href="https://sandfox.me/assets/xml/atom.xsl" type="text/xsl media="all"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom">
<title>Sand Fox</title>
<id>https://sandfox.me/feed.xml</id>
<updated>2020-07-25T11:26:46Z</updated>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="self" type="application/atom+xml" href="https://sandfox.me/feed.xml"/>
<link rel="alternate" type="text/html" href="https://sandfox.me/"/>
<generator uri="https://getnikola.com/">Nikola</generator>
<entry>
<title>Method Calls with Arbitrary Names</title>
<id>https://sandfox.me/php/curly-braces-call.html</id>
<updated>2020-07-24T07:20:00+03:00</updated>
<published>2020-07-24T07:20:00+03:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/php/curly-braces-call.html"/>
<summary type="html">&lt;div&gt;&lt;p&gt;A discovery of the day.
Many people know that you can define and read an object property with an arbitrary name:&lt;/p&gt;
&lt;pre class="code php"&gt;&lt;a name="rest_code_76b8003b58024005bd00853a9c0e1c7b-1"&gt;&lt;/a&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;
&lt;a name="rest_code_76b8003b58024005bd00853a9c0e1c7b-2"&gt;&lt;/a&gt;
&lt;a name="rest_code_76b8003b58024005bd00853a9c0e1c7b-3"&gt;&lt;/a&gt;&lt;span class="nv"&gt;$s&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="k"&gt;stdClass&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;a name="rest_code_76b8003b58024005bd00853a9c0e1c7b-4"&gt;&lt;/a&gt;&lt;span class="nv"&gt;$s&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s1"&gt;'any string here'&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;123&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;a name="rest_code_76b8003b58024005bd00853a9c0e1c7b-5"&gt;&lt;/a&gt;&lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="nv"&gt;$s&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s1"&gt;'any string here'&lt;/span&gt;&lt;span class="p"&gt;};&lt;/span&gt; &lt;span class="c1"&gt;// 123&lt;/span&gt;
&lt;/pre&gt;&lt;p&gt;&lt;a href="https://sandfox.me/php/curly-braces-call.html"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</summary>
</entry>
<entry>
<title>Kernel#send Should Be Removed</title>
<id>https://sandfox.me/ruby/do-not-send.html</id>
<updated>2020-07-24T07:07:00+03:00</updated>
<published>2020-07-24T07:07:00+03:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/ruby/do-not-send.html"/>
<summary type="html">&lt;div&gt;&lt;p&gt;Opinion: &lt;code class="docutils literal"&gt;Kernel#send&lt;/code&gt; should be deprecated and removed from future rubies.&lt;/p&gt;
&lt;p&gt;&lt;code class="docutils literal"&gt;send&lt;/code&gt; always felt weird when I was an active ruby developer but I have never seen any strong criticisms on it.
It's either an attack on &lt;a class="reference external" href="https://brakemanscanner.org/docs/warning_types/dangerous_send/"&gt;all family of send-like calls&lt;/a&gt; or a fierce defence that "using &lt;code class="docutils literal"&gt;send&lt;/code&gt; is not a bad practice".
Only &lt;a class="reference external" href="https://github.com/rubocop-hq/ruby-style-guide"&gt;some style guides&lt;/a&gt; argue against &lt;code class="docutils literal"&gt;send&lt;/code&gt; because it may overlap with existing methods.
This post was written after reading one of defences.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://sandfox.me/ruby/do-not-send.html"&gt;Read more…&lt;/a&gt; (2 min remaining to read)&lt;/p&gt;&lt;/div&gt;</summary>
</entry>
<entry>
<title>I released the first PHP 8 library ever</title>
<id>https://sandfox.me/php/first-php-8-library.html</id>
<updated>2020-07-03T22:12:00+03:00</updated>
<published>2020-07-03T22:12:00+03:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/php/first-php-8-library.html"/>
<summary type="html">&lt;p&gt;At least among the libraries listed on the Packagist.
On this Tuesday &lt;a class="reference external" href="https://packagist.org/packages/sandfoxme/bencode"&gt;sandfoxme/bencode&lt;/a&gt; was updated to 2.0 that requires PHP 8 as a minimum.
While it was meant mostly as an experiment and a joke,
it allowed me to try some new features like &lt;code class="docutils literal"&gt;Stringable&lt;/code&gt; interface and remove some old compatibility handling
thanks to &lt;code class="docutils literal"&gt;mbstring.func_overload&lt;/code&gt; being finally removed.&lt;/p&gt;</summary>
<category term="php-8" label="php 8"/>
</entry>
<entry>
<title>sabre/xml</title>
<id>https://sandfox.me/php/sabre-xml.html</id>
<updated>2020-06-10T00:00:00+03:00</updated>
<published>2020-06-10T00:00:00+03:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/php/sabre-xml.html"/>
<summary type="html">&lt;div&gt;&lt;p&gt;An awesome discovery of today was made in an article titled &lt;a class="reference external" href="https://evertpot.com/an-xml-library-you-may-not-hate/"&gt;An XML library for PHP you may not hate&lt;/a&gt;.
As an unexpected twist I really didn't hate it, in fact it helped me to solve a problem that I had.
It is called &lt;a class="reference external" href="https://sabre.io/xml/"&gt;sabre/xml&lt;/a&gt; and it's a part of the &lt;a class="reference external" href="https://sabre.io/"&gt;sabre/dav&lt;/a&gt; project.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://sandfox.me/php/sabre-xml.html"&gt;Read more…&lt;/a&gt; (2 min remaining to read)&lt;/p&gt;&lt;/div&gt;</summary>
<category term="sabredav" label="sabre/dav"/>
<category term="xml" label="xml"/>
</entry>
<entry>
<title>Is NEON a Better YAML?</title>
<id>https://sandfox.me/misc/neon-better-yaml.html</id>
<updated>2020-06-15T22:18:00+03:00</updated>
<published>2020-05-29T06:18:00+03:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/misc/neon-better-yaml.html"/>
<summary type="html">&lt;div&gt;&lt;p&gt;Short answer: NO. If you know what I mean.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://sandfox.me/misc/neon-better-yaml.html"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</summary>
<category term="neon" label="neon"/>
<category term="yaml" label="yaml"/>
</entry>
<entry>
<title>What's Wrong with StrictYAML</title>
<id>https://sandfox.me/misc/strictyaml-problems.html</id>
<updated>2020-05-29T05:48:00+03:00</updated>
<published>2020-05-29T05:48:00+03:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/misc/strictyaml-problems.html"/>
<summary type="html">&lt;div&gt;&lt;p&gt;While I'm still delaying my position on TOML vs YAML holy war let's look at the &lt;a class="reference external" href="https://hitchdev.com/strictyaml/"&gt;StrictYAML&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;StrictYAML is a type-safe YAML parser that parses and validates a restricted subset of the YAML specification.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Seems great but &lt;a class="reference external" href="https://hitchdev.com/strictyaml/features-removed/"&gt;let's look at the removed features list&lt;/a&gt;, Implicit Typing to be precise:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://sandfox.me/misc/strictyaml-problems.html"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</summary>
<category term="strictyaml" label="strictyaml"/>
<category term="yaml" label="yaml"/>
</entry>
<entry>
<title>Free Domain Names</title>
<id>https://sandfox.me/misc/free-domain-names.html</id>
<updated>2020-04-07T09:23:00+03:00</updated>
<published>2020-04-07T09:23:00+03:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/misc/free-domain-names.html"/>
<summary type="html">&lt;div&gt;&lt;p&gt;Just created a list of free domain name zones that still work if you need one for whatever reason.&lt;/p&gt;
&lt;p&gt;You can find it here: &lt;a class="reference external" href="https://freedomainzones.netlify.app"&gt;freedomainzones.netlify.app&lt;/a&gt;.&lt;/p&gt;&lt;/div&gt;</summary>
<category term="dns" label="dns"/>
</entry>
<entry>
<title>Install Composer in Docker</title>
<id>https://sandfox.me/php/install-composer-in-docker.html</id>
<updated>2020-04-02T11:26:00+03:00</updated>
<published>2020-04-02T11:26:00+03:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/php/install-composer-in-docker.html"/>
<summary type="html">&lt;div&gt;&lt;p&gt;Here is a small snippet adapted from the &lt;a class="reference external" href="https://getcomposer.org/doc/faqs/how-to-install-composer-programmatically.md"&gt;official instruction&lt;/a&gt;:&lt;/p&gt;
&lt;pre class="code docker"&gt;&lt;a name="rest_code_7ddcc2982f2146b98948661303c1be1e-1"&gt;&lt;/a&gt;&lt;span class="k"&gt;RUN&lt;/span&gt; wget -q -O /tmp/composer.sig https://composer.github.io/installer.sig &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;a name="rest_code_7ddcc2982f2146b98948661303c1be1e-2"&gt;&lt;/a&gt; php -r &lt;span class="s2"&gt;"copy('https://getcomposer.org/installer', '/tmp/composer-setup.php');"&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;a name="rest_code_7ddcc2982f2146b98948661303c1be1e-3"&gt;&lt;/a&gt; php -r &lt;span class="s1"&gt;'$expected = file_get_contents("/tmp/composer.sig"); $actual = hash_file("sha384", "/tmp/composer-setup.php"); exit(intval(!hash_equals($expected, $actual)));'&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;a name="rest_code_7ddcc2982f2146b98948661303c1be1e-4"&gt;&lt;/a&gt; php /tmp/composer-setup.php --install-dir&lt;span class="o"&gt;=&lt;/span&gt;/usr/local/bin --filename&lt;span class="o"&gt;=&lt;/span&gt;composer &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;a name="rest_code_7ddcc2982f2146b98948661303c1be1e-5"&gt;&lt;/a&gt; chmod +x /usr/local/bin/composer &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;a name="rest_code_7ddcc2982f2146b98948661303c1be1e-6"&gt;&lt;/a&gt; rm /tmp/composer-setup.php /tmp/composer.sig
&lt;/pre&gt;&lt;p&gt;It doesn't require a script file, doesn't deal with environment variables, and doesn't depend on the shell.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://sandfox.me/php/install-composer-in-docker.html"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</summary>
<category term="composer" label="composer"/>
<category term="docker" label="docker"/>
</entry>
<entry>
<title>I Don't Like JavaScript</title>
<id>https://sandfox.me/misc/i-dont-like-js.html</id>
<updated>2020-04-01T00:34:00+03:00</updated>
<published>2020-04-01T00:34:00+03:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/misc/i-dont-like-js.html"/>
<summary type="html">&lt;figure&gt;&lt;img src="https://sandfox.me/images/misc/i-dont-like-js/leverage_big.jpg"&gt;&lt;/figure&gt; &lt;div&gt;&lt;p&gt;When you created a cool tool in a language you don't like.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://sandfox.me/misc/i-dont-like-js.html"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</summary>
<category term="fun" label="fun"/>
<category term="javascript" label="javascript"/>
<category term="leverage" label="leverage"/>
</entry>
<entry>
<title>Small Personal Update</title>
<id>https://sandfox.me/misc/personal-update-2020.html</id>
<updated>2020-03-28T01:16:00+02:00</updated>
<published>2020-03-28T01:16:00+02:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/misc/personal-update-2020.html"/>
<summary type="html">&lt;div&gt;&lt;p&gt;A small personal update about services and social networks.&lt;/p&gt;
&lt;p&gt;I changed my username on &lt;a class="reference external" href="https://github.com/arokettu"&gt;GitHub&lt;/a&gt; and &lt;a class="reference external" href="https://packagist.org/users/arokettu"&gt;Packagist&lt;/a&gt; to &lt;strong&gt;@arokettu&lt;/strong&gt;.
I'm also on &lt;a class="reference external" href="https://keybase.io/arokettu"&gt;Keybase&lt;/a&gt; now.&lt;/p&gt;&lt;/div&gt;</summary>
<category term="github" label="github"/>
<category term="keybase" label="keybase"/>
<category term="packagist" label="packagist"/>
<category term="personal" label="personal"/>
<category term="social" label="social"/>
</entry>
<entry>
<title>GitHub Signatures in Gitea</title>
<id>https://sandfox.me/misc/gitea-github.html</id>
<updated>2019-11-15T02:16:00+02:00</updated>
<published>2019-11-15T02:16:00+02:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/misc/gitea-github.html"/>
<summary type="html">&lt;div&gt;&lt;p&gt;A small lifehack for the Gitea owners.
As you may know, &lt;a class="reference external" href="https://help.github.com/en/github/authenticating-to-github/about-commit-signature-verification"&gt;GitHub signs commits done with its web interface with its GPG key&lt;/a&gt;.
These commits may end up on your Gitea server.
It looks rather unconvincing:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://sandfox.me/misc/gitea-github.html"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</summary>
<category term="gitea" label="gitea"/>
<category term="github" label="github"/>
<category term="gpg" label="gpg"/>
<category term="lifehack" label="lifehack"/>
</entry>
<entry>
<title>Dark Theme for the Blog</title>
<id>https://sandfox.me/misc/dark-theme.html</id>
<updated>2019-10-26T15:40:00+03:00</updated>
<published>2019-10-26T15:40:00+03:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/misc/dark-theme.html"/>
<summary type="html">&lt;figure&gt;&lt;img src="https://sandfox.me/images/misc/dark-theme/dark.png"&gt;&lt;/figure&gt; &lt;div&gt;&lt;p&gt;Just finalized the dark theme for the blog.
The idea is simple, use &lt;code class="docutils literal"&gt;&lt;span class="pre"&gt;prefers-color-scheme&lt;/span&gt;&lt;/code&gt; media query and wrap dark style elements with it:&lt;/p&gt;
&lt;pre class="code css"&gt;&lt;a name="rest_code_18b6772253ec4e25a7cddafae56740c8-1"&gt;&lt;/a&gt;&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="k"&gt;media&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;prefers-color-scheme&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;dark&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;a name="rest_code_18b6772253ec4e25a7cddafae56740c8-2"&gt;&lt;/a&gt; &lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;a name="rest_code_18b6772253ec4e25a7cddafae56740c8-3"&gt;&lt;/a&gt; &lt;span class="k"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mh"&gt;#4be&lt;/span&gt;
&lt;a name="rest_code_18b6772253ec4e25a7cddafae56740c8-4"&gt;&lt;/a&gt; &lt;span class="p"&gt;}&lt;/span&gt;
&lt;a name="rest_code_18b6772253ec4e25a7cddafae56740c8-5"&gt;&lt;/a&gt;&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/pre&gt;&lt;p&gt;&lt;a href="https://sandfox.me/misc/dark-theme.html"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</summary>
<category term="blog" label="blog"/>
<category term="css" label="css"/>
<category term="dark-theme" label="dark theme"/>
<category term="night-mode" label="night mode"/>
<category term="prefers-color-scheme" label="prefers-color-scheme"/>
</entry>
<entry>
<title>On Common Misuse of the File Formats</title>
<id>https://sandfox.me/misc/file-formats-misuse.html</id>
<updated>2019-10-25T18:20:00+03:00</updated>
<published>2019-10-25T18:20:00+03:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/misc/file-formats-misuse.html"/>
<summary type="html">&lt;div&gt;&lt;p&gt;A small rant about text file format holy wars.
I believe that most of the file formats that participate in these holy wars are rather good
and the most of the frustration comes from their misuse.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://sandfox.me/misc/file-formats-misuse.html"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</summary>
<category term="configuration" label="configuration"/>
<category term="documents" label="documents"/>
<category term="json" label="json"/>
<category term="serialization" label="serialization"/>
<category term="toml" label="toml"/>
<category term="xml" label="xml"/>
<category term="yaml" label="yaml"/>
</entry>
<entry>
<title>Fix AsciiDoc Display in Gitea</title>
<id>https://sandfox.me/ruby/gitea-asciidoc.html</id>
<updated>2019-10-17T13:00:00+03:00</updated>
<published>2019-10-17T13:00:00+03:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/ruby/gitea-asciidoc.html"/>
<summary type="html">&lt;div&gt;&lt;p&gt;After installing &lt;a class="reference external" href="https://sandfox.org/"&gt;my own Gitea&lt;/a&gt; I looked for the support for the markups I use.
&lt;a class="reference external" href="https://gitea.io/"&gt;Gitea&lt;/a&gt; has support for external markup renderers
and the official doc lists configs for both &lt;a class="reference external" href="http://docutils.sourceforge.net/rst.html"&gt;reStructuredText&lt;/a&gt; and &lt;a class="reference external" href="https://asciidoctor.org/"&gt;AsciiDoc&lt;/a&gt;:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://sandfox.me/ruby/gitea-asciidoc.html"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</summary>
<category term="asciidoc" label="asciidoc"/>
<category term="asciidoctor" label="asciidoctor"/>
<category term="git" label="git"/>
<category term="gitea" label="gitea"/>
</entry>
<entry>
<title>PHP 7.4: Splat Inconsistency</title>
<id>https://sandfox.me/php/splat-inconsistency.html</id>
<updated>2019-08-29T21:52:00+03:00</updated>
<published>2019-08-29T21:52:00+03:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/php/splat-inconsistency.html"/>
<summary type="html">&lt;div&gt;&lt;p&gt;PHP 7.4 has this great new feature: splat operator now works in array expressions.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://sandfox.me/php/splat-inconsistency.html"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</summary>
<category term="php-74" label="php 7.4"/>
<category term="splat-operator" label="splat operator"/>
<category term="wtf" label="wtf?"/>
</entry>
<entry>
<title>Encryptor</title>
<id>https://sandfox.me/php/php-encryptor.html</id>
<updated>2019-08-24T03:50:00+03:00</updated>
<published>2019-08-24T03:50:00+03:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/php/php-encryptor.html"/>
<summary type="html">&lt;div&gt;&lt;p&gt;Created a simple cli file encryptor using &lt;a class="reference external" href="https://libsodium.gitbook.io/"&gt;libsodium&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;The app can create a password-protected file encoded with &lt;a class="reference external" href="https://en.wikipedia.org/wiki/Salsa20"&gt;XSalsa20&lt;/a&gt; and &lt;a class="reference external" href="https://en.wikipedia.org/wiki/Argon2"&gt;Argon2id&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;See my dev portal: &lt;a class="reference external" href="https://sandfox.dev/php/encryptor.html"&gt;https://sandfox.dev/php/encryptor.html&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary>
<category term="argon2id" label="argon2id"/>
<category term="encryption" label="encryption"/>
<category term="sodium" label="sodium"/>
<category term="xsalsa20" label="xsalsa20"/>
</entry>
<entry>
<title>Bitbucket to Remove Mercurial Support</title>
<id>https://sandfox.me/misc/bitbucket-mercurial.html</id>
<updated>2019-08-20T21:40:00+03:00</updated>
<published>2019-08-20T21:40:00+03:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/misc/bitbucket-mercurial.html"/>
<summary type="html">&lt;div&gt;&lt;p&gt;So Mercurial lost its biggest hosting platform.
Sad to see it because I always thought that it has much more usable CLI
and much better branching system for corporate development than git.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;After much consideration, we've decided to remove Mercurial support
from Bitbucket Cloud and its API.
Mercurial features and repositories will be officially removed
from Bitbucket and its API on June 1, 2020.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;&lt;a class="reference external" href="https://bitbucket.org/blog/sunsetting-mercurial-support-in-bitbucket"&gt;https://bitbucket.org/blog/sunsetting-mercurial-support-in-bitbucket&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary>
<category term="bitbucket" label="bitbucket"/>
<category term="git" label="git"/>
<category term="mercurial" label="mercurial"/>
</entry>
<entry>
<title>Composer Yaml</title>
<id>https://sandfox.me/php/composer-yaml.html</id>
<updated>2019-04-19T22:00:00+03:00</updated>
<published>2019-04-19T22:00:00+03:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/php/composer-yaml.html"/>
<summary type="html">&lt;div&gt;&lt;p&gt;My new library to allow composer to read config from YAML file.
There is some demand in comments for composer config but &lt;a class="reference external" href="https://github.com/composer/composer/issues/440"&gt;the developers are not interested&lt;/a&gt;
and most 3rd party attempts to solve it are limited to yaml2json converters.&lt;/p&gt;
&lt;p&gt;I tried a slightly different approach.
There is a command in the composer itself that changes the way the config is read: &lt;code class="docutils literal"&gt;composer global&lt;/code&gt;.
During its execution it changes current working directory, resets composer state, and forces the composer
to read config from another directory.&lt;/p&gt;
&lt;p&gt;What I tried to do:
I put yaml2json converter in place of &lt;code class="docutils literal"&gt;global&lt;/code&gt;'s directory changing code, and it seems it worked.
Of course, some things got broken like any command that tries to change composer.json will no longer have any effect,
however many people don't use them and it may be an acceptable tradeoff for using yml-based config.&lt;/p&gt;
&lt;p&gt;You can find the project on my new dev website: &lt;a class="reference external" href="https://sandfox.dev/php/composer-yaml.html"&gt;https://sandfox.dev/php/composer-yaml.html&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary>
<category term="composer" label="composer"/>
<category term="yaml" label="yaml"/>
</entry>
<entry>
<title>sandfox.dev</title>
<id>https://sandfox.me/misc/sandfox-dev.html</id>
<updated>2019-04-19T17:35:00+03:00</updated>
<published>2019-04-19T17:35:00+03:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/misc/sandfox-dev.html"/>
<summary type="html">&lt;div&gt;&lt;p&gt;I created a website to host documentation for my public libraries
and to serve as a primary index for them&lt;/p&gt;
&lt;p&gt;&lt;a class="reference external" href="https://sandfox.dev/"&gt;https://sandfox.dev/&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Created with &lt;a class="reference external" href="https://www.sphinx-doc.org/"&gt;Sphinx&lt;/a&gt; with a small script
that collects docs directories from project repos&lt;/p&gt;&lt;/div&gt;</summary>
<category term="dev" label="dev"/>
<category term="documentation" label="documentation"/>
<category term="projects" label="projects"/>
<category term="sphinx" label="sphinx"/>
</entry>
<entry>
<title>RPM5 Lost All Distros</title>
<id>https://sandfox.me/linux/rpm5.html</id>
<updated>2019-04-10T17:49:00+03:00</updated>
<published>2019-04-10T17:49:00+03:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/linux/rpm5.html"/>
<summary type="html">&lt;div&gt;&lt;p&gt;With &lt;a class="reference external" href="https://www.openmandriva.org/"&gt;OpenMandriva Lx&lt;/a&gt; 4 now in beta it seems that &lt;a class="reference external" href="http://rpm5.org/"&gt;RPM5&lt;/a&gt; lost all its main users.
CAOS, Ark and Unity are discontinued, Wind River and OpenMandriva switched to RPMv4&lt;/p&gt;
&lt;p&gt;Interestingly, it's also the end of &lt;a class="reference external" href="https://en.wikipedia.org/wiki/Urpmi"&gt;urpmi&lt;/a&gt; with both Mageia and OpenMandriva switching to dnf.&lt;/p&gt;
&lt;p&gt;It seems rpm world entered a semi-unified state with dnf and zypper,
both libsolv based and partly interoperable&lt;/p&gt;&lt;/div&gt;</summary>
<category term="mandriva" label="mandriva"/>
<category term="openmandriva" label="openmandriva"/>
<category term="rpm" label="rpm"/>
<category term="rpm5" label="rpm5"/>
</entry>
<entry>
<title>Satis/GitLab Update</title>
<id>https://sandfox.me/php/satis-gitlab-update.html</id>
<updated>2019-02-19T16:22:00+02:00</updated>
<published>2019-02-19T16:22:00+02:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/php/satis-gitlab-update.html"/>
<summary type="html">&lt;div&gt;&lt;p&gt;Recently I had some problems with the &lt;a class="reference external" href="https://sandfox.me/php/satis-gitlab.html"&gt;scenario that I published earlier&lt;/a&gt;
with composer being unable to find auth data so I posted an update there.
Refer to the new code at that post if you experience the same problem&lt;/p&gt;
&lt;p&gt;To summarize, it uses an env variable instead of a file now&lt;/p&gt;&lt;/div&gt;</summary>
<category term="composer" label="composer"/>
<category term="gitlab" label="gitlab"/>
<category term="satis" label="satis"/>
</entry>
<entry>
<title>Rejecting Contributor Covenant</title>
<id>https://sandfox.me/misc/rejecting-contributor-covenant.html</id>
<updated>2019-02-17T22:44:00+02:00</updated>
<published>2019-02-17T22:44:00+02:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/misc/rejecting-contributor-covenant.html"/>
<summary type="html">&lt;div&gt;&lt;p&gt;Partially as a follow-up for a &lt;a class="reference external" href="https://sandfox.me/misc/github-censorship.html"&gt;previous post&lt;/a&gt;.
As we now know, the sole purpose of the Contributor Covenant is &lt;a class="reference external" href="https://www.reddit.com/r/KotakuInAction/comments/47p3f5/ethics_shanley_kane_the_ceo_of_model_view_culture/"&gt;silencing SJW's political enemies&lt;/a&gt;.
Luckily Coraline admitted that CC is political so resisting it is also mere politics :D&lt;/p&gt;
&lt;p&gt;&lt;a href="https://sandfox.me/misc/rejecting-contributor-covenant.html"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</summary>
<category term="code-of-conduct" label="code of conduct"/>
<category term="code-of-merit" label="code of merit"/>
<category term="contributor-covenant" label="contributor covenant"/>
<category term="politics" label="politics"/>
<category term="sjw" label="sjw"/>
</entry>
<entry>
<title>Political Censorship on GitHub</title>
<id>https://sandfox.me/misc/github-censorship.html</id>
<updated>2019-02-17T18:58:00+02:00</updated>
<published>2019-02-17T18:58:00+02:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/misc/github-censorship.html"/>
<summary type="html">&lt;div&gt;&lt;p&gt;I never expected this blog to go political but the situation became outrageous&lt;/p&gt;
&lt;!-- TEASER_END
**GitHub deplatforms Code of Merit Author Roberto Rosario**
Rosario's account had been in a sort of limited state for years which didn't allow people to follow him on GitHub.
According to sources close to GitHub,
the platform had enough but had to wait until the Linux Kernel adoption
of a code of conduct story died down to take down the Code of Merit repository.
Terms of service violations were cited as the reason to take down the repositories and the account.
In addition to the Code of Merit the repositories and organizations
for Awesome Django and Mayan EDMS were taken down too.
In total these three projects alone had more than 11,000 stars and 3,000 forks.
Awesome Django and Mayan EDMS are two of the most influential
and well known Django projects and second in popularity to Django itself.
GitHub censorship is affecting thousands of developers that rely on Awesome Django for their work.
Only a copy of Awesome Django survives in the service named GitLab.
As can be seen this is the 5th most popular repository in the entire site,
and ranks higher than even some of GitLab's own products:
https://gitlab.com/explore/projects/starred
GitHub joins the Python Software Foundation,
the Django Software Foundation and the International Games Developer Association
in their effort to silence Rosario and his movement against
code of conducts in free open source projects.
All three organizations had already removed or force
Rosario to resign from positions in their organizations
and have blacklisted him from their events.
Rosario's last appearance at a Django/Python event was
in 2016 for the talk about his free open source heart monitoring system using Arduino and Django.
At the beginning of the talk he confirms that talk will be his last public appearance at a Django/Python event,
either as speaker or audience:
https://www.youtube.com/watch?v=rubzEAojf-k
- - `news.ycombinator.com &lt;https://news.ycombinator.com/item?id=18686301&gt;`__ --&gt;
&lt;p&gt;It's really scary how silent it went.
It was almost 2 months ago and I only heard it now.
Also code-of-merit.org seems to be hacked.&lt;/p&gt;
&lt;p&gt;And we cannot even blame it on recent Microsoft ownership because of the earlier incident:
&lt;a class="reference external" href="https://news.ycombinator.com/item?id=15087164"&gt;https://news.ycombinator.com/item?id=15087164&lt;/a&gt;
It's unknown why they didn't succeed first time but apparently now Rosario will stay removed&lt;/p&gt;
&lt;p&gt;Rosario is known as a creator of the Code of Merit, a pure meritocracy based Code of Conduct,
that was hosted on code-of-merit.org before it was hacked.
The likely reason for its creation was a SJW provocation in Awesome Django:&lt;/p&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;&lt;a class="reference external" href="https://www.reddit.com/r/MozillaInAction/comments/3qyjg8/vox_popoli_exposing_the_true_face_of_sjw/"&gt;https://www.reddit.com/r/MozillaInAction/comments/3qyjg8/vox_popoli_exposing_the_true_face_of_sjw/&lt;/a&gt;&lt;/div&gt;
&lt;div class="line"&gt;&lt;a class="reference external" href="https://voxday.blogspot.com/2015/10/exposing-true-face-of-sjw.html"&gt;https://voxday.blogspot.com/2015/10/exposing-true-face-of-sjw.html&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/div&gt;</summary>
<category term="github" label="github"/>
<category term="politics" label="politics"/>
<category term="sjw" label="sjw"/>
</entry>
<entry>
<title>Farewell to Jekyll</title>
<id>https://sandfox.me/misc/farewell-to-jekyll.html</id>
<updated>2019-01-18T08:59:00+02:00</updated>
<published>2019-01-18T08:59:00+02:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/misc/farewell-to-jekyll.html"/>
<summary type="html">&lt;div&gt;&lt;p&gt;Just ported the blog to &lt;a class="reference external" href="https://getpelican.com/"&gt;Pelican&lt;/a&gt; and removed all Jekyll files. Currently it seems the most logical choice for me&lt;/p&gt;
&lt;p&gt;First, I started to use reST much more extensively than Markdown and I want a blog generator that supports it better&lt;/p&gt;
&lt;p&gt;Second is my new interest in Python&lt;/p&gt;
&lt;p&gt;Third, &lt;a class="reference external" href="https://getpelican.com/"&gt;Pelican&lt;/a&gt; seems to have much more features that I like compared to Jekyll and other static generators that
I tested, especially Python ones (however &lt;a class="reference external" href="https://getnikola.com/"&gt;Nikola&lt;/a&gt; also seems a good alternative but I had to stop at something)&lt;/p&gt;&lt;/div&gt;</summary>
<category term="blog" label="blog"/>
<category term="jekyll" label="jekyll"/>
<category term="pelican" label="pelican"/>
</entry>
<entry>
<title>journald-native and journald-logger Transferred to the Foreman</title>
<id>https://sandfox.me/ruby/farewell-journald.html</id>
<updated>2018-10-10T11:40:00+03:00</updated>
<published>2018-10-10T11:40:00+03:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/ruby/farewell-journald.html"/>
<summary type="html">&lt;div&gt;&lt;p&gt;Yesterday I moved two of my ruby gems, &lt;a class="reference external" href="https://rubygems.org/gems/journald-native"&gt;journald-native&lt;/a&gt; and &lt;a class="reference external" href="https://rubygems.org/gems/journald-logger"&gt;journald-logger&lt;/a&gt;, to &lt;code class="docutils literal"&gt;theforeman&lt;/code&gt;
GitHub namepace. Developing them further is out of my current professional interest and hopefully
&lt;a class="reference external" href="https://www.theforeman.org/"&gt;the Foreman project&lt;/a&gt; will be a good home for them.&lt;/p&gt;
&lt;p&gt;It's hard to say farewell however to the most popular library I created so far :D (8 GitHub stars, 57000 downloads)&lt;/p&gt;&lt;/div&gt;</summary>
<category term="foreman" label="foreman"/>
<category term="journald-logger" label="journald-logger"/>
<category term="journald-native" label="journald-native"/>
<category term="my-projects" label="my projects"/>
<category term="ruby-gems" label="ruby gems"/>
</entry>
<entry>
<title>Private Composer Repo with GitLab and Satis</title>
<id>https://sandfox.me/php/satis-gitlab.html</id>
<updated>2018-03-09T16:44:00+02:00</updated>
<published>2018-03-09T16:44:00+02:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/php/satis-gitlab.html"/>
<summary type="html">&lt;div&gt;&lt;p&gt;You can easily create your own composer repository using Satis and GitLab.
I will use global &lt;a class="reference external" href="https://gitlab.com"&gt;https://gitlab.com&lt;/a&gt; but it should be most useful for private corporate GitLab installations.
You will need CI and Pages&lt;/p&gt;
&lt;p&gt;&lt;a href="https://sandfox.me/php/satis-gitlab.html"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</summary>
<category term="composer" label="composer"/>
<category term="gitlab" label="gitlab"/>
<category term="satis" label="satis"/>
</entry>
<entry>
<title>PhpStorm Advanced Metadata Exporter</title>
<id>https://sandfox.me/php/phpstorm-metadata.html</id>
<updated>2018-03-06T07:54:00+02:00</updated>
<published>2018-03-06T07:54:00+02:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/php/phpstorm-metadata.html"/>
<summary type="html">&lt;div&gt;&lt;p&gt;As a Silex user I liked &lt;a class="reference external" href="https://github.com/Sorien/silex-pimple-dumper"&gt;Pimple Container Dumper&lt;/a&gt; that worked with &lt;a class="reference external" href="https://github.com/Sorien/silex-idea-plugin"&gt;Silex Idea Plugin&lt;/a&gt; to enable code completion
for Pimple DI in PhpStorm. But now with Silex EOL'd I have to move to Slim.&lt;/p&gt;
&lt;p&gt;I've found no such projects so I had to write my own. Here it is: &lt;a class="reference external" href="https://sandfox.dev/php/phpstorm-metadata-export.html"&gt;sandfoxme/phpstorm-metadata-export&lt;/a&gt;.
It currently supports exporting data from Pimple and has 3 integration middlewares: for Slim, for Silex and
for Psr-15 compatible frameworks.&lt;/p&gt;
&lt;p&gt;P.S. Code completion support for ArrayAccess containers seem to be currently broken
in PhpStorm (&lt;a class="reference external" href="https://youtrack.jetbrains.com/issue/WI-33309"&gt;WI-33309&lt;/a&gt;, &lt;a class="reference external" href="https://youtrack.jetbrains.com/issue/WI-35503"&gt;WI-35503&lt;/a&gt;).
So I don't currently recommend replacing Silex Idea Plugin with this library unless you use Pimple in Psr-11 compliant
way (like Slim does by default)&lt;/p&gt;&lt;/div&gt;</summary>
<category term="code-completion" label="code completion"/>
<category term="phpstorm" label="phpstorm"/>
<category term="pimple" label="pimple"/>
<category term="silex" label="silex"/>
<category term="slim" label="slim"/>
</entry>
<entry>
<title>Composer Viz</title>
<id>https://sandfox.me/php/composer-viz.html</id>
<updated>2017-08-06T12:12:00+03:00</updated>
<published>2017-08-06T12:12:00+03:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/php/composer-viz.html"/>
<summary type="html">&lt;div&gt;&lt;p&gt;A tool inspired by &lt;a class="reference external" href="https://bundler.io/v1.3/bundle_viz.html"&gt;&lt;code class="docutils literal"&gt;bundle viz&lt;/code&gt; command&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Just look at its selfie:&lt;/p&gt;
&lt;p&gt;&lt;img alt="selfie" class="invert-when-dark" src="https://sandfox.me/images/php/composer-viz/selfie.svg" style="width: 100%;"&gt;&lt;/p&gt;
&lt;p&gt;Get it on my dev site: &lt;a class="reference external" href="https://sandfox.dev/php/composer-viz.html"&gt;https://sandfox.dev/php/composer-viz.html&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</summary>
<category term="bundler" label="bundler"/>
<category term="composer" label="composer"/>
<category term="graphviz" label="graphviz"/>
</entry>
<entry>
<title>PHP Access Private Methods and Fields</title>
<id>https://sandfox.me/php/php-private-access.html</id>
<updated>2016-11-16T21:00:00+02:00</updated>
<published>2016-11-16T21:00:00+02:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/php/php-private-access.html"/>
<summary type="html">&lt;div&gt;&lt;p&gt;These two simple functions can come in handy as helpers for something like &lt;a class="reference external" href="http://psysh.org/"&gt;PsySH&lt;/a&gt;.
PHP &amp;gt;= 7.0 is required.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://sandfox.me/php/php-private-access.html"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</summary>
<category term="debug" label="debug"/>
</entry>
<entry>
<title>Harold Finch Uses JetBrains IDE</title>
<id>https://sandfox.me/misc/person-of-interest-jetbrains.html</id>
<updated>2016-06-16T03:20:00+03:00</updated>
<published>2016-06-16T03:20:00+03:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/misc/person-of-interest-jetbrains.html"/>
<summary type="html">&lt;figure&gt;&lt;img src="https://sandfox.me/images/misc/person-of-interest-jetbrains/ide.jpg"&gt;&lt;/figure&gt; &lt;div&gt;&lt;!-- images are added as substitutions to put them to paragraphs --&gt;
&lt;p&gt;Yay, Harold Finch from the &lt;a class="reference external" href="https://www.imdb.com/title/tt1839578/"&gt;Person of Interest&lt;/a&gt; was spotted using some JetBrains IDE.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://sandfox.me/misc/person-of-interest-jetbrains.html"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</summary>
<category term="fun" label="fun"/>
<category term="jetbrains" label="jetbrains"/>
<category term="person-of-interest" label="person of interest"/>
<category term="phpstorm" label="phpstorm"/>
</entry>
<entry>
<title>RubyMine Supports Markdown</title>
<id>https://sandfox.me/misc/rubymine-markdown.html</id>
<updated>2016-04-06T02:55:00+03:00</updated>
<published>2016-04-06T02:55:00+03:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/misc/rubymine-markdown.html"/>
<summary type="html">&lt;div&gt;&lt;p&gt;Wow. It seems &lt;a class="reference external" href="https://www.jetbrains.com/ruby/"&gt;RubyMine&lt;/a&gt; and other JetBrains products now have very nice
Markdown support. I haven't even noticed it until last article.
(I usually had &lt;a class="reference external" href="https://plugins.jetbrains.com/plugin/7896"&gt;MultiMarkdown&lt;/a&gt; plugin installed)&lt;/p&gt;
&lt;p&gt;Killer feature for me is that it allows working with code blocks of known
languages as if it was real code, even have code completion
and some basic inspections there.&lt;/p&gt;
&lt;p&gt;&lt;img alt="RubyMine Markdown" src="https://sandfox.me/images/misc/rubymine-markdown/rubymine_markdown.png"&gt;&lt;/p&gt;&lt;/div&gt;</summary>
<category term="markdown" label="markdown"/>
<category term="rubymine" label="rubymine"/>
</entry>
<entry>
<title>Embracing CommonMark as the One True Markdown</title>
<id>https://sandfox.me/ruby/embracing-commonmark.html</id>
<updated>2016-04-06T02:46:00+03:00</updated>
<published>2016-04-06T02:46:00+03:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/ruby/embracing-commonmark.html"/>
<summary type="html">&lt;div&gt;&lt;p&gt;As you may know, &lt;a class="reference external" href="https://commonmark.org/"&gt;CommonMark&lt;/a&gt; is a project aiming to create unified and
unambiguous Markdown syntax specification. So, I'm in. I want to spread
the word and even use it in my own blog.&lt;/p&gt;
&lt;p&gt;The trouble number one is that Jekyll uses &lt;a class="reference external" href="https://rubygems.org/gems/kramdown"&gt;kramdown&lt;/a&gt; by default.
So we find a gem and the gem is &lt;a class="reference external" href="https://rubygems.org/gems/jekyll-commonmark"&gt;jekyll-commonmark&lt;/a&gt;. Oh hell, we lost
syntax highlighting :(&lt;/p&gt;
&lt;p&gt;The trouble number two is that CommonMark standard lacks support for
server side syntax highlighting. That's bad, I don't want any JavaScript
on my static pages. Let's try to wrap it somehow and enable
syntax highligting.&lt;/p&gt;
&lt;p&gt;The strong side of Ruby CommonMark implementation, &lt;a class="reference external" href="https://rubygems.org/gems/commonmarker"&gt;CommonMarker&lt;/a&gt; is
its ability to parse a document to the abstract syntax tree, so let's use
it to extract our blocks and highlight them with &lt;a class="reference external" href="https://rubygems.org/gems/rouge"&gt;Rouge&lt;/a&gt; for example.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://sandfox.me/ruby/embracing-commonmark.html"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</summary>
<category term="commonmark" label="commonmark"/>
<category term="commonmarker" label="commonmarker"/>
<category term="commonmarker-rouge" label="commonmarker-rouge"/>
<category term="my-projects" label="my projects"/>
<category term="rouge" label="rouge"/>
<category term="ruby-gems" label="ruby gems"/>
</entry>
<entry>
<title>How to work with Ruby strings in C extensions</title>
<id>https://sandfox.me/ruby/ruby-strings-in-c-ext.html</id>
<updated>2016-04-05T01:40:00+03:00</updated>
<published>2016-04-05T01:40:00+03:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/ruby/ruby-strings-in-c-ext.html"/>
<summary type="html">&lt;div class="section" id="the-problem"&gt;
&lt;h2&gt;The Problem&lt;/h2&gt;
&lt;p&gt;That's about string types in C and Ruby. As you may know, C uses
&lt;a class="reference external" href="https://en.wikipedia.org/wiki/Null-terminated_string"&gt;null-terminated strings&lt;/a&gt;
while Ruby uses more sophisticated string type, therefore C strings
cannot contain null byte while Ruby strings can. Many Ruby gems are
written in C but what happens when you convert Ruby string to the C string?&lt;/p&gt;
&lt;p&gt;&lt;a href="https://sandfox.me/ruby/ruby-strings-in-c-ext.html"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</summary>
<category term="c" label="c"/>
<category term="ruby-gems" label="ruby gems"/>
</entry>
<entry>
<title>When does journald-native work better?</title>
<id>https://sandfox.me/ruby/journrald-native.html</id>
<updated>2016-04-05T01:20:00+03:00</updated>
<published>2016-04-05T01:20:00+03:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/ruby/journrald-native.html"/>
<summary type="html">&lt;div&gt;&lt;p&gt;There is already a nice gem called &lt;code class="docutils literal"&gt;&lt;span class="pre"&gt;systemd-journal&lt;/span&gt;&lt;/code&gt;,
why another one? Well, because there are some edge cases that it does
not cover. I had a trouble with one.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://sandfox.me/ruby/journrald-native.html"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</summary>
<category term="journald-native" label="journald-native"/>
<category term="my-projects" label="my projects"/>
<category term="ruby-gems" label="ruby gems"/>
<category term="systemd" label="systemd"/>
<category term="systemd-journal" label="systemd-journal"/>
</entry>
<entry>
<title>What Is Dead May Never Die</title>
<id>https://sandfox.me/linux/greyjoy.html</id>
<updated>2016-03-21T16:00:00+03:00</updated>
<published>2016-03-21T16:00:00+03:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/linux/greyjoy.html"/>
<summary type="html">&lt;div&gt;&lt;p&gt;Let's have some fun with the &lt;a class="reference external" href="https://awoiaf.westeros.org/index.php/Drowned_God"&gt;Drowned God&lt;/a&gt; and &lt;a class="reference external" href="https://en.wikipedia.org/wiki/Unix_signal"&gt;Unix signals&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This is a simple program that catches &lt;code class="docutils literal"&gt;SIGINT&lt;/code&gt; and &lt;code class="docutils literal"&gt;SIGTERM&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://sandfox.me/linux/greyjoy.html"&gt;Read more…&lt;/a&gt; (1 min remaining to read)&lt;/p&gt;&lt;/div&gt;</summary>
<category term="c" label="c"/>
<category term="fun" label="fun"/>
<category term="game-of-thrones" label="game of thrones"/>
<category term="unix-signals" label="unix signals"/>
</entry>
<entry>
<title>Kinda Blog</title>
<id>https://sandfox.me/misc/begin.html</id>
<updated>2016-03-09T17:08:49+03:00</updated>
<published>2016-03-09T17:08:49+03:00</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/misc/begin.html"/>
<summary type="html">&lt;div&gt;&lt;p&gt;In the beginning there was a Gemfile. And the Gemfile contained &lt;code class="highlight ruby"&gt;&lt;span class="n"&gt;gem&lt;/span&gt; &lt;span class="s1"&gt;'jekyll'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s1"&gt;'~&amp;gt; 3.1'&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;I may post some earlier notes with earlier dates&lt;/p&gt;&lt;/div&gt;</summary>
<category term="blog" label="blog"/>
<category term="jekyll" label="jekyll"/>
</entry>
<entry>
<title>systemd in Zabbix</title>
<id>https://sandfox.me/linux/systemd-zabbix.html</id>
<updated>2015-01-17T12:00:00Z</updated>
<published>2015-01-17T12:00:00Z</published>
<author>
<name>Anton Smirnov</name>
</author>
<link rel="alternate" type="text/html" href="https://sandfox.me/linux/systemd-zabbix.html"/>
<summary type="html">&lt;div&gt;&lt;p&gt;If you use Zabbix to monitor your servers you may want to monitor
systemd services with it especially if you have some custom services.&lt;/p&gt;
&lt;p&gt;These simple checks were enough for me:&lt;/p&gt;
&lt;pre class="code sh"&gt;&lt;a name="rest_code_78d0a5caa8aa43199d3fcd9937da7b93-1"&gt;&lt;/a&gt;systemd.unit.is-active&lt;span class="o"&gt;[&lt;/span&gt;&amp;lt;unit name&amp;gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="c1"&gt;# 1 if unit is active, 0 if inactive&lt;/span&gt;
&lt;a name="rest_code_78d0a5caa8aa43199d3fcd9937da7b93-2"&gt;&lt;/a&gt;systemd.unit.is-failed&lt;span class="o"&gt;[&lt;/span&gt;&amp;lt;unit name&amp;gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="c1"&gt;# 1 if unit if in failed state, 0 if not&lt;/span&gt;
&lt;a name="rest_code_78d0a5caa8aa43199d3fcd9937da7b93-3"&gt;&lt;/a&gt;systemd.unit.is-enabled&lt;span class="o"&gt;[&lt;/span&gt;&amp;lt;unit name&amp;gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="c1"&gt;# 1 if unit is enabled, 0 if not&lt;/span&gt;
&lt;/pre&gt;&lt;p&gt;It's very simple. Just place &lt;code class="docutils literal"&gt;userparameter_systemd.conf&lt;/code&gt; to your zabbix config dir
(usually &lt;code class="docutils literal"&gt;/etc/zabbix_agentd.conf.d&lt;/code&gt;) with the following content:&lt;/p&gt;
&lt;pre class="code ini"&gt;&lt;a name="rest_code_8763991777ea4aa484f93db93a6d2f33-1"&gt;&lt;/a&gt;&lt;span class="c1"&gt;# checks to determine if specified unit is active, failed or enabled&lt;/span&gt;
&lt;a name="rest_code_8763991777ea4aa484f93db93a6d2f33-2"&gt;&lt;/a&gt;&lt;span class="na"&gt;UserParameter&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;systemd.unit.is-active[*],systemctl is-active --quiet '$1' &amp;amp;&amp;amp; echo 1 || echo 0&lt;/span&gt;
&lt;a name="rest_code_8763991777ea4aa484f93db93a6d2f33-3"&gt;&lt;/a&gt;&lt;span class="na"&gt;UserParameter&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;systemd.unit.is-failed[*],systemctl is-failed --quiet '$1' &amp;amp;&amp;amp; echo 1 || echo 0&lt;/span&gt;
&lt;a name="rest_code_8763991777ea4aa484f93db93a6d2f33-4"&gt;&lt;/a&gt;&lt;span class="na"&gt;UserParameter&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s"&gt;systemd.unit.is-enabled[*],systemctl is-enabled --quiet '$1' &amp;amp;&amp;amp; echo 1 || echo 0&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;</summary>
<category term="systemd" label="systemd"/>
<category term="zabbix" label="zabbix"/>
</entry>
</feed>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment