<?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 David Woody on Medium]]></title>
        <description><![CDATA[Stories by David Woody on Medium]]></description>
        <link>https://medium.com/@davidjwoody?source=rss-fea4322d14f9------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*j_UHUYM89xRsMrGh.jpeg</url>
            <title>Stories by David Woody on Medium</title>
            <link>https://medium.com/@davidjwoody?source=rss-fea4322d14f9------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 10:21:11 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@davidjwoody/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[How to Use Absolute Paths in React Native]]></title>
            <link>https://medium.com/@davidjwoody/how-to-use-absolute-paths-in-react-native-6b06ae3f65d1?source=rss-fea4322d14f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/6b06ae3f65d1</guid>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[David Woody]]></dc:creator>
            <pubDate>Fri, 05 Aug 2016 12:10:27 GMT</pubDate>
            <atom:updated>2016-08-11T15:40:05.506Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>TL;DR — 1) Add a package.json file with { “name”: “FOLDER_NAME” } in it to the folder you’d like to import from. 2) import Thing from ‘FOLDER_NAME/thing’.</blockquote><p>Relative paths are cool…</p><blockquote>import Thing from ‘./thing’;</blockquote><p>…except when going “up” in the folder structure.</p><blockquote>import Blah from ‘../../../../../blah’;</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2FEyZ0hnoHK4O1q%2Ftwitter%2Fiframe&amp;src_secure=1&amp;url=http%3A%2F%2Fgiphy.com%2Fgifs%2FEyZ0hnoHK4O1q&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2FEyZ0hnoHK4O1q%2Fgiphy.gif&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="290" frameborder="0" scrolling="no"><a href="https://medium.com/media/d0384945cd90c673bde6f94042fd632f/href">https://medium.com/media/d0384945cd90c673bde6f94042fd632f/href</a></iframe><p>On a positive note, two reasons I like using absolute import paths:</p><ol><li>It’s easier to quickly understand where the import is coming from, and</li><li>It’s optimized for copy/paste workflow</li></ol><blockquote>Honorable mention: if you restructure things down the road, it’s also easier to find/replace absolute paths.</blockquote><p>In your React Native project, chances are you keep your code in a single folder, such as “app”. If you have a directory named “app” this is what an absolute path might look like:</p><blockquote>import Thing from ‘AwesomeApp/app/some/thing’</blockquote><p>What sucks about this is <em>literally</em> all import statements (or require calls, if you’re still into that) would start with “<em>AwesomeApp/app/</em>”, which is a lot to ask, when the alternative is simple to add a series of “<strong>../</strong>” (the key strokes are just so close together, it’s too easy).</p><p>To alleviate this pain point, you can simply add a <em>package.json</em> file inside the folder from where you want to import. In this case since all our code is under the “app” folder, we’d put the file here:</p><blockquote>AwesomeApp/app/package.json</blockquote><p>Then, add a “name” property to the json file with the folder name as its value (you can call it whatever you’d like, but really, that’ll just confuse people, including you in 6 months). The shorter, the better.</p><blockquote>{ “name”: “app” }</blockquote><p>Now, you can import using that name as a reference.</p><blockquote>import Thing from ‘app/some/thing’</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fgiphy.com%2Fembed%2F3o6gE6muVWPM2OyOsw%2Ftwitter%2Fiframe&amp;src_secure=1&amp;url=http%3A%2F%2Fgiphy.com%2Fgifs%2Fsporzaredactie-3o6gE6muVWPM2OyOsw&amp;image=https%3A%2F%2Fmedia.giphy.com%2Fmedia%2F3o6gE6muVWPM2OyOsw%2Fgiphy.gif&amp;key=d04bfffea46d4aeda930ec88cc64b87c&amp;type=text%2Fhtml&amp;schema=giphy" width="435" height="232" frameborder="0" scrolling="no"><a href="https://medium.com/media/6042bb74e72e6a80bf5419d34fe2b402/href">https://medium.com/media/6042bb74e72e6a80bf5419d34fe2b402/href</a></iframe><p>I originally found this tip pointed out <a href="https://github.com/facebook/react-native/issues/3099#issuecomment-221815006">here</a>. Hopefully writing about it specifically will make it easier for others to find, and make your absolute importing experience just a little brighter.</p><p><strong>Note</strong>: For a nearly identical experience without the need for adding a package.json file, this <a href="https://github.com/mantrajs/babel-root-slash-import">babel plugin</a> can work wonders.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6b06ae3f65d1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Meteor’s new feature will Transform your Mongo Collections]]></title>
            <link>https://medium.com/@davidjwoody/meteors-new-feature-will-transform-your-mongo-collections-5aa02d00e41b?source=rss-fea4322d14f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/5aa02d00e41b</guid>
            <dc:creator><![CDATA[David Woody]]></dc:creator>
            <pubDate>Thu, 09 Oct 2014 15:40:10 GMT</pubDate>
            <atom:updated>2014-10-12T14:08:39.362Z</atom:updated>
            <content:encoded><![CDATA[<h2>The Meteor feature that will Transform your Mongo Collections</h2><h4>How to easily keep track of data relationships</h4><blockquote>I was working on a way to more easily keep track of data relationships.</blockquote><p>I was looking at some <strong>great</strong> packages on atmosphere like collection helpers, collection hooks, minimongoid, etc. However, I stumbled upon this great <a href="http://docs.meteor.com/#mongo_collection">documented</a> feature built right into <strong>Meteor Collections</strong>.</p><p>It allows you to <strong>transform</strong> documents returned by findOne() or fetch().</p><blockquote><a href="https://twitter.com/nwientge">@nwientge</a> pointed out collection helpers uses the transform function under the hood.</blockquote><p>So I was thinking, what if you could create a “relations” prototype to keep track of all relationships between Mongo collections, and at the same time be able to share that prototype (or “mapping”) between all Collections?</p><p>You could define all of your relationships in one file like <strong>relations.js.</strong></p><p>And since every collection would share the same prototype, you could traverse through data more easily.</p><p>For example:</p><p><strong>Note.findOne().related(‘personId’).related(‘notes’);</strong></p><p>could return all of the notes written by a Person for the given Note. Let’s walk through what the above could do.</p><blockquote>You can reference the code provided below to follow along with the step-by-step.</blockquote><ol><li><strong>Note.findOne()</strong> returns a note object which has passed through a transform function and has a few extra properties: <strong>related</strong> and <strong>relations.</strong></li><li>The <strong>related(‘personId’) function </strong>above looks for a property called <strong>personId </strong>on the Note object, and finds it.</li><li>It then calls the <strong>relations</strong>.<strong>personId method </strong>and passes in the personId to return the related Person object.</li><li>The returned Person object also has a <strong>related() method</strong> except this time <strong>notes </strong>is passed as the argument. It looks for a property called <strong>notes </strong>on the Person object, but does not find it. So instead it calls the <strong>relations</strong>.<strong>notes method</strong> and passes in it’s own _id to return all the notes.</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9192164246a5b7132ecf631622c5f71c/href">https://medium.com/media/9192164246a5b7132ecf631622c5f71c/href</a></iframe><p>This is just one example of how to use the <strong>transform</strong> function. This really opens up complete flexibility. I feel like this is an under-explored feature (at least for me). How else might you use this feature? Do you see any drawbacks to doing something like this?</p><p>Feedback is welcomed.</p><blockquote>Thanks for the feedback! Keep it coming. This has gone through a few revisions based on feedback of earlier versions. Is anything confusing to you? Does this even make sense at all?</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5aa02d00e41b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Use Meteor with TrueVault for HIPAA Applications]]></title>
            <link>https://medium.com/@davidjwoody/how-to-use-meteor-with-truevault-for-hipaa-applications-50a0b9a3000?source=rss-fea4322d14f9------2</link>
            <guid isPermaLink="false">https://medium.com/p/50a0b9a3000</guid>
            <dc:creator><![CDATA[David Woody]]></dc:creator>
            <pubDate>Thu, 02 Oct 2014 17:34:09 GMT</pubDate>
            <atom:updated>2014-10-03T13:47:07.819Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HKaI1F4hFoOfiD4nWa4P3w.png" /></figure><p>I’ve been working on a <a href="https://www.meteor.com/">Meteor</a> app for a hospital and naturally, HIPAA compliance was a requirement. We decided to use <a href="https://www.truevault.com/">TrueVault</a> to store all PHI, but the challenge was figuring out how to interact with TrueVault in a Meteor-way. Ultimately, I decided to write a package to accomplish this.</p><p>You can find the package on <a href="https://atmospherejs.com/woody/truevault">Atmosphere</a> along with instructions on how to use it.</p><h4>How does it work?</h4><p>It uses a client-only collection to mirror the user’s TrueVault data and when changes are made to the client-only collection, the updates are sent to TrueVault automatically. Additionally, it also has server-only methods to allow custom implementations.</p><p>To use TrueVault with Meteor, it’s now as easy as:</p><p><strong>TrueVault.insert({ some: “thing” });</strong></p><p><a href="https://atmospherejs.com/woody/truevault">Check it out</a>, feedback is welcome.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=50a0b9a3000" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>