<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Cameron</title>
    <description>The latest articles on DEV Community by Cameron (@cameronblandford).</description>
    <link>https://dev.to/cameronblandford</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F152430%2Fc59516ad-9f46-431a-9520-d4cfb2200d22.png</url>
      <title>DEV Community: Cameron</title>
      <link>https://dev.to/cameronblandford</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cameronblandford"/>
    <language>en</language>
    <item>
      <title>Grayscaling my phone made the rest of the world more vibrant (literally)</title>
      <dc:creator>Cameron</dc:creator>
      <pubDate>Thu, 12 Sep 2019 14:50:29 +0000</pubDate>
      <link>https://dev.to/cameronblandford/iphone-s-monochrome-mode-and-how-color-affects-us-1dj6</link>
      <guid>https://dev.to/cameronblandford/iphone-s-monochrome-mode-and-how-color-affects-us-1dj6</guid>
      <description>&lt;p&gt;Recently I enabled an accessibility option to map "Toggle grayscale screen filter" to the triple tap of my iPhone's home button, and within a few dozen seconds, after acclimating to the change and finishing whatever it was I had needed to do on my phone, I &lt;em&gt;set it down&lt;/em&gt;. I say this as someone who absent-mindedly swipes between home-screen panels and refreshes twitter and facebook even when I don't plan on reading whatever pops up.&lt;/p&gt;

&lt;p&gt;I still picked it up easily when I needed to use it: to send a text; read an email; or respond to a twitter DM or slack message. I still easily used the map features, and still browsed instagram briefly (which looked far more artsy in coerced-b&amp;amp;w), but found myself almost always staying more on task and putting my phone down when I was done with that task.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why does this happen?
&lt;/h2&gt;

&lt;p&gt;On further experimentation, I've realized this is because, from a biological standpoint, your phone is usually packed with more vibrant colors than anything in your environment. Even bright magazine covers pale in comparison to the phone screen. The lizard-brain in us sees the iPhone's home screen covered in small, bite-size applications, all in tantalizingly vibrant colors, and thinks simultaneously "nutritious berries" and "poisonous animals", both things we have become evolutionarily primed to notice and maintain focus on.&lt;/p&gt;

&lt;p&gt;After some time on your phone, the world seems to be dulled, and for good reason. Compared to your phone, the colors of the real world &lt;em&gt;are&lt;/em&gt; much duller. They're lower contrast less saturated, and less clean.&lt;/p&gt;

&lt;p&gt;Turning on the accessibility feature for black and white filtering flips this dynamic on its head. Suddenly, your eyes are &lt;em&gt;easily drawn away from your phone&lt;/em&gt;. Like a newspaper, the act of looking away from it fills your eyes with comparatively high color and brightness. The innate draw of your phone becomes solely based on the information you can glean from it and the things you can do with it, &lt;em&gt;not&lt;/em&gt; how instinctively interesting it is to look at.&lt;/p&gt;

&lt;p&gt;Obviously using your phone is generally a pleasurable activity, and I'm not advocating for less phone usage. I'm largely pointing this out because it draws into stark attention how &lt;em&gt;much&lt;/em&gt; color affects our enjoyment of an app, and how bright, vibrant colors can really draw us in to a device, or an app, or really &lt;em&gt;anything&lt;/em&gt;. Color matters a lot; not just how we use it, but &lt;em&gt;that&lt;/em&gt; we use it.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to switch to a grayscale display
&lt;/h2&gt;

&lt;p&gt;As much as I don't think phones are bad, I think they &lt;em&gt;can&lt;/em&gt; get in the way when you're trying to enjoy a book or movie or game, or are trying to focus on something else. If you want to be less drawn in by your iPhone, or see this phenomenon for yourself, you can map your black-and-white screen filter to a triple-tap of the home button by:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;1. Settings &amp;gt; General &amp;gt; Accessibility &amp;gt; Display Accomadations &amp;gt; 
Color Filters &amp;gt; toggle 'Grayscale'
2. Settings &amp;gt; General &amp;gt; Accessibility &amp;gt; Accessibility Shortcut &amp;gt; toggle 'Color Filters'
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



