<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Daniel Campos on Medium]]></title>
        <description><![CDATA[Stories by Daniel Campos on Medium]]></description>
        <link>https://medium.com/@ddcampos?source=rss-84a5f0609d46------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*HKm5gOmBDT03Kc5qxrBAyg.jpeg</url>
            <title>Stories by Daniel Campos on Medium</title>
            <link>https://medium.com/@ddcampos?source=rss-84a5f0609d46------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 00:35:33 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@ddcampos/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[STRONG Parameters for Devise : Adding a username field to Sign Up / Log In]]></title>
            <link>https://medium.com/@ddcampos/strong-parameters-for-devise-adding-a-username-field-to-sign-up-log-in-c1ee0c6619f?source=rss-84a5f0609d46------2</link>
            <guid isPermaLink="false">https://medium.com/p/c1ee0c6619f</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[authentication]]></category>
            <category><![CDATA[login]]></category>
            <category><![CDATA[ruby]]></category>
            <category><![CDATA[rails]]></category>
            <dc:creator><![CDATA[Daniel Campos]]></dc:creator>
            <pubDate>Tue, 15 May 2018 07:04:09 GMT</pubDate>
            <atom:updated>2018-05-15T07:04:09.881Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>TECHNICAL CASE STUDY //</strong> ADDING A USERNAME FIELD TO USER AND INCLUDING USERNAME IN SIGN UP AND LOG IN VIEWS USING DEVISE USER AUTHENTIFICATION SYSTEM</p><p>I went through this today and while it is not difficult by any means it took a bit to put together an up-to-date procedure so we thought it useful to run through it here…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/1*G2x3SPZCStTrpOcp5kwgqg.png" /><figcaption>The User Authentification System ORM we used with Ruby on Rails.</figcaption></figure><p><strong>PROCESS</strong></p><p>Notes on state of set-up:</p><ul><li><strong>Devise GitHub</strong> (source): <a href="https://github.com/plataformatec/devise#strong-parameters">https://github.com/plataformatec/devise#strong-parameters</a></li><li>This was written in <strong>April 2018</strong> — if you’r reading this well into the future then don’t take the below for granted and go check out the source noted above as Devise’s Git would be the best source for the latest info…that said:</li><li>You have set up a simple CRUD webapp using the <strong>Ruby on Rails</strong> and installed and impletemented Devise using default settings which should set the login and signup views with email and password fields only.</li><li>We are using Ruby on Rails with Postgres for our db model.</li></ul><p><strong>STEP 1.</strong></p><p>In the<strong> command line</strong> in the root directory of the project generate a migration to create a username column to the users table in postgresql:</p><pre>rails generate migration add_username_to_users username:string:uniq</pre><p><strong>STEP 2.</strong></p><p>Run the migration to apply the changes to your db schema and ActiveRecord:</p><pre>rake db:migrate</pre><p><strong>STEP 3.</strong></p><p>Add the additional username parameter to the user table in the db allowing for and protecting this change…</p><p>Add the below code in to your <em>application_controller.rb </em>file located in app/controllers/</p><pre>before_action :configure_permitted_parameters, if: :devise_controller?</pre><pre>protected</pre><pre>def configure_permitted_parameters<br> devise_parameter_sanitizer.permit(:sign_up, keys: [:username])<br> devise_parameter_sanitizer.permit(:sign_in, keys: [:username])<br> devise_parameter_sanitizer.permit(:account_update, keys: [:username])<br>end</pre><p>Note that Rails 4 moved the parameter sanitization from the model to the controller…the three actions in Devise (sign_up, sign_in and account_update) that allow parameters to be passed down to the model, are processed here. ‘<em>protected</em>’ (in the middle) allows the username parameter to be updated in the database while protecting the database from being altered in non-intended ways.</p><p>Also make sure you have the following protection code in the application controller:</p><pre>protect_from_forgery with: :exception</pre><p><strong>STEP 4.</strong></p><p>Configure the Devise views so you can add the username field to the signup and login views in Devise:</p><pre>rails generate devise:views</pre><p><strong>STEP 5.</strong></p><p>Add another field to the html files in Devise you would like to — look in: <em>app/views/devise/registrations</em> or <em>app/views/devise/sessions</em></p><p>You can copy and paste the email field and adjust the details…something like below:</p><pre>&lt;div class=”field”&gt;<br> &lt;%= f.label :username %&gt;&lt;br /&gt;<br> &lt;%= f.text_field :username, autofocus: true, autocomplete: “username” %&gt;<br>&lt;/div&gt;</pre><p><strong>AND….Now</strong> if you start your server (<em>rails s</em>) and try it out (<em>localhost:3000/</em>) you should see the username field appear for signup and login…yay :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c1ee0c6619f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 Tips For Learning a New Programming Language]]></title>
            <link>https://medium.com/@ddcampos/5-tips-to-learning-a-new-programming-language-28b2877dcf2c?source=rss-84a5f0609d46------2</link>
            <guid isPermaLink="false">https://medium.com/p/28b2877dcf2c</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[flask]]></category>
            <category><![CDATA[react-native]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[Daniel Campos]]></dc:creator>
            <pubDate>Sat, 12 May 2018 14:19:41 GMT</pubDate>
            <atom:updated>2018-05-12T16:22:09.385Z</atom:updated>
            <content:encoded><![CDATA[<p>The impossible was made possible one small step at a time…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*NoWeyD4gTHGiv1pAeaf22w.png" /><figcaption>I recently learned Python and built a very simple mobile application using Flask and React Native.</figcaption></figure><h3>1. LOOK FOR WHAT YOU KNOW</h3><p>Working with the unknown can be overwhelming so the first thing I do is look for elements or patterns I recognise. By starting with the things that you know (no matter how little), it can help you ‘get into’ the code and begin forming a better understanding of the new syntax and format. Begin with rudimentary elements like identifying variables and basic class, function structure and then move into more detail.</p><h3>2. EXPERIMENT</h3><p>Get in the sandbox (just a metaphor — real sand is bad for computers), and play around with the code to see what it does! Grab some snippets of code online and manipulate the data to understand how the code reacts and changes. Getting your hands dirty is a great way to increase your confidence because you get real feedback examples from live running code. Be curious — “what if I do this?” is a great way to understand processes.</p><h3>3. SMART SEARCHING</h3><p>Googling is a must and EVERYONE DOES IT! The real skill in googling is finding the right information and while Google’s web crawlers are pretty good at their job, there is a lot of inaccurate or outdated information online. A couple tips for good search results is to modify your scope of search (try specific searches but if you can’t find what you’re looking for try broadening the search scope — sometimes you aren’t looking for the right thing and making the search more general will allow the right solutions to be found — <em>ie. instead of “what is the function to create a connection with flask using python — try “python flask”</em>.</p><p>Another important tip is look at the date of the information provided. Tech moves super fast and solutions even a year old can be deprecated — look for recent posts, tutorials and go to the code/framework source (official website, Github) because they often have the most up-to-date information.</p><h3>4. VISIBILITY</h3><p>When you’re working with new code it’s important to follow the code along the process. In the best case, you want to see how variables change, what happens in functions and what it returned in the code. To do this, and thus gain a deeper insight into how the code functions, gain visibility by printing variables, blocks, function returns etc.</p><h3>5. Test Driven Development (TDD)</h3><p>I know this means often learning a new testing language on top of the new code language but TDD is the way of the future and there’s a good reason for it: it makes debugging a whole lot easier if tests are well isolated and test return values of functions/classes <strong>AND</strong> when you start adding new features, tests ensure you don’t break your original code in ways you couldn’t predict.</p><p>Happy learning and remember: this is SUPER FUN and imagine all the awesomeness you’re going to produce WHEN you LEARN YOUR NEW LANGUAGE :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=28b2877dcf2c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[In The Making : Cold Shower Therapy]]></title>
            <link>https://medium.com/@ddcampos/in-the-making-day-3-7dd56f687cfd?source=rss-84a5f0609d46------2</link>
            <guid isPermaLink="false">https://medium.com/p/7dd56f687cfd</guid>
            <category><![CDATA[self-improvement]]></category>
            <dc:creator><![CDATA[Daniel Campos]]></dc:creator>
            <pubDate>Thu, 22 Feb 2018 20:34:12 GMT</pubDate>
            <atom:updated>2018-05-12T16:19:15.855Z</atom:updated>
            <content:encoded><![CDATA[<p>This is a VERY casual blog about becoming a developer from the beginning. I started at Makers Academy in Feb 2018 and this is how the story goes…</p><p>I heard this from another student at Makers — Cold Shower Therapy…the idea that having a cold shower for at least 5 minutes everyday will help you become more comfortable with the unknown or uncomfortable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*UVNqtV2THQFzDD5XaWUDIg.jpeg" /><figcaption>Boxing Day Swim at Poldhu Cove in Cornwall (2017).</figcaption></figure><p>I’m not saying I’ve started taking cold showers in the morning (which I might start doing) but the idea reminded me a lot about my first couple days at school working in paired-programming….it feels a bit like a really cooold shower: exciting and refreshing but slightly discomforting if you’re not in the mood for it or it’s not flowing smoothly.</p><p>Now — in keeping with the cold shower metaphor, I don’t think every paired-session is going to be amazing and refreshing but it’s those extra hard sessions (where the water feels especially cold) that you have the most to learn — about yourself and how you can turn challenges to triumphs…those are the cold showers you’ll remember and be proud you took.</p><p>Dd out.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7dd56f687cfd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[In The Making : Getting into it…]]></title>
            <link>https://medium.com/@ddcampos/in-the-making-day-2-8dee27501ece?source=rss-84a5f0609d46------2</link>
            <guid isPermaLink="false">https://medium.com/p/8dee27501ece</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[rspec]]></category>
            <category><![CDATA[makersacademy]]></category>
            <dc:creator><![CDATA[Daniel Campos]]></dc:creator>
            <pubDate>Tue, 20 Feb 2018 23:10:51 GMT</pubDate>
            <atom:updated>2018-05-12T14:27:13.214Z</atom:updated>
            <content:encoded><![CDATA[<p>This is a VERY casual blog about becoming a developer from the beginning. I started at Makers Academy in Feb 2018 and this is how the story goes…</p><p><strong>Day 2— <em>Cloudy with a chance of gherkin (20 Feb 2018)</em></strong></p><p>Planned on getting in early (got there just in time). If a couple months ago I had no idea what the word ‘git’ was — I do now. I ate it for brunch this morning and then all afternoon in git-sized snack packs. It’s an acquired taste but after a while it goes down real smooth. Like a well oiled machine it is.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JU59pw8xPIRd0Ygz_F-foQ.jpeg" /><figcaption>Cloudy with a chance of gherkin.</figcaption></figure><p>If there’s some knowledge to impart today it is — google got your back, READMEs are like bibles to the repo religion and RSPEC — learning what it means to me.</p><p>Dd</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8dee27501ece" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[In The Making : First Steps…]]></title>
            <link>https://medium.com/@ddcampos/making-it-day-1-c22a299dd920?source=rss-84a5f0609d46------2</link>
            <guid isPermaLink="false">https://medium.com/p/c22a299dd920</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[junior-developer]]></category>
            <category><![CDATA[learning]]></category>
            <category><![CDATA[makersacademy]]></category>
            <dc:creator><![CDATA[Daniel Campos]]></dc:creator>
            <pubDate>Mon, 19 Feb 2018 21:37:28 GMT</pubDate>
            <atom:updated>2018-05-12T14:26:38.866Z</atom:updated>
            <content:encoded><![CDATA[<p>This is a VERY casual blog about becoming a developer from the beginning. I started at Makers Academy in Feb 2018 and this is how the story goes…</p><p><strong>Day 1 — <em>Like a Thirsty Camel in New Lands (19 Feb 2018)</em></strong></p><p>One of those days where you’re braced for anything but you have no idea what to expect. Excitement feels like nausea but they have croissants and coffee in the morning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4r68U313ZYgywS3N2XWGVQ.jpeg" /><figcaption>Exploring new territories.</figcaption></figure><p>Name tags (we got to use stickers — yes I used the camel sticker to make this image). Build a freestanding structure to balance a marshmallow out of spaghetti and tape (fail). Meditation (this is going to be a challenge). Paired-programming (pair pair pair pair pair and then pair again).</p><p>I was prepared for a rainy windy london cycle home but to my surprise it was mellllloooow — the view on london bridge on the way home — day one — in the bag.</p><p>Dd</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c22a299dd920" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>