<?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 Powersurge⚡️ on Medium]]></title>
        <description><![CDATA[Stories by Powersurge⚡️ on Medium]]></description>
        <link>https://medium.com/@powersurge01?source=rss-78784d7d635e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*uOAJavPY7lHhoycmJ3Wc0w.jpeg</url>
            <title>Stories by Powersurge⚡️ on Medium</title>
            <link>https://medium.com/@powersurge01?source=rss-78784d7d635e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 02:23:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@powersurge01/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[Migranes and cholesterol]]></title>
            <link>https://medium.com/@powersurge01/migranes-and-cholesterol-417a64cf5433?source=rss-78784d7d635e------2</link>
            <guid isPermaLink="false">https://medium.com/p/417a64cf5433</guid>
            <category><![CDATA[migraines]]></category>
            <category><![CDATA[wellness]]></category>
            <category><![CDATA[cholesterol]]></category>
            <dc:creator><![CDATA[Powersurge⚡️]]></dc:creator>
            <pubDate>Tue, 06 Dec 2022 16:08:53 GMT</pubDate>
            <atom:updated>2022-12-06T16:08:53.318Z</atom:updated>
            <content:encoded><![CDATA[<p>If you have migraines (like I do), listen to this: check your cholesterol level. If its high, thats maybe why…</p><p>I have been struggling with frequent, long and powerful headaches all my life. I was also having chest pains. After noticing that my chest pains were getting worse I started googling it. I started to believe that those pains were signs of heart attack. I went to a doctor, checked everything and the only thing I found was wrong is cholesterol level. I am pretty skinny so it was as surprise for me, so it just may be inherited condition.</p><p>I took a course of 20mg Atorvastatine for 3 months and after having naturally high cholesterol (209) it went down to 97. My chest pains become much lighter and my headaches improved dramatically.</p><p>My thinking is high cholesterol thickens blood and during stress times, blood “hurts” when goes through organs (like heart or your brain).</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=417a64cf5433" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Skeles API]]></title>
            <link>https://medium.com/@powersurge01/skeles-api-64d8ec34ec4?source=rss-78784d7d635e------2</link>
            <guid isPermaLink="false">https://medium.com/p/64d8ec34ec4</guid>
            <dc:creator><![CDATA[Powersurge⚡️]]></dc:creator>
            <pubDate>Wed, 20 Apr 2022 20:11:11 GMT</pubDate>
            <atom:updated>2022-06-10T19:09:22.969Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*uL0MS7Jjdei8g1TcllOumw.gif" /></figure><p>Do you wanna build something using <a href="https://objkt.com/collection/rcs">Random Common Skeles</a> by John Karel (aka jjjjjohn)? It could be custom marketplace, some statistics or anything you want. To start, you can use this API (<a href="https://public-api.skeles.com/v1/graphql">https://public-api.skeles.com/v1/graphql</a>):</p><p><a href="https://cloud.hasura.io/public/graphiql?endpoint=https://public-api.skeles.com/v1/graphql">Public GraphiQL - Hasura</a></p><p><strong>Here are some useful queries:</strong></p><p>Active market listings ordered by date:</p><pre>query MyQuery {<br>  active_market_listings(order_by: {date: desc}, limit: 10) {<br>    date<br>    token_id<br>    seller_id<br>    price<br>  }<br>}</pre><p>Here is how you get a specific skele (by its ID):</p><pre>query MyQuery {<br>  skele_token(<br>    where: {id: {_eq: &quot;103990539156354728427986578093680068082834954658477001707307222902966167567305&quot;}}<br>  ) {<br>    arm<br>    artifact_uri<br>    background<br>    body<br>    bottom<br>    glasses<br>    hand<br>    hat<br>    name<br>    top<br>    owner_id<br>  }<br>}</pre><p>If you want to get all the skeles owned by a particular wallet:</p><pre>query MyQuery {<br>  skele_token(where: {owner_id: {_eq: &quot;tz1hh72zeG6wMW1giedBUvbu3PKQiNNX4Hwk&quot;}}) {<br>    name<br>    top<br>    id<br>    owner_id<br>  }<br>}</pre><p>If you don’ t understand what those <em>_eq, _gte or _nregex </em>mean, read this: <a href="https://hasura.io/docs/latest/graphql/core/databases/postgres/queries/query-filters/">https://hasura.io/docs/latest/graphql/core/databases/postgres/queries/query-filters/</a></p><p>If you want to show (or download) the actual image of the skele, I have them all stored on my AWS S3 server. I have opened access to everyone. To fetch an skele image (its actually a optimized .mp4) you take a skele ID and add it like this:</p><pre><a href="https://skeles.s3.amazonaws.com/feed/100000531923949209162209368389625844466268829635846690090339594494683882048735.mp4">https://skeles.s3.amazonaws.com/feed/100000531923949209162209368389625844466268829635846690090339594494683882048735.mp4</a></pre><p>This long number at the end is skele ID. You just swap the ID and you can get the skele .mp4</p><p>Why .mp4 and not .gif. Because .mp4 is much lighter. But if you still need a .gif you can get it like this:</p><pre><a href="https://skeles.s3.amazonaws.com/artifact/QmNLfZyCMCmvL42jkeRUc8w8huDhFFvXpjvm1WJpF9kKfo">https://skeles.s3.amazonaws.com/artifact/QmNLfZyCMCmvL42jkeRUc8w8huDhFFvXpjvm1WJpF9kKfo</a></pre><p>Where this last hash (QmNLfZyCMCmvL42jkeRUc8w8huDhFFvXpjvm1WJpF9kKfo) is the IPFS address. You can get it from the API (artifact_uri).</p><p>If this playground starts capping on you, just hit me up on twitter(SergueiV), I will set you up with a separate sever that will have better reliability. This playground is just to get you started :)</p><p>Leave comments or questions below so I can update this article to cover this topic better.</p><p>Thank you <a href="https://twitter.com/marchingsquare">Marchingsquare</a> for inspiration and <a href="https://twitter.com/TezosBakingBad">Baking Bad</a> for creating and maintaining <a href="https://dipdup.net/">dipdup framework</a> (which i used to create the indexer) 🙏</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fe47Fp1AipX8&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3De47Fp1AipX8&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/a9ceb0eeb78cc93835a85ace792ee6b8/href">https://medium.com/media/a9ceb0eeb78cc93835a85ace792ee6b8/href</a></iframe><p>UPDATE: I have abandoned this project. If you have any interest in this API or help setting it up, hit me up on twitter (SergueiV)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64d8ec34ec4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Easy struct initialization in Swift]]></title>
            <link>https://medium.com/@powersurge01/easy-struct-initialization-in-swift-8ee46b8d84d5?source=rss-78784d7d635e------2</link>
            <guid isPermaLink="false">https://medium.com/p/8ee46b8d84d5</guid>
            <category><![CDATA[ios]]></category>
            <category><![CDATA[swift]]></category>
            <dc:creator><![CDATA[Powersurge⚡️]]></dc:creator>
            <pubDate>Fri, 06 Jan 2017 19:45:56 GMT</pubDate>
            <atom:updated>2017-01-06T19:45:56.414Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LLe11G1MyQcC8-x3U3QOUw.png" /></figure><p>Did you know that swift has automatic init generation for all of your properties? Let’s say you have amyStruct :</p><pre>struct myStruct {<br>    let myString: String?<br>    let myInt: Int?<br>    let myDouble: Double?<br>}</pre><p>In a situation like this you don’t even need to write init It has been automatically generated for you!</p><p>Try instantiating it and will see autocomplete like that:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3bjxlnpeOM41tNzym81OUQ.png" /></figure><p>BOOM! You saved yourself 2 minutes of typing!</p><p>But there is a catch: you have to set all those 3 parameters with some values or nil</p><pre>myStruct(myString: &quot;Something&quot;, myInt: nil, myDouble: nil)</pre><p>Does it work with classes? NO</p><p>Another thing you can do is to set your init argument as optional ! It requires the typing of the actual init method. After any parameter you simply add =nil☝️ and this parameter becomes <strong>optional</strong>!</p><pre>struct myStructWithInit {<br>    let myString: String?<br>    let myInt: Int?<br>    let myDouble: Double?<br>    <br>    init(myString: String? = nil, //👈<br>         myInt: Int? = nil,<br>         myDouble: Double? = nil) {<br>        <br>        self.myString = myString<br>        self.myInt = myInt<br>        self.myDouble = myDouble<br>    }<br>}</pre><p>Now when you instantiate this struct your autocomplete will have initializer with <strong>no parameters at all </strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kAHAYS0D5FWu9k576W4AZw.png" /></figure><p>But it <strong>also</strong> means that you can instantiate it with only <strong>one or any</strong> optional parameters. It gives you freedom 😉</p><pre>myStructWithInit(myString: &quot;Something&quot;)<br>or<br>myStructWithInit(myString: &quot;Something&quot;, myInt: 2)<br>or<br>myStructWithInit(myString: &quot;Something&quot;, myInt: 2, myDouble: 3.0)</pre><p>Add any parameters you want and delete the rest!!!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8ee46b8d84d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Most common memory leak trap in Swift]]></title>
            <link>https://medium.com/@powersurge01/most-common-memory-leak-trap-in-swift-4565dbae5445?source=rss-78784d7d635e------2</link>
            <guid isPermaLink="false">https://medium.com/p/4565dbae5445</guid>
            <category><![CDATA[swift]]></category>
            <category><![CDATA[ios]]></category>
            <dc:creator><![CDATA[Powersurge⚡️]]></dc:creator>
            <pubDate>Wed, 04 Jan 2017 21:45:33 GMT</pubDate>
            <atom:updated>2017-01-06T14:28:42.448Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GHRuhXE1kUqkHdYd6NeJ4g.png" /></figure><p>Have you ever called a method that takes a closure in Swift? Something that looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*m3tmB_C4pXfCJayvbdfNTQ.png" /></figure><p>If you write any code in that closure that refers to <strong>self.</strong>it is a potential memory leak.</p><p>You can easily test your memory leaks with the “Debug memory graph” in xCode by pressing that weird button that looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-BDJhvJ7yE4wXF-suUNsWA.png" /></figure><p>If you have memory cycles it will show you warnings like that in the debugger:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/408/1*2XYvcSf8YiWx4mGSb3eqNg.png" /></figure><p>If you do have one (or usually bunch) it is showing you that you have an object that has been leaked.</p><p>How do you prevent that?</p><p>It is as simple as adding <strong>[unowned self]</strong>into the first line of your closure!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3Tvp4SWFI2RwYDD8McNLiA.png" /></figure><p>THAT’S IT! It will stop the leak.</p><p>The reason why the memory leak is happening is because closures in Swift have to capture the scope (i.e. everything that between those {} brakets) and if you refer to anything <strong>self.</strong> it has to retain a strong pointer to that object and it is never gets released even the whole viewController may have been deallocated.</p><p><strong>[unowned self]</strong>is your friend in Swift closures!</p><p>UPDATE: As Medium readers pointed out, it is also possible instead of [unowned self] to use [weak self] which will <strong>also stop the leak</strong>. However there are some important considerations pointed out by <a href="https://medium.com/@tudorandreimarinescu?source=post_header_lockup">Tudor Andrei Marinescu</a>:</p><blockquote>The difference between unowned and weak is that weak is declared as an Optional while unowned is not. By declaring it weak you get to handle the case that it might be nil inside the closure at some point. If you try to access an unowned variable that happens to be nil, it will crash the whole program. So only use unowned when you are positive that variable will always be around while the closure is around</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4565dbae5445" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>