</description>
      <category>ui</category>
      <category>iphone</category>
      <category>color</category>
      <category>ux</category>
    </item>
    <item>
      <title>How do you handle many-to-many relationships in Mongo?</title>
      <dc:creator>Cameron</dc:creator>
      <pubDate>Fri, 06 Sep 2019 14:35:09 +0000</pubDate>
      <link>https://dev.to/cameronblandford/how-do-you-handle-many-to-many-relationships-in-mongo-3iih</link>
      <guid>https://dev.to/cameronblandford/how-do-you-handle-many-to-many-relationships-in-mongo-3iih</guid>
      <description>&lt;p&gt;Or is this not even a useful way of thinking in the NoSQL paradigm? Regardless, how would you go about mapping large amounts of users to large amounts of groups, or handling likes on posts, or handling tags?&lt;/p&gt;

&lt;p&gt;I'm super curious to hear your thoughts!&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>mongodb</category>
      <category>nosql</category>
    </item>
    <item>
      <title>Seeding Mongo with Realistic Records using Faker</title>
      <dc:creator>Cameron</dc:creator>
      <pubDate>Thu, 05 Sep 2019 23:40:52 +0000</pubDate>
      <link>https://dev.to/cameronblandford/seeding-mongo-with-realistic-records-using-faker-509j</link>
      <guid>https://dev.to/cameronblandford/seeding-mongo-with-realistic-records-using-faker-509j</guid>
      <description>&lt;p&gt;So you have your app basically up and running, with a working API, but the only data you have are the manual entries that you've added to the database yourself. You don't want to have to manually sign up as ten thousand different users each with their own several hundred related items (blog posts, todo lists, etc) to get an idea of how your app looks and works when it's operating at moderate scale.&lt;/p&gt;

&lt;p&gt;Enter faker. &lt;a href="https://github.com/marak/Faker.js/"&gt;Faker&lt;/a&gt; is a library designed to, in its own words, &lt;em&gt;generate massive amounts of fake data&lt;/em&gt;. By connecting to our mongo database, we can upload tons of unique users and items.&lt;/p&gt;

&lt;h2&gt;
  
  
  Seeding a Mongo Database
&lt;/h2&gt;

&lt;p&gt;First, install the two dependencies we'll be working with &lt;code&gt;npm i -D faker mongodb lodash&lt;/code&gt;. Next, make a new file in your server folder, preferably in a subdirectory for scripts, called something like &lt;code&gt;seed.js&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="cm"&gt;/* mySeedScript.js */&lt;/span&gt;
&lt;span class="c1"&gt;// require the necessary libraries&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;faker&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;faker&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;MongoClient&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mongodb&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;MongoClient&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;assert&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;assert&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;_&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;lodash&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="c1"&gt;// Connection URL&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;url&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;mongodb://localhost:27017&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Database Name&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;dbName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;my_dev_database&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Use connect method to connect to the server&lt;/span&gt;
&lt;span class="nx"&gt;MongoClient&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;url&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;assert&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;equal&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;null&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;db&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;dbName&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// get access to the relevant collections&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;usersCollection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;collection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;users&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;postsCollection&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;collection&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;posts&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="c1"&gt;// make a bunch of users&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;users&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;
  &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;5000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;firstName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;faker&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;firstName&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;lastName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;faker&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;name&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lastName&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;newUser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;email&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;faker&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;internet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;firstName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;lastName&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
      &lt;span class="nx"&gt;firstName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="nx"&gt;lastName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
      &lt;span class="na"&gt;password&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;password123&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
    &lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;newUser&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// visual feedback always feels nice!&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;newUser&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nx"&gt;usersCollection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;insertMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

  &lt;span class="c1"&gt;// make a bunch of posts&lt;/span&gt;
  &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;posts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[];&lt;/span&gt;
  &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;5000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nx"&gt;i&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;newPost&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
      &lt;span class="na"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;faker&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lorem&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;words&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
      &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;faker&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;lorem&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;words&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;500&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;

      &lt;span class="c1"&gt;// use lodash to pick a random user as the author of this post&lt;/span&gt;
      &lt;span class="na"&gt;author&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;_&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sample&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;

      &lt;span class="c1"&gt;// use lodash to add a random subset of the users to this post&lt;/span&gt;
      &lt;span class="na"&gt;likes&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;_&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sampleSize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;round&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;random&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="nx"&gt;users&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;)).&lt;/span&gt;&lt;span class="nx"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
        &lt;span class="nx"&gt;user&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;user&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;_id&lt;/span&gt;
      &lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="p"&gt;};&lt;/span&gt;
    &lt;span class="nx"&gt;posts&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;newPost&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="c1"&gt;// visual feedback again!&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;newPost&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;title&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
  &lt;span class="nx"&gt;postsCollection&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;insertMany&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;posts&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Database seeded! :)&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;close&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Other Databases
