<?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 Bryan Joseph on Medium]]></title>
        <description><![CDATA[Stories by Bryan Joseph on Medium]]></description>
        <link>https://medium.com/@iambryan?source=rss-2b215fdda41b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*XBk0SOcaF2PPQUpJ.jpeg</url>
            <title>Stories by Bryan Joseph on Medium</title>
            <link>https://medium.com/@iambryan?source=rss-2b215fdda41b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 19:58:57 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@iambryan/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[TIL: Attaching IPFS folder to a Stellar Account]]></title>
            <link>https://medium.com/revelry-labs/til-attaching-ipfs-folder-to-a-stellar-account-5a373ac4a8b5?source=rss-2b215fdda41b------2</link>
            <guid isPermaLink="false">https://medium.com/p/5a373ac4a8b5</guid>
            <category><![CDATA[stellar]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[ipfs]]></category>
            <dc:creator><![CDATA[Bryan Joseph]]></dc:creator>
            <pubDate>Mon, 18 Mar 2019 19:32:45 GMT</pubDate>
            <atom:updated>2019-05-21T15:21:00.773Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8gpcvWKKNerWqfJC69FSpg.jpeg" /></figure><p>A Stellar account can have arbitrary data associated with it through <a href="https://www.stellar.org/developers/guides/concepts/list-of-operations.html#manage-data">Data Entries</a>. Don’t abuse it though. Each entry adds to the minimum balance needed on the account.</p><p>A lot of blockchains use <a href="https://ipfs.io/">IPFS</a> to store documents in a verifiable way.</p><p><strong><em>But I thought, wouldn’t it be great if people could see documents associated with a Stellar account for visibility and verifiability?</em></strong></p><p><a href="https://revelry.co/ipfs-stellar/"><strong>Check out the original post on Revelry.co to check out how to do it, and how to get the information back</strong></a></p><p>Attaching the hash to the folder in IPFS makes it so you can add items to it without having to update the value in the data entry every time something is added to it.</p><p><em>Originally published at </em><a href="https://revelry.co/ipfs-stellar/"><em>revelry.co</em></a><em> on March 18, 2019.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5a373ac4a8b5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/revelry-labs/til-attaching-ipfs-folder-to-a-stellar-account-5a373ac4a8b5">TIL: Attaching IPFS folder to a Stellar Account</a> was originally published in <a href="https://medium.com/revelry-labs">Revelry</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Tame your GitHub Notifications: Never Miss Another Pull Request Review!]]></title>
            <link>https://medium.com/revelry-labs/tame-your-github-notifications-never-miss-another-pull-request-review-988f56353ab2?source=rss-2b215fdda41b------2</link>
            <guid isPermaLink="false">https://medium.com/p/988f56353ab2</guid>
            <category><![CDATA[notifications]]></category>
            <category><![CDATA[productivity]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Bryan Joseph]]></dc:creator>
            <pubDate>Thu, 07 Feb 2019 13:17:41 GMT</pubDate>
            <atom:updated>2019-05-10T18:30:49.239Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KRmnuj__hN8WxT_JJa4JtA.jpeg" /></figure><p>GitHub has a lot of tools for handling notifications. This doesn’t necessarily guarantee ease of use. It’s really easy to forget to return to an issue, or miss a pull request you were assigned to review.</p><p>I’ve got some great tools and simple methods to tame your GitHub notifications. Let’s dig in.</p><h3>Managing GitHub notifications in email</h3><p>The first thing to do is to get a handle on email notifications. If you have a personal GitHub account that you also use for work, you can end up with a pile of emails from both worlds cluttering up your personal email inbox.</p><p>Go to <a href="https://github.com/settings/emails">Email settings in GitHub</a> and add your work email. After you verify it, you can set it as the primary email address.</p><p>You’ll also want to visit <a href="https://github.com/settings/notifications">Notification settings in GitHub</a> to set up specific email update settings. At the bottom there is a section titled Custom Routing. You can route email notifications to different emails at the organization level. Select your work organization and select your work email. Now your personal inbox won’t have work-related email notifications going to it. This also means you can get a better idea of which work-related GitHub notifications you should look into. Work/Life (inbox) balance completed!</p><h3>Next-Level Email Notifications</h3><p>If you still need to separate notification messages from important customer emails (or if your boss still emails you like it’s 2004), I suggest you use a filtering system in your email. If you use Google (Gmail), this can be handled easily with <a href="https://support.google.com/mail/answer/3094499?co=GENIE.Platform%3DDesktop&amp;hl=en">Inbox Categories &amp; Tabs</a>.</p><p>Click the Settings icon (it looks like a cog) near the top right corner of your Gmail interface, and select Configure Inbox from that menu. From here, you can choose which categories you’d like to show in your inbox view. If you’ve chosen to display only Primary, then your email interface is currently displaying a basic list of email messages.</p><p>Once you choose to display more categories, they will appear as tabs at the top of your inbox view. This will help you separate the different types of messages you receive. Google offers the following options: Primary, Social, Promotions, Updates, and Forums. Google will take a guess at which type of messages should fall into which tab, to keep your primary inbox uncluttered. (You can go back and check its work: Tell it how to treat specific messages if you don’t like their first pass at it.)</p><p>Most likely, your GitHub notifications will automatically self-select into the Forums tab. Magic!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AhlcYOK8sRIZPNWm.jpg" /></figure><p>The Gmail mobile app will honor these same settings, so you should never see 3,698 unread messages on your phone (from GitHub at least). Your mileage <em>will </em>vary if you’re using other mobile email apps.</p><p>And if your work email is managed through something other than Google, try this: <a href="https://www.lifewire.com/auto-filter-sender-mail-to-folder-outlook-1173804">Create filters and rules in Outlook</a> or <a href="https://support.apple.com/guide/mail/use-rules-to-manage-emails-you-receive-mlhlp1017/mac">Use rules to manage emails in Apple Mail</a>.</p><h3>Control and view GitHub notifications at the source</h3><p>While you are visiting <a href="https://github.com/settings/notifications">Notification Settings in GitHub</a>, you can also control your watch settings. I turn off Automatically watch repositories. I don’t need to be notified of all activities in repos that do not concern me.</p><p>If you really want to cut things down, you can also go to <a href="https://github.com/watching">your watching page in GitHub</a> and either unwatch one repo at a time, or all of them.</p><p>In addition to your watching page, there are a few different pages right on GitHub that I like to use to get visibility on my notifications.</p><p><a href="https://github.com/notifications">Your notifications page</a> is a good page to view everything. Notifications are split by repository. This page sometimes becomes my central hub in GitHub.</p><p><a href="https://github.com/pulls">Your pulls page</a> is also a good place to check up on pull requests. On this page, you can use GitHub’s search to further filter what you are looking for. The same can be said for <a href="https://github.com/issues">your issues page</a>, but with issues.</p><h3>Next-Level GitHub alerts</h3><p>To really get a handle on my GitHub notifications — and never miss an important pull request — the tool I personally like to use is <a href="https://octobox.io/">Octobox</a>. <a href="https://github.com/octobox/octobox/blob/master/docs/INSTALLATION.md">You can self host it</a>. I have a personal version hosted in Heroku for myself. Think of it like the notifications page mentioned above, but with a few more bells and whistles. Take a listen to <a href="https://changelog.com/podcast/327">this Changelog Podcast episode featuring the creator of Octobox.</a></p><p>If you like using Slack for all your assignments and alerts, there are several ways you can <a href="https://zapier.com/apps/github/integrations/slack">create webhooks to get notifications right to Slack from GitHub</a> with Zapier. This is especially helpful if you get tagged in on tickets that live in repos you don’t normally watch. Caution: your organization may not authorize access to all of your repos by third party applications. Thankfully, you can still get a Slack notification by using an email workaround.</p><p>Make sure you are watching all relevant repos and getting email notifications. And, in order to avoid duplicate notifications, you can tell your email filters to automatically archive your GitHub messages. Then, <a href="https://zapier.com/apps/gmail/integrations/slack">you can set up a Gmail recipe on Zapier</a>. Based on the GitHub email subject lines, you might choose to filter by <em>mention, </em>by <em>assigned, </em>or by <em>requested your review. </em>This will help you send the notifications you want to see, where you want to see them. You might choose to send them in a direct message to yourself, or to a particular private channel that works best for you.</p><p>I hope I have <em>notified you</em> of enough ways to make GitHub notifications more tolerable. Any tools you want to <em>notify</em> me of? 😎</p><p><em>Originally published at </em><a href="https://revelry.co/github-notifications/"><em>revelry.co</em></a><em> on February 7, 2019.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=988f56353ab2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/revelry-labs/tame-your-github-notifications-never-miss-another-pull-request-review-988f56353ab2">Tame your GitHub Notifications: Never Miss Another Pull Request Review!</a> was originally published in <a href="https://medium.com/revelry-labs">Revelry</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stellar for Practical Blockchain Applications]]></title>
            <link>https://medium.com/revelry-labs/stellar-for-practical-blockchain-applications-6b5a68b96ff9?source=rss-2b215fdda41b------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b5a68b96ff9</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[open-source-software]]></category>
            <category><![CDATA[stellar]]></category>
            <dc:creator><![CDATA[Bryan Joseph]]></dc:creator>
            <pubDate>Tue, 29 Jan 2019 13:54:32 GMT</pubDate>
            <atom:updated>2019-04-30T00:01:31.004Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T5x5wjP2HOkA2eC9jH6eFg.jpeg" /></figure><p>The Blockchain. I ignored it for so long. Too much hype. Too many stories of fraud. Those things are enough, but I absolutely hated that I had to read white papers or have some kind of esoteric knowledge to even begin.</p><p>Last year I started to crack a little. I stepped my toes into the world. I bought some ether in Coinbase and I took a couple of classes online to learn about Ethereum development. Things started to click just a little bit. But still, Ethereum development felt challenging for implementation in our everyday lives.</p><h3>Then, I heard about Stellar.</h3><p>Why does that name sound so familar? Oh that’s right, I signed up for that when Stripe blogged about investing in them years ago. I started digging deeper and liked what I saw. Their documentation showed how to do so many things. And the examples worked! I was up and running in seconds!</p><p>There are many blockchain technologies out there today, but in my opinion, <strong>none of them are as practical as </strong><a href="https://www.stellar.org/"><strong>Stellar</strong></a><strong>.</strong></p><h3>The Stellar Network</h3><p>Besides friendly documentation and ease of getting started, what does Stellar offer? It offers the ability to send assets across their network at high speeds and low cost. <em>The network</em> is its big advantage. An asset can be anything. Stellar makes it dead simple to create your own token. There is even a built-in distributed exchange for putting out offers for those assets (check out Stellar’s own <a href="https://www.stellarx.com/">StellarX</a> for an example at scale). How about smart contracts? Well, if you are looking for <a href="https://en.wikipedia.org/wiki/Turing_completeness">Turing complete</a> smart contracts, it’s best to look elsewhere.</p><h3>Developer Support for Blockchain Applications</h3><p>OK, so, how do you interact with Stellar from a developer’s perspective? Stellar takes the approach of interacting with its network through a <a href="https://www.stellar.org/developers/horizon/reference/index.html">REST API</a>. This allows for libraries to be built in various languages.</p><p><strong>At Revelry we use the </strong><a href="https://www.npmjs.com/package/stellar-sdk"><strong>JavaScript SDK</strong></a><strong>, and we’ve built a </strong><a href="https://hex.pm/packages/stellar"><strong>Stellar client in Elixir</strong></a><strong>.</strong></p><p>The <a href="https://www.stellar.org/developers/">developer documentation</a> Stellar gives is phenomenal! It explains the concepts of the network in plain English. The code examples are very practical. They are easy to follow and most are probably what you will need in real applications.</p><p>Create an account for users? <a href="https://www.stellar.org/developers/guides/get-started/create-account.html">Stellar provides an example</a>.</p><p>Need to make transactions? <a href="https://www.stellar.org/developers/guides/get-started/transactions.html">There’s an example for that</a>.</p><p>Issuing assets or creating your own token? <a href="https://www.stellar.org/developers/guides/issuing-assets.html">Yes, there’s an example for that too</a>.</p><h3>The blockchain is not your application.</h3><p>In the same way a database is not your application, neither is the blockchain. The blockchain is a tool your app uses to achieve parts of its intended functionality. Stellar is a healthy choice to put in your application if you need a blockchain technology.</p><p><strong>Revelry is building </strong><a href="https://incentivize.io/"><strong>Incentivize</strong></a><strong> using Stellar.</strong></p><p>While Stellar is a big part of how it works, the actual code is small compared to other parts. For instance, most of the integration code happens to be around the GitHub API. <a href="https://github.com/revelrylabs/incentivize">Take a look at our open source version and judge for yourself!</a></p><h3>One final thought…</h3><p>There’s always room for improvement, and I’ve only had one complaint with Stellar. It’s one I think other blockchain technologies share.</p><p>There could be more help with creating an account from a non-technical perspective. Yes, you can go to the <a href="https://www.stellar.org/account-viewer/#!/">Stellar Account Viewer</a> to generate a public key and secret. But to actually create an account, you need to have at least one lumen sent to you. Needing a minimum balance is fine, but it would be nice to have a more intuitive setup process.</p><p>In your application, you can make the process simpler for users if you need to. Just like everything else, creating an account is an API call. However, someone will still need to seed the account with the minimum XLM balance. You can <a href="https://www.stellar.org/developers/guides/concepts/fees.html">learn more about Stellar’s fees here</a>.</p><p>If you are selecting a blockchain technology, give Stellar a serious look.</p><p><em>Originally published at </em><a href="https://revelry.co/stellar-blockchain-applications/"><em>revelry.co</em></a><em> on January 29, 2019.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b5a68b96ff9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/revelry-labs/stellar-for-practical-blockchain-applications-6b5a68b96ff9">Stellar for Practical Blockchain Applications</a> was originally published in <a href="https://medium.com/revelry-labs">Revelry</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why I’m Co-organizing The Big Elixir]]></title>
            <link>https://medium.com/the-big-elixir/why-im-co-organizing-the-big-elixir-5700e63e1b06?source=rss-2b215fdda41b------2</link>
            <guid isPermaLink="false">https://medium.com/p/5700e63e1b06</guid>
            <category><![CDATA[conference]]></category>
            <category><![CDATA[elixir]]></category>
            <dc:creator><![CDATA[Bryan Joseph]]></dc:creator>
            <pubDate>Mon, 07 May 2018 12:01:01 GMT</pubDate>
            <atom:updated>2018-05-10T00:03:38.843Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g2rWim2Uw_xWVxV5STiphA.png" /></figure><p>“Creating a conference is hard.” “It takes a lot of time, energy, and planning.” “You have to be a certain kind of crazy to want to create a conference.”</p><p><strong>These are things I have heard time and time again. So why would I agree to organize a conference?</strong></p><p>Let’s go back to 2015. By this time, I had been using Elixir for over a year. I had already created packages and interacted with the community, and Elixir is the first programming language where I did both.</p><p>In February of 2015, I started working on <a href="https://github.com/elixirscript/elixirscript">ElixirScript</a>. Some time later that year, the CFP for the second <a href="https://elixirconf.com/">ElixirConf</a> came up. I wanted to apply, but I was afraid.</p><p>I had presented in front of meetups, but never at a conference. I mentioned it to Joe Ellis, the co-organizer of The Big Elixir. He convinced me to apply by applying himself. My presentation was accepted, and I presented on ElixirScript at ElixirConf 2015. That was also the first real programming conference I attended. I left energized to do even greater things with Elixir! All thanks to Joe for pushing me to apply and for that I am grateful.</p><p>In 2016, I got a lot of offers to speak at conferences. I turned all of them down.</p><p>Not because I didn’t want to, but because I have a fear of flying. Ironically, I married an ex-flight attendant. It is something I want to work on, but it has made it hard to take certain opportunities. I have the privilege to travel around the world and meet awesome people, but I’m kept chained where I am by fear of the friendly skies.</p><p>That fear is actually what planted the seeds for The Big Elixir.</p><p>New Orleans has lots of conferences, and even some technology conferences. But not many programming conferences. The technology conferences that come here tend to focus on business and entrepreneurship in tech more than anything. These kinds of conferences are important, but they are not for me. I want conferences here that I want to attend — the kind that the growing software engineering community wants to attend.</p><p><strong>Conferences that we can get excited about.</strong></p><p>Conferences like <a href="https://rubyconf.org/">RubyConf</a>, which was here last year. I met and chatted with RubyConf attendees for hours. It was great to have here.</p><p>Conferences like <a href="https://clojuresync.com/">Clojure Sync</a>, which <a href="https://lispcast.com/">Eric Normand</a> organized and hosted. I was a volunteer and sat in on all the talks. I’m not a Clojure developer but I genuinely enjoyed the conference. I am excited that Clojure Sync is going to continue to be here.</p><p>JazzCon. VueConf. These are the kinds of experiences I enjoy, and New Orleans deserves more of them.</p><p><strong>So, why would I agree to organize a conference?</strong></p><p>Simply put, I enjoy talking to like minded people about Elixir, and I don’t like flying.</p><p>And creating more programming conferences in New Orleans will help grow the tech community here. And that’s what Joe and I want to do.</p><p>We may have decided to organize a conference, but it didn’t become real until Nicky Mast joined us. She has expertise in organizing conferences and she’s the engine that makes things run.</p><p><strong>Together, we are </strong><a href="https://www.thebigelixir.com/"><strong>The Big Elixir</strong></a><strong> team. The Big Elixir is in New Orleans on November 8th and 9th and we hope you will join us.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5700e63e1b06" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-big-elixir/why-im-co-organizing-the-big-elixir-5700e63e1b06">Why I’m Co-organizing The Big Elixir</a> was originally published in <a href="https://medium.com/the-big-elixir">The Big Elixir</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Upload Files to Amazon S3 Using Pre-signed URLs]]></title>
            <link>https://medium.com/revelry-labs/how-to-upload-files-to-amazon-s3-using-pre-signed-urls-efb7c8ff071?source=rss-2b215fdda41b------2</link>
            <guid isPermaLink="false">https://medium.com/p/efb7c8ff071</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[amazon-s3]]></category>
            <dc:creator><![CDATA[Bryan Joseph]]></dc:creator>
            <pubDate>Tue, 30 Jan 2018 00:48:35 GMT</pubDate>
            <atom:updated>2018-02-09T21:30:37.345Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a8CogM6JPqS4OX9aN9eoVA.jpeg" /></figure><p><strong>In this post, I’ll show you how to upload files to Amazon S3 using pre-signed URLs from the web and from React Native.</strong></p><p>If uploading files to Amazon S3, a preferred method is to use pre-signed URLs. Pre-signed URLs are URLs that have been signed using AWS credentials. They give applications or users temporary permission to upload files to that URL. This is safer because the application or user uploading files will never see any AWS credentials.</p><p><strong>I’m not going to go into the specifics of <em>creating</em> pre-signed URLs.</strong></p><p>There are libraries in most languages to help with their creation. You may also decide to implement it yourself. Here, I’m presuming that you have the ability to generate pre-signed URLs and that you can send requests to a server to receive a URL as a response.</p><p>It’s time to upload images!</p><h3>Upload to Amazon S3 From the Web</h3><p>Our first example will be from the web. Let’s say you have a form where users can upload avatar images. When the user selects an image, you want to start the process of uploading an image.</p><pre>function makeS3Request(data, file) { return new Promise((resolve, reject) =&gt; { const xhr = new XMLHttpRequest() xhr.onreadystatechange = () =&gt; { if (xhr.readyState === 4) { if (xhr.status === 200) { resolve(data.url) } else { reject({ status: xhr.status, statusText: xhr.statusText, }) } } } xhr.open(&#39;PUT&#39;, data.signed_request) xhr.send(file) }) } async function uploadFileToS3(file, urlElement, imagePreviewElement) { try { const response = await fetch( `/uploads/sign?file_name=${file.name}&amp;file_type=${file.type}` ) const {data} = await response.json() const url = await makeS3Request(data, file) if (urlElement) { // Save image to hidden field urlElement.value = url } if (imagePreviewElement) { // Preview Image imagePreviewElement.src = url } } catch (e) { alert(&#39;Could not upload file.&#39;) } } const imageUploadElement = document.getElementById(&#39;avatar_uploader&#39;) if (imageUploadElement) { // Let&#39;s set up an event handler on the file handler imageUploadElement.onchange = () =&gt; { const file = imageUploadElement.files[0] if (file === null) { alert(&#39;No file selected.&#39;) } else { // function to handle S3 uploading uploadFileToS3( file, document.getElementById(&#39;avatar_url&#39;), document.getElementById(&#39;avatar_preview&#39;) ) } } }</pre><h3>Upload to Amazon S3 From React Native</h3><p>Let’s now do the same from React Native.</p><pre>function makeS3Request(data, file) { return new Promise((resolve, reject) =&gt; { const xhr = new XMLHttpRequest() xhr.onreadystatechange = () =&gt; { if (xhr.readyState === 4) { if (xhr.status === 200) { resolve(data.url) } else { reject({ status: xhr.status, statusText: xhr.statusText, }) } } } xhr.open(&#39;PUT&#39;, data.signed_request) xhr.setRequestHeader(&#39;Content-Type&#39;, file.type) xhr.send({ uri: file.uri, type: data.file.type, name: data.file.name, }) }) } async function upload(file) { const response = await fetch(`https://example.com/uploads/sign?file_name=${file.name}&amp;file_type=${file.type}`) const {data} = await response.json() return await makeS3Request(data, file) }</pre><p>In both examples, XMLHttpRequest is used. The code between the web and React Native examples only slightly differ.</p><p>Happy Uploading!</p><p><em>Originally published at </em><a href="https://revelry.co/upload-amazon-s3/"><em>revelry.co</em></a><em> on January 30, 2018.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=efb7c8ff071" width="1" height="1" alt=""><hr><p><a href="https://medium.com/revelry-labs/how-to-upload-files-to-amazon-s3-using-pre-signed-urls-efb7c8ff071">How to Upload Files to Amazon S3 Using Pre-signed URLs</a> was originally published in <a href="https://medium.com/revelry-labs">Revelry</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why JSON is probably not the best format to use for configuration]]></title>
            <link>https://medium.com/revelry-labs/why-json-is-probably-not-the-best-format-to-use-for-configuration-4d151d5c6ef2?source=rss-2b215fdda41b------2</link>
            <guid isPermaLink="false">https://medium.com/p/4d151d5c6ef2</guid>
            <category><![CDATA[npm]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[elixir]]></category>
            <category><![CDATA[json]]></category>
            <dc:creator><![CDATA[Bryan Joseph]]></dc:creator>
            <pubDate>Wed, 16 Aug 2017 13:57:21 GMT</pubDate>
            <atom:updated>2018-01-30T18:47:26.482Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9rPEEQbkEPHYfjTTsfdkDQ.jpeg" /></figure><p>Wait — I do not intend to bash JSON; I only aim to point out that it should not be the default solution for configuration.</p><p>In some cases, using JSON as a configuration file is fine. But in others, there is probably something better to use.</p><h3>How did JSON become so popular as a configuration format?</h3><p>I’m not sure. I would guess it has something to do with the popularity of <a href="https://nodejs.org/en/">Node.js</a> and <a href="https://www.npmjs.com/">npm</a>. npm uses a file named package.json for configuring projects and packages.</p><p>It might seem like I’m going to attack npm for using a JSON file, but I’m not.</p><p>In fact, there is a good reason that Node packages use JSON files. npm stores the information inside of package.json files in CouchDB. CouchDB is a database that makes JSON a first-class citizen. You can get a peek at how npm stores information by looking at the <a href="https://skimdb.npmjs.com/registry">npm registry</a>.</p><p>Let’s take a look at <a href="https://skimdb.npmjs.com/registry/react">React</a>. Notice the JSON document returned. Notice what’s in the “versions” object. It holds each published version of React. If you look at each version, notice that the information there resembles what is in a package.json file. When publishing a package, this is where information from the package.json goes.</p><p>The point here is that npm has a reason for using JSON configuration. There are some times where JSON is the right answer, and some times when it is not.</p><h3>Why isn’t JSON a good format to use for configuration?</h3><p>First, it doesn’t allow comments.</p><p>You may want to explain your configuration or any configuration options. JSON doesn’t allow that. There are supersets of JSON that do, but those are no longer JSON.</p><p>Next, you may want to add dynamic content to your configuration. Or read from environment variables.</p><p>JSON does not allow for any of these either. You could add a script to do so, but then you are adding something else on top of JSON. The above may be fine for your situation, but for others there may be better options.</p><h3>What are good configuration file formats?</h3><p>If you are working in a specific language, using a script in that language may be a better solution. Most languages allow for comments. A script will allow you to write code where needed. Most languages can import a script dynamically so that you can use the values within the script. There are a couple of examples in the JavaScript world.</p><p>Webpack uses a “webpack.config.js” file for configuration. Rollup uses a “rollup.config.js”. Gulp has a “gulpfile.js” file. The following all need to have JavaScript modules imported or code to do things from time to time. An example in another language is Elixir. <a href="https://revelry.co/pattern-matching-elixir/">Elixir</a> uses a “mix.exs” file for configuring libraries and projects. Elixir also uses “.exs” files for application-level configuration.</p><p>What is a good configuration format that isn’t language-specific? <a href="https://github.com/toml-lang/toml">TOML</a>. TOML is a great solution and my personal favorite. It allows comments, and has libraries in many programming languages. It is gaining popularity. Rust projects use TOML for package configuration. <a href="https://github.com/toml-lang/toml#projects-using-toml">There are many other projects that use it too</a>.</p><p>The next time you are in a position to create a configuration file, think through your options. From there, decide what is best for you, your team, and the project.</p><p><em>Originally published at </em><a href="https://revelry.co/json-configuration-file-format/"><em>revelry.co</em></a><em> on August 16, 2017.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4d151d5c6ef2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/revelry-labs/why-json-is-probably-not-the-best-format-to-use-for-configuration-4d151d5c6ef2">Why JSON is probably not the best format to use for configuration</a> was originally published in <a href="https://medium.com/revelry-labs">Revelry</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Types of Pattern Matching in Elixir]]></title>
            <link>https://medium.com/revelry-labs/types-of-pattern-matching-in-elixir-e5a81650c741?source=rss-2b215fdda41b------2</link>
            <guid isPermaLink="false">https://medium.com/p/e5a81650c741</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[erlang]]></category>
            <category><![CDATA[pattern-matching]]></category>
            <category><![CDATA[elixir]]></category>
            <dc:creator><![CDATA[Bryan Joseph]]></dc:creator>
            <pubDate>Wed, 05 Jul 2017 13:36:36 GMT</pubDate>
            <atom:updated>2018-02-09T21:26:17.141Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gXMHoANRqwrvmVGclgMXwg.jpeg" /></figure><p>One of the great features of both Elixir and Erlang is pattern matching. Pattern matching allows you to work with the “shape” of data. Using pattern matching, you can split an implementation up based on the shape of the data. There are various ways to define the shape of the data you expect. This post shows the various forms pattern matching can take in <a href="https://elixir-lang.org/">Elixir</a>.</p><p>Throughout this post, we will use a simple greet function as an example. This greet function takes a name and then prints out a “hello” message to the screen. It looks like this:</p><pre>def greet(name) do IO.puts(&quot;Hello, #{name}&quot;) end</pre><p>Let’s start by discussing the basic pattern matching elements.</p><h3>Ignore Value</h3><p>Use an underscore to ignore a value altogether.</p><pre>def greet(_) do IO.puts(&quot;Hello, world&quot;) end</pre><p>The greet function above ignores the given input. If for some reason you want to ignore a value, but still give it a meaningful name, prepend that value with an _.</p><pre>def greet(_name) do IO.puts(&quot;Hello, world&quot;) end</pre><p>What if you want to use the value given? Give it a name without an underscore.</p><h3>Variable</h3><pre>def greet(name) do IO.puts(&quot;Hello, #{name}&quot;) end</pre><p>Now you can use the name given. While you could have used _name, it would have given us a compiler warning. The compiler will warn you if you are using a variable starting with _.</p><h3>Exact Value</h3><p>With pattern matching, you can give an exact value as well.</p><pre>def greet(&quot;Benjamin&quot;) do IO.puts(&quot;Hello, Ben&quot;) end</pre><p>We now have a function for someone named “Benjamin”. This works with all primitive values: integers (1), floats (1.0), binaries (&quot;Sally&quot;), bitstrings (&lt;&lt;1, 2, 3&gt;&gt;), tuples ({1,2}), lists ([1, 2, 3]), and maps (%{a: 1, b: 2}).</p><p>We will go into more depth on lists, tuples, and maps later.</p><h3>Binary starts with</h3><pre>def greet(&quot;Ben&quot; &lt;&gt; _) do IO.puts(&quot;Hello, Ben&quot;) end</pre><p>With this form, you can check if a given binary starts with the given characters. We have enhanced our <em>greet Ben</em> function to check for any name that starts with &quot;Ben&quot;. Note, you can only match on the beginning of a binary.</p><h3>Lists</h3><p>Lists can be pattern-matched in several ways. The first way is by matching on the number of values in the list.</p><pre>def greet([&quot;Ben&quot; &lt;&gt; _, _last_name]) do IO.puts(&quot;Hello, Ben&quot;) end</pre><p>The above expects a 2-element list as input.</p><h3>Head/Tail</h3><pre>def greet([name | _]) do IO.puts(&quot;Hello, #{name}&quot;) end</pre><p>This form allows you to get the first value of a list in a variable. It also gets the rest of the elements in a list as a variable. In this case, we only need the first element. You can also match on the first number of elements.</p><pre>def greet([first_name, last_name | _]) do IO.puts(&quot;Hello, #{first_name} #{last_name}&quot;) end</pre><h3>Keyword Lists</h3><pre>def greet([first_name: name, last_name: _]) do IO.puts(&quot;Hello, #{name}&quot;) end</pre><p>In this example, we are matching elements of a keyword list. This works exactly the same way as list pattern matching (because a keyword list is a list). Remember that order of keys matter here. So if last_name came first in the list given to this function, it would not match.</p><h3>Tuples</h3><pre>def greet({&quot;Ben&quot; &lt;&gt; _, _last_name}) do IO.puts(&quot;Hello, Ben&quot;) end</pre><p>Tuples are like lists except that they have an arity. For example, {1, 2} is a tuple with arity 2, or sometimes called a 2-tuple. {1, 2, 3} is a 3-tuple. In Elixir, you can match on the values with the tuple. In the above example, our greet function takes a 2-tuple. The first element is a name that starts with &quot;Ben&quot; and we ignore the second element. Note that this will only match on 2-tuples and not any other arity tuple. If we want to update our function to take a 3-tuple, we could do as follows:</p><pre>def greet({&quot;Ben&quot; &lt;&gt; _, _middle_name, _last_name}) do IO.puts(&quot;Hello, Ben&quot;) end</pre><h3>Maps</h3><pre>def greet(%{first_name: name}) do IO.puts(&quot;Hello, #{name}&quot;) end</pre><p>This type of pattern matching checks for keys and values within a map. Order does not matter here. As long as the given map has the key(s) and value(s) matching, this will work.</p><h3>Structs</h3><p>Structs support pattern matching in a couple of ways. One is matching on the type.</p><pre>def greet(%Person{} = person) do IO.puts(&quot;Hello, #{person.name}&quot;) end</pre><p>This will match only if given a Person struct.</p><p>You can even make the <em>type</em> something to match.</p><pre>def greet(%x{} = person) when x in [Person] do IO.puts(&quot;Hello, #{person.name}&quot;) end</pre><p>The variable, x, holds the type of the struct passed into the function. We used a guard (explained later) to make sure the type is within a subset of types defined.</p><h3>Bitstrings</h3><p>Bitstrings are useful when working with certain types of data. They also have the most variations when it comes to pattern matching. We will discuss one example here, but be sure to read the <a href="https://hexdocs.pm/elixir/Kernel.SpecialForms.html#%3C%3C%3E%3E/1">Bitstring docs</a> for more information.</p><p>In the example above where we matched on the beginning of a name, I mentioned that you can only match on the beginning. For that particular form of pattern matching, that is true. With bitstrings, you can match on other parts as long as you know the length of the parts before it.</p><pre>def greet(&lt;&lt;prefix::binary-size(3), &quot;ja&quot;, ending::binary&gt;&gt;) do IO.puts(&quot;Hello, #{prefix}js#{ending}&quot;) end</pre><p>Notice we are matching on the size of the first element in the bitstring. We are expecting it to be a binary that is 3 characters long. Skipping the middle element, notice the end does not need to have a size. This is because it is the last element.</p><h3>Guards</h3><p>Guards allow you to add an extra constraint onto your pattern. What if we wanted to make sure the name given is a binary (string)?</p><pre>def greet(name) when is_binary(name) do IO.puts(&quot;Hello, #{name}&quot;) end</pre><p>Now only binary values will match the above. Only a small set of functions can be guards. To find out which ones, check out the <a href="https://hexdocs.pm/elixir/Kernel.html">Elixir Kernel doc</a>. Most of the functions allowed have the comment “Allowed in guard tests” in their docs.</p><p><em>Originally published at </em><a href="https://revelry.co/pattern-matching-elixir/"><em>revelry.co</em></a><em> on July 5, 2017.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e5a81650c741" width="1" height="1" alt=""><hr><p><a href="https://medium.com/revelry-labs/types-of-pattern-matching-in-elixir-e5a81650c741">Types of Pattern Matching in Elixir</a> was originally published in <a href="https://medium.com/revelry-labs">Revelry</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>