<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Daniel Zagidullin on Medium]]></title>
        <description><![CDATA[Stories by Daniel Zagidullin on Medium]]></description>
        <link>https://medium.com/@dnzg?source=rss-ab64a83360e5------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Q0MHDWOe5f2d4JSFEQUPzQ.jpeg</url>
            <title>Stories by Daniel Zagidullin on Medium</title>
            <link>https://medium.com/@dnzg?source=rss-ab64a83360e5------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 18:47:34 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dnzg/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[5 Best Gifts of 2025 (None of Them Come in a Box)]]></title>
            <link>https://medium.com/@dnzg/5-best-gifts-of-2025-none-of-them-come-in-a-box-d9ac7392cb23?source=rss-ab64a83360e5------2</link>
            <guid isPermaLink="false">https://medium.com/p/d9ac7392cb23</guid>
            <category><![CDATA[gift-ideas-for-girlfriend]]></category>
            <category><![CDATA[gifts]]></category>
            <category><![CDATA[gift-ideas-for-boyfriend]]></category>
            <category><![CDATA[gift-ideas]]></category>
            <category><![CDATA[present]]></category>
            <dc:creator><![CDATA[Daniel Zagidullin]]></dc:creator>
            <pubDate>Thu, 01 May 2025 13:53:34 GMT</pubDate>
            <atom:updated>2025-05-01T13:53:34.502Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vSRg-qizVW4inEMu5QTf3g.png" /></figure><p>In 2025, the best gifts aren’t things you can wrap. They’re experiences. Moments. Emotions. Here are 5 gifts that go deeper than “I saw this and thought of you” — they say, “I know what will stay with you.”</p><h3>1. A Calm or Headspace Subscription</h3><p><strong>What it is:</strong> A full year of mindfulness, sleep sounds, and breathing exercises.</p><p><strong>Why it matters:</strong> Most people won’t buy this for themselves — but everyone needs it.</p><p><strong>For whom:</strong> Anyone stressed, working remotely, or struggling to unwind.</p><p>Get it here: <a href="https://www.calm.com/">Calm</a> or <a href="https://www.headspace.com/">Headspace</a></p><h3>2. A Custom Book (GPT + Canva = Magic)</h3><p><strong>What it is:</strong> You generate a story about your loved one using ChatGPT, lay it out in Canva, and print it.</p><p><strong>Why it matters:</strong> It’s one of one. It feels like a novel written just for them.</p><p><strong>For whom:</strong> Your partner. Your parent. Your kid. Yourself.</p><p>Get it here: <a href="https://chatgpt.com/">ChatGPT</a> and <a href="https://www.canva.com/">Canva</a></p><h3>3. Feelix — A Netflix-Style Gift Site</h3><p><strong>What it is:</strong> A site that looks like Netflix but plays heartfelt video messages from friends, family, and coworkers.</p><p><strong>Why it matters:</strong> It’s cinematic, tear-worthy, and takes just hours to set up — no code needed.</p><p><strong>For whom:</strong> Someone you deeply care about.</p><p>Get it here: <a href="https://feelix.us/"><strong>Feelix</strong></a></p><h3>4. The Gift of “Nothing”</h3><p><strong>What it is:</strong> A promise to handle their errands, kids, calendar, anything — so they can do literally nothing.</p><p><strong>Why it matters:</strong> Everyone has stuff. No one has time.</p><p><strong>For whom:</strong> Burnt-out parents. Busy friends. Overachievers.</p><h3>5. A Ticket to Their Favorite Band or Team</h3><p><strong>What it is:</strong> A seat at a concert, game, or live event they’ll never forget.</p><p><strong>Why it matters:</strong> Music and sport unlock something primal — energy, emotion, connection. You never leave the same.</p><p><strong>For whom:</strong> Anyone who needs to <em>feel</em> something real.</p><p><strong>In summary:</strong></p><p>The best gifts don’t gather dust — they gather emotion.</p><p>Give something they’ll remember long after the day is over.</p><p>Give something they’ll replay.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d9ac7392cb23" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Community to Code: Superside’s Copy/Paste Plugin for Sanity]]></title>
            <link>https://medium.com/superside-engineering/sanity-copy-paste-plugin-d80e06d58dcf?source=rss-ab64a83360e5------2</link>
            <guid isPermaLink="false">https://medium.com/p/d80e06d58dcf</guid>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[content-marketing]]></category>
            <category><![CDATA[sanity]]></category>
            <category><![CDATA[cms]]></category>
            <category><![CDATA[plugins]]></category>
            <dc:creator><![CDATA[Daniel Zagidullin]]></dc:creator>
            <pubDate>Thu, 06 Jul 2023 08:21:38 GMT</pubDate>
            <atom:updated>2023-07-06T08:21:38.113Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z1jA5-PMyuRttyMfWLMq4g.png" /></figure><p>At Superside, we’ve been on an exciting journey, using the power of Sanity. We’ve witnessed a ton of new features and improvements, such as visual editing, enhanced database search, and an overall improvement in developer experience.</p><h3>Superside Content Model</h3><p>Our content model is built on “blocks”. This means that every component you see on superside.com is mirrored as an object in Sanity. These blocks are incredibly flexible and easy to set up, but they posed a unique challenge.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J9RL8izRvRBFJorbny76vQ.png" /><figcaption>Internal blocks structure of <a href="https://superside.com/">superside.com</a> pages</figcaption></figure><p>Our content editors faced a significant challenge: they <strong>could not</strong> copy a single block without copying the entire document. This meant copying each field from a component one by one, a slow and frustrating process.</p><h3>Finding Inspiration in a Feature Request</h3><p>Our search for a solution led us to a <a href="https://github.com/sanity-io/sanity/issues/2994">feature request</a> in Sanity’s repository, that had been unresolved since the end of 2021. This sparked an idea: why not develop the feature ourselves?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_Y0kiyxiMdP-tfesN21JIw.png" /><figcaption>Copy/paste feature request in Sanity repo</figcaption></figure><h3>The Birth of the Copy/Paste Plugin: An Open-Source Contribution</h3><p>We saw the potential value of this feature for our project and others, so we decided to develop it ourselves and then release it as an open-source contribution. This decision has since sped up and simplified our editors’ workflow significantly.</p><h3>Simplicity and Efficiency</h3><p>The beauty of our plugin lies in its simplicity. If you have type: &#39;array&#39; which consists of type: &#39;object&#39; and you want to copy/paste such objects between arrays in different documents, all you need to do is install our plugin and import the new field: defineField(copyPaste)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yfgm3aQEVEqCm2nJQDrxJg.png" /><figcaption>Simple implementation, described in the package README</figcaption></figure><p>The core of the plugin is in src/components/CopyPasteInput.tsx. It renders three buttons using Sanity/UI: copy, paste, and… duplicate to multiple pages! We realized that if we had a script for copying and inserting whole blocks, why not have a button, which could paste one component to multiple documents at once?</p><h3>Copy, Paste, and Duplicate</h3><p>The process is simple. After clicking Copy, the onCopy function writes the schema of the currently opened block to your localStorage. Then, all you need to do is switch to another document, create an empty version of the block, and click Paste. The plugin takes the JSON from localStorage, replaces all keys inside it to make it unique, and updates the document using the useClient hook. The process for duplicating the object to multiple pages is similar but performed in a cycle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*q0q-pvA2LbKLlCsZ.gif" /><figcaption>How it works</figcaption></figure><h3>Try the Copy/Paste Plugin Today</h3><p>Check out the plugin on the Sanity store and experience the potential crucial speed increase in your work. And while you’re at it, consider checking out Superside. We also can reduce your production cost significantly compared to traditional creative agencies :)</p><p>Install the plugin to your Sanity project: <a href="https://www.sanity.io/plugins/copy-paste"><strong>Sanity.io Plugins</strong></a></p><p>Contribute to our Github: <a href="https://github.com/superside-oss/sanity-copy-paste"><strong>@superside-oss/sanity-copy-paste</strong></a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d80e06d58dcf" width="1" height="1" alt=""><hr><p><a href="https://medium.com/superside-engineering/sanity-copy-paste-plugin-d80e06d58dcf">From Community to Code: Superside’s Copy/Paste Plugin for Sanity</a> was originally published in <a href="https://medium.com/superside-engineering">Superside Engineering</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Knapsack problem или задача о ранце]]></title>
            <link>https://medium.com/design-pub/knapsack-problem-%D0%B8%D0%BB%D0%B8-%D0%B7%D0%B0%D0%B4%D0%B0%D1%87%D0%B0-%D0%BE-%D1%80%D0%B0%D0%BD%D1%86%D0%B5-c9a358146fa9?source=rss-ab64a83360e5------2</link>
            <guid isPermaLink="false">https://medium.com/p/c9a358146fa9</guid>
            <category><![CDATA[php]]></category>
            <category><![CDATA[russian]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Daniel Zagidullin]]></dc:creator>
            <pubDate>Fri, 01 Jan 2016 17:26:59 GMT</pubDate>
            <atom:updated>2016-01-02T09:34:00.937Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xKwVHjd9D9Gk9xspLKcXZg.jpeg" /><figcaption><a href="http://www.backpackstrends.com/category/for-men">backpackstrends.com</a></figcaption></figure><p>Думаю, стоит сначала представиться. Я Даниял Загидуллин, по роду деятельности — дизайнер. Но последнее время все чаще я занимаюсь вёрсткой и кодингом.</p><p>Для одного из своих проектов мне нужно было изящное решение “Задачи о ранце” (knapsack problem). Её суть, на первый взгляд, довольно проста: у нас есть N-ое количество предметов, каждый из которых весит X килограмм, которые нужно уложить в рюкзак вместимости Y килограмм.</p><p>Если представить на примере, то мы легко поймём, что задача довольно проста.</p><p><em>Macbook </em><strong><em>1кг</em></strong><em>, коробка яблок </em><strong><em>2кг, </em></strong><em>книга</em><strong><em> 0.5кг. <br></em></strong><em>Вместимость рюкзака </em><strong><em>1.5кг.</em></strong></p><p>Очевидно, что оптимальным вариантом будет взять Macbook и книгу. Но что если предметов будет больше? Тогда нам нужно писать скрипт.</p><p>Русскоязычный интернет молчал по поводу решению данной проблемы на PHP, посему пришлось сходить в англоязычный. <br><a href="http://pastebin.com/nANP2dbn">Решение</a> было найдено, хоть и длинное, поэтому я немного его укоротил под свои нужды и выкладываю здесь.</p><pre>&lt;?php</pre><pre>class Balancer {</pre><pre>public static function balance($items, $key, $maxWeight) {</pre><pre>$result = array();</pre><pre>$numItems = count($items);</pre><pre>$sack = self::buildSack($numItems, $maxWeight);</pre><pre>for ($n = 1; $n &lt;= $numItems; $n++) {</pre><pre>for ($weight = 1; $weight &lt;= $maxWeight; $weight++) {</pre><pre>$a = $sack[$n — 1][$weight][‘value’];</pre><pre>$b = null;</pre><pre>$value = $items[$n — 1][$key];</pre><pre>if ($value &lt;= $weight) {</pre><pre>$b = $value + $sack[$n — 1][$weight — $value][‘value’];</pre><pre>}</pre><pre>$sack[$n][$weight][‘value’] = ($b === null ? $a : max($a, $b));</pre><pre>$sack[$n][$weight][‘take’] = ($b === null ? false : $b &gt; $a);</pre><pre>}</pre><pre>}</pre><pre>$setA = array();</pre><pre>for ($n = $numItems, $weight = $maxWeight; $n &gt; 0; $n — ) {</pre><pre>$item = $items[$n — 1];</pre><pre>$value = $item[$key];</pre><pre>if ($sack[$n][$weight][‘take’]) {</pre><pre>$setA[] = $item;</pre><pre>$weight = $weight — $value;</pre><pre>}</pre><pre>}</pre><pre>return array($setA);</pre><pre>}</pre><pre>protected static function buildSack($width, $height) {</pre><pre>$sack = array();</pre><pre>for ($x = 0; $x &lt;= $width; $x++) {</pre><pre>$sack[$x] = array();</pre><pre>for ($y = 0; $y &lt;= $height; $y++) {</pre><pre>$sack[$x][$y] = array(</pre><pre>‘value’ =&gt; 0,</pre><pre>‘take’ =&gt; false</pre><pre>);</pre><pre>}</pre><pre>}</pre><pre>return $sack;</pre><pre>}</pre><pre>}</pre><pre>$players = array(</pre><pre>array(‘time’ =&gt; 3),</pre><pre>array(‘time’ =&gt; 2),</pre><pre>array(‘time’ =&gt; 8),</pre><pre>array(‘time’ =&gt; 5)</pre><pre>);</pre><pre>$maxWeight = 12;</pre><pre>$sets = Balancer::balance($players, ‘time’, $maxWeight);</pre><pre>$setA = $sets[0];</pre><pre>$sum = 0;</pre><pre>foreach ($setA as $player) {</pre><pre>$sum = $player[‘time’];</pre><pre>echo $sum;</pre><pre>}</pre><pre>?&gt;</pre><p>Спасибо, что дочитали до этого места :)<br>На Medium я новичок, но искренне хочу, чтобы это был не последний текст здесь.</p><p>Всегда ваш, Даня.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/64/1*S_NFEZTfzUhTAxKjSoIt4Q.png" /><figcaption><a href="https://dnzg.ru/">dnzg.ru</a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c9a358146fa9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/design-pub/knapsack-problem-%D0%B8%D0%BB%D0%B8-%D0%B7%D0%B0%D0%B4%D0%B0%D1%87%D0%B0-%D0%BE-%D1%80%D0%B0%D0%BD%D1%86%D0%B5-c9a358146fa9">Knapsack problem или задача о ранце</a> was originally published in <a href="https://medium.com/design-pub">Дизайн-кабак</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>