&lt;/h2&gt;

&lt;p&gt;The best way to do this with other databases is to &lt;code&gt;require&lt;/code&gt; the ORM or database connection you're using into the seed script and then use a combination of faker.js and the ORM to do the above. If there's interest, I'd be happy to write up an example!&lt;/p&gt;




&lt;p&gt;What are your favorite ways to generate fake/testing data for your API? Let me know below!&lt;/p&gt;

</description>
      <category>mongodb</category>
      <category>database</category>
      <category>api</category>
    </item>
    <item>
      <title>On Style Variables</title>
      <dc:creator>Cameron</dc:creator>
      <pubDate>Fri, 30 Aug 2019 17:03:53 +0000</pubDate>
      <link>https://dev.to/cameronblandford/on-style-variables-2ih</link>
      <guid>https://dev.to/cameronblandford/on-style-variables-2ih</guid>
      <description>&lt;p&gt;I used to think that variables in stylesheets were there to make refactoring easier. What I never considered is that they encourage consistency: When you have 4 different spacing variables, you're much more likely to build out a site where the sizes and spacing of each element are much more internally and visually consistent.&lt;/p&gt;

&lt;p&gt;The same goes for font sizes and colors. By limiting yourself only to a set of variables, you're much less likely to experience consistency erosion, where your site ends up having 40 different hex values for grays alone.&lt;/p&gt;

&lt;p&gt;Bootstrap does this for you, but I've never seen anyone talk about &lt;em&gt;why&lt;/em&gt; that feature of Bootstrap is helpful, or why it's a helpful feature of pre-processor design systems in general.&lt;/p&gt;

</description>
      <category>css</category>
      <category>sass</category>
      <category>less</category>
      <category>design</category>
    </item>
    <item>
      <title>In Teams, Being Deliberate is More Important Than Being Skilled</title>
      <dc:creator>Cameron</dc:creator>
      <pubDate>Fri, 30 Aug 2019 16:55:57 +0000</pubDate>
      <link>https://dev.to/cameronblandford/in-teams-being-deliberate-is-more-important-than-being-skilled-oan</link>
      <guid>https://dev.to/cameronblandford/in-teams-being-deliberate-is-more-important-than-being-skilled-oan</guid>
      <description>&lt;p&gt;&lt;em&gt;Don't just do something, stand there!&lt;/em&gt;&lt;br&gt;
&lt;em&gt;– Pragmatic Thinking &amp;amp; Learning, by Andy Hunt&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;It's easy to want to rush into a feature or ticket that you get at work. The building is the gratifying part, and doesn't force you to think &lt;em&gt;too&lt;/em&gt; hard about it.&lt;/p&gt;

&lt;p&gt;But I deeply encourage you to spend the first 15 minutes of your work on a ticket – &lt;em&gt;every ticket&lt;/em&gt; – analyzing it. Your goal in those 15 minutes is to answer as many questions about unspecified requirements as possible. Say you're tasked with building a search bar. At first glance you think, this'll be easy! It'll only take 30min or so, max.&lt;/p&gt;

&lt;p&gt;But take the time to break it down. At my job, for instance, you need to think about:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What forms of input will this text search input accept?&lt;/li&gt;
&lt;li&gt;What is the backend expecting? What form will the results be in?&lt;/li&gt;
&lt;li&gt;Is it going to be possible to type in the bar while results are loading? Is there going to be any type of loading&lt;/li&gt;
&lt;li&gt;What does the application state need to look like for this?

&lt;ul&gt;
&lt;li&gt;Actions?&lt;/li&gt;
&lt;li&gt;Reducers?&lt;/li&gt;
&lt;li&gt;Types?&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Does something like this already exist in the style guide / component library / app in general? Should these be used as guidance?&lt;/li&gt;
&lt;li&gt;What will testing look like for this search bar, if testing makes sense for it?&lt;/li&gt;
&lt;li&gt;Will there be a need for this search bar in other places in the app? If so, should I make it a reusable component?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;15 minutes might not be enough time to answer all these questions, but it's enough time to get yourself thinking. If it takes longer than 15 minutes, by all means take more time!&lt;/p&gt;

&lt;p&gt;By asking these questions ahead of time, you're able to write the cleanest possible code, and save the most time re-writing old code.&lt;/p&gt;

&lt;p&gt;There are a few mental barriers to this desired behavior:&lt;/p&gt;

&lt;h2&gt;
  
  
  You have to bother your coworkers, your PM, your designer.
&lt;/h2&gt;

&lt;p&gt;Take it from me, a person with terrible social anxiety: your PMs and designers &lt;em&gt;love&lt;/em&gt; to hear feedback. They get anxious when they &lt;em&gt;don't&lt;/em&gt;. Feedback on a half-baked or misled feature spec helps prevent disaster and shows your attention to detail, a skill which is extremely desirable in this field.&lt;/p&gt;

&lt;h2&gt;
  
  
  It's not gratifying in the same way as coding is. You're not seeing your output appear before you.
&lt;/h2&gt;

&lt;p&gt;Think about this prep time as investment in your future code quality and speed. By preparing now, you're more likely to:&lt;/p&gt;

&lt;p&gt;a) Give a better estimate on how long the ticket will take&lt;br&gt;
b) Waste less time working towards a dead end as a new part of the spec comes into focus&lt;br&gt;
c) Get all of your question asking out of the way so you're not blocked by waiting for an answer during a high-productivity moment later on.&lt;/p&gt;

&lt;h2&gt;
  
  
  It requires honing a different skill than raw coding, which can feel like a distraction.
&lt;/h2&gt;

&lt;p&gt;As mentioned above, being able to think abstractly about a ticket and identify what things the spec is missing can feel sluggish and useless at first, but other people &lt;em&gt;really&lt;/em&gt; appreciate it. A programmer with an eye for design and product is a programmer to be reckoned with. It'll enable you to move further and faster in your career.&lt;/p&gt;

&lt;h2&gt;
  
  
  Additional Benefits
&lt;/h2&gt;

&lt;p&gt;Engaging in dialogue with your PM and designer more often will help improve the quality of &lt;em&gt;their&lt;/em&gt; specs and mockups too, as they gain a better understanding of what's feasible versus nearly impossible as an engineer, and why a slight change in spec on, for example, a form, can change the total dev time by hours, if not days.&lt;/p&gt;

</description>
      <category>teams</category>
      <category>coding</category>
      <category>process</category>
    </item>
    <item>
      <title>Experts and Interlopers</title>
      <dc:creator>Cameron</dc:creator>
      <pubDate>Mon, 19 Aug 2019 17:39:47 +0000</pubDate>
      <link>https://dev.to/cameronblandford/experts-and-interlopers-1nb5</link>
      <guid>https://dev.to/cameronblandford/experts-and-interlopers-1nb5</guid>
      <description>&lt;p&gt;Experts give a lot of value to their team. They get a ton done, they know things inside and out, and they can operate well within the system. They're great to consult with questions. They're good at building things quickly and in a stable manner.&lt;/p&gt;

&lt;p&gt;Interlopers give a lot of value to their team. Because they're coming in from the outside, they're a font of new ideas that can drastically improve team processes, practices, and standards. They have no attachment to the status quo. They bring in smart ideas from other fields at a higher rate. They stoke revolution.&lt;/p&gt;

&lt;p&gt;There's a reason revolutions are most common in countries with high numbers of unemployed teenagers.&lt;/p&gt;

&lt;p&gt;Experts, despite their skills, have indeed drunk the Kool Aid. They're indoctrinated into the status quo, and it takes additional, rarer skills for an expert to see outside of the bubble in which they function so effectively.&lt;/p&gt;

&lt;p&gt;I guess the takeaway here is that it's important for you to have experts &lt;em&gt;and&lt;/em&gt; interlopers on your team. Those that preserve the status quo, that teach the old ways, and that know their way around the system, and those that can bring new revolutionary ideas to your team.&lt;/p&gt;

&lt;p&gt;And the even bigger, more difficult-but-worth-it goal, might be to become and expert while still retaining that interloper spirit, never getting too comfortable with the way things are while still understanding how they work.&lt;/p&gt;

</description>
      <category>pedagogy</category>
      <category>dreyfus</category>
    </item>
    <item>
      <title>Decrease Your Time-to-First-Success</title>
      <dc:creator>Cameron</dc:creator>
      <pubDate>Thu, 11 Jul 2019 17:06:59 +0000</pubDate>
      <link>https://dev.to/cameronblandford/decrease-your-time-to-first-success-2o7d</link>
      <guid>https://dev.to/cameronblandford/decrease-your-time-to-first-success-2o7d</guid>
      <description>&lt;p&gt;Start with the smallest possible goal when learning something new.&lt;/p&gt;

&lt;p&gt;When you're learning music theory, make it a priority to write a tiny jingle consisting of just a melody. Make a lot of these! Consider them complete when the melody is finished.&lt;/p&gt;

&lt;p&gt;When you're learning game design, try using a game with a level design feature, or design modded levels / steam workshop things for a game you like.&lt;/p&gt;

&lt;p&gt;When you're learning to code, spend some time creating static webpages on a LAMP setup before doing anything else.&lt;/p&gt;

&lt;p&gt;Your ability to stay engaged with the development of a skill might largely be governed by time-to-first-success. The shorter that time, the more quickly you get hooked in a positive feedback loop. And I don't mean build something like this as part of turning it into something bigger. I mean that the small thing you're trying to build should function as the MVP. When you've finished it, you start a new project, and can feel a sense of accomplishment from finishing something meaningful to you, no matter how small.&lt;/p&gt;

</description>
      <category>pedagogy</category>
      <category>selflearning</category>
      <category>diy</category>
    </item>
    <item>
      <title>Just Ship It</title>
      <dc:creator>Cameron</dc:creator>
      <pubDate>Tue, 09 Apr 2019 16:47:43 +0000</pubDate>
      <link>https://dev.to/cameronblandford/just-ship-it-25o0</link>
      <guid>https://dev.to/cameronblandford/just-ship-it-25o0</guid>
      <description>&lt;p&gt;If you're like me, you've worked on a lot of side projects where your enthusiasm has waned over time as you realize that it's not as niche-filling, interesting, or commercially viable as you originally hoped. I tend to experience this at the 70%-to-MVP mark, and then the project becomes just another directory I move into my &lt;code&gt;archives&lt;/code&gt; folder.&lt;/p&gt;

&lt;p&gt;If you don't have an already-extensive portfolio to show to interviewers or clients, just ship it! Having something is better than having nothing, and you're likely undervaluing the quality of your work. Plus, having deployment experience is incredibly valuable, and being able to DIY your way through the development, implementation, and deployment of a product, even if it's not up to your standards, is a huge confidence-booster!&lt;/p&gt;

&lt;p&gt;I've also learned that deploying half-built projects gives me more incentive to work on them (as does publishing half-finished text posts that I can edit over time). It gets you over the hump of self-consciousness and you get something to show for it!&lt;/p&gt;

&lt;p&gt;Just ship it!&lt;/p&gt;

</description>
      <category>jobs</category>
      <category>productivity</category>
      <category>mentalhealth</category>
    </item>
    <item>
      <title>Dev.to is the Perfect Platform for Mild-Effort Posting</title>
      <dc:creator>Cameron</dc:creator>
      <pubDate>Tue, 09 Apr 2019 16:34:49 +0000</pubDate>
      <link>https://dev.to/cameronblandford/dev-to-fills-an-important-niche-for-mild-effort-posting-2l7p</link>
      <guid>https://dev.to/cameronblandford/dev-to-fills-an-important-niche-for-mild-effort-posting-2l7p</guid>
      <description>&lt;p&gt;Wordpress, blogspot, ghost, and analogous blogging platforms have always felt to me much more metered, where everything you write is assumed to be drafted and carefully considered. Twitter has decent support for effort-posting but it feels like a hack (drafting threads specifically), and the good writing that comes out of Twitter seems like it exists despite Twitter's design, not because of it. Facebook has the obvious limitation of mostly being an IRL social network, with only mild support for long-form content (FB notes are extremely dead, and long-form content exists behind several read-mores, mixed in with your old high-school friends' selfies).&lt;/p&gt;

&lt;p&gt;Dev.to perfectly bridges this gap: it offers a great interface for writing long-form content, while still retaining the trappings of an informal social network. Writing here also feels relatively protected, and not quite as public as writing in other places, due to the cozy community vibes it gives off.&lt;/p&gt;

&lt;p&gt;I imagine that writing here will be a perfect place to test-drive ideas for essays and longer posts and to interact with other people putting a similar amount of effort into their writing: enough that it's substantial, but not so much that it's perfectly polished.&lt;/p&gt;

&lt;p&gt;All this being said, maybe it's just the monospace font for article drafts?&lt;/p&gt;

</description>
      <category>devto</category>
      <category>wordpress</category>
      <category>blogging</category>
      <category>meta</category>
    </item>
    <item>
      <title>Building My Own Markdown Compiler (1/?)</title>
      <dc:creator>Cameron</dc:creator>
      <pubDate>Mon, 08 Apr 2019 15:52:57 +0000</pubDate>
      <link>https://dev.to/cameronblandford/building-my-own-markdown-compiler-1-3nc5</link>
      <guid>https://dev.to/cameronblandford/building-my-own-markdown-compiler-1-3nc5</guid>
      <description>&lt;p&gt;After spending a lot of time on &lt;a href="https://www.gwern.net/"&gt;gwern.net&lt;/a&gt; which was written in Haskell, and reading Matthew Butterick's e-books, which were written in a markup lang built in Racket, I've decided that there are certain custom features I want from Markdown for personal website reasons that aren't provided in the vanilla spec. So, as is the novice dev way a lot of the time, I decided it'd be a fun learning experience to write my own website compiler. I'm currently reading Realm of Racket to get acquainted with the language, and plan on reading Beautiful Racket (by Butterick) afterwards, as trying to read the latter without some sort of primer or foundational knowledge was a little dry and overwhelming. I also think it's just much easier for me to read on my Kindle than it is to internalize the same info through a computer screen.&lt;/p&gt;

&lt;p&gt;In the spirit of Realm of Racket, I've decided to chronicle my adventures here, and keep a log of the things that I enjoyed, as well as the things that slowed me down or acted as obstacles.&lt;/p&gt;

&lt;p&gt;Et cetera:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Large exponents (e.g. 50 ^ 50) are calculated flawlessly in Racket for reasons I don't yet understand, which is immensely neat.&lt;/li&gt;
&lt;li&gt;I think learning Racket could be a great intro into learning Clojure, which I also want to do.&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>racket</category>
      <category>lisp</category>
      <category>markdown</category>
    </item>
    <item>
      <title>Underrepresented Ideas in Coding Pedagogy</title>
      <dc:creator>Cameron</dc:creator>
      <pubDate>Mon, 08 Apr 2019 15:40:38 +0000</pubDate>
      <link>https://dev.to/cameronblandford/underrepresented-ideas-in-coding-pedagogy-l66</link>
      <guid>https://dev.to/cameronblandford/underrepresented-ideas-in-coding-pedagogy-l66</guid>
      <description>&lt;h2&gt;
  
  
  Approaching coding as literacy
&lt;/h2&gt;

&lt;p&gt;As many people have remarked (especially in &lt;a href="https://twitter.com/leftoblique/status/1114951714807791616"&gt;this twitter thread&lt;/a&gt;), teaching people to read code before writing it could be a way forward for many CS students. Having students work through coding literacy problems during class would not only prepare them for certain kinds of interviews, but also establish a healthy paradigm of reading existing code that might prevent things like "not invented here" syndrome and a desire to scrap existing contributions to a project and re-write it all yourself.&lt;/p&gt;

&lt;h2&gt;
  
  
  Providing optional curricular pathways to match people's optimal learning strategies
&lt;/h2&gt;

&lt;p&gt;Different people learn in different ways. I didn't really understand functions in programming until I understood that they were (ideally, and ignoring side-effects) equivalent to functions in math (i.e. that they were a mapping). Lesswrong's Screwtape &lt;a href="https://www.lesswrong.com/posts/Q924oPJzK92FifuFg/write-a-thousand-roads-to-rome"&gt;wrote a great essay&lt;/a&gt; about why presenting the same concept in a variety of ways is important and effective.&lt;/p&gt;

&lt;h2&gt;
  
  
  Weaker Ideas
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Learning functional programming as part of the core curriculum
&lt;/h3&gt;

&lt;p&gt;I wish I had been exposed more to functional programming from the beginning! We touch on recursion in school, and I feel comfortable writing my own tree traversal functions, but outside of that it was hardly used. For example, I wonder why LISPs aren't taught as a core programming family alongside the normal ALGOL languages (C, Ruby, Python, Java, Javascript, etc).&lt;/p&gt;

&lt;h3&gt;
  
  
  Encouraging students to write tutorials based off what they learn
&lt;/h3&gt;

&lt;p&gt;It would give students experience with real writing that other real humans might read (versus things only your TA will read), and help you internalize what you've learned in a class.&lt;/p&gt;

&lt;h3&gt;
  
  
  Redesign of class structure
&lt;/h3&gt;

&lt;p&gt;I learned far more in intensive classes that only took a few weeks but occupied all my class time than I did in semester-long classes that only met for a few hours per week. Juggling 5 disparate classes becomes a meta-task of figuring out how to do just enough work in each to stay afloat, because you don't have the time or energy to fully devote yourself to more than one or two courses at a time.&lt;/p&gt;

&lt;p&gt;Having one class at a time (with breaks frequently throughout the day) means you can really invest yourself mentally and emotionally into the material, &lt;em&gt;and&lt;/em&gt; it prepares you much more for most jobs.&lt;/p&gt;

&lt;h3&gt;
  
  
  More lab time
&lt;/h3&gt;

&lt;p&gt;The only way you can guarantee that a student is learning something is by giving them time in a space where they have to be working on it. As a recent grad, I always felt I learned much more quickly in a lab, with access to a TA or two, than I did on my own or in lecture. I also got work done at a much faster rate. &lt;/p&gt;

</description>
      <category>pedagogy</category>
      <category>cs</category>
      <category>learning</category>
      <category>tutorials</category>
    </item>
  </channel>
</rss>
