<?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: dmacinto</title>
    <description>The latest articles on DEV Community by dmacinto (@dmacinto).</description>
    <link>https://dev.to/dmacinto</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%2F1001354%2Fc6e370ca-f542-412f-a26b-5509dbfea7b2.png</url>
      <title>DEV Community: dmacinto</title>
      <link>https://dev.to/dmacinto</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dmacinto"/>
    <language>en</language>
    <item>
      <title>AppDev Week 8</title>
      <dc:creator>dmacinto</dc:creator>
      <pubDate>Wed, 22 Feb 2023 02:22:02 +0000</pubDate>
      <link>https://dev.to/dmacinto/appdev-week-8-21jc</link>
      <guid>https://dev.to/dmacinto/appdev-week-8-21jc</guid>
      <description>&lt;p&gt;AppDev Week 8&lt;/p&gt;

&lt;p&gt;N+1 problem - frequent requests to the database where you also call at the associates &lt;/p&gt;

&lt;p&gt;eager loading - pull database once to work with &lt;/p&gt;

&lt;p&gt;includes() method in the each do loop to note what to load&lt;/p&gt;

&lt;p&gt;queries are where most of hte time improvements can be made &lt;/p&gt;

&lt;p&gt;bullet gem can give a warning for N+1 problems &lt;/p&gt;

&lt;p&gt;cache-ing - precomputing to save and show later &lt;/p&gt;

&lt;p&gt;&amp;lt;% cache “hello” do %&amp;gt;&lt;/p&gt;

&lt;p&gt;&amp;lt;% end %&amp;gt;&lt;/p&gt;

&lt;p&gt;need to be enabled by rails dev:cache&lt;/p&gt;

&lt;p&gt;middle term in the cache statement is the cache key &lt;br&gt;
every time the key is changed, rails will update the cached &lt;/p&gt;

&lt;p&gt;in hte belong_to, you can update touch:true to use the parent object as the cache key&lt;/p&gt;

&lt;p&gt;kaminari gem used for pagnetnation &lt;/p&gt;

&lt;p&gt;API Stuff&lt;/p&gt;

&lt;p&gt;jbuilder &lt;/p&gt;

&lt;p&gt;json.set!(:hello, “Hello World!”)&lt;/p&gt;

&lt;p&gt;or json.hello(“world”)&lt;/p&gt;

&lt;p&gt;nested hashes &lt;/p&gt;

&lt;p&gt;json.hell(“world”) do&lt;/p&gt;

&lt;p&gt;end&lt;br&gt;
 React-native demo&lt;/p&gt;

&lt;p&gt;View is like div &lt;/p&gt;

&lt;p&gt;yarn start --tunnel to start apps on expo &lt;/p&gt;

</description>
      <category>css</category>
      <category>showdev</category>
      <category>challenge</category>
    </item>
    <item>
      <title>AppDev Week 4</title>
      <dc:creator>dmacinto</dc:creator>
      <pubDate>Wed, 25 Jan 2023 02:51:21 +0000</pubDate>
      <link>https://dev.to/dmacinto/appdev-week-4-30gj</link>
      <guid>https://dev.to/dmacinto/appdev-week-4-30gj</guid>
      <description>&lt;p&gt;AppDev Week 4&lt;/p&gt;

&lt;p&gt;Crossroads!&lt;/p&gt;

&lt;p&gt;2-3 small apps in Ruby &lt;/p&gt;

&lt;p&gt;Flutter&lt;br&gt;
React &lt;br&gt;
Ionic.js&lt;/p&gt;

&lt;p&gt;react separates frontend from back end, no server side rendering&lt;/p&gt;

&lt;p&gt;4 more homework and then a small project that works &lt;/p&gt;

&lt;p&gt;assignments &lt;br&gt;
figure out which way Im leaning &lt;/p&gt;

&lt;p&gt;ruby notes &lt;/p&gt;

&lt;p&gt;attr_accessor creates a getter and setter function for whatever symbol you define &lt;/p&gt;

&lt;p&gt;attr_reader creates the getter &lt;/p&gt;

&lt;p&gt;initialize method to set up stuff for htat model before doing anything with it &lt;/p&gt;

&lt;p&gt;first step is to inspect routes to limit user functionality &lt;br&gt;
each of hte routes if you allow, determine who is allowed&lt;br&gt;
and check the logic &lt;br&gt;
next, don’t show people things they shouldn’t see &lt;br&gt;
use conditional statements to hide things they shouldn’t see &lt;br&gt;
in the view templates &lt;/p&gt;

&lt;p&gt;define a before action to help minimize redundant code&lt;/p&gt;

&lt;p&gt;gem that helps with authorization&lt;/p&gt;

&lt;p&gt;Pundit gem! &lt;/p&gt;

&lt;p&gt;remember rails doesnt autoload every folder! if a new one like policies is needed, you must note it &lt;/p&gt;

&lt;p&gt;raise exception rather than redirect_back when theres an error &lt;/p&gt;

</description>
    </item>
    <item>
      <title>AppDev 2 Week 3</title>
      <dc:creator>dmacinto</dc:creator>
      <pubDate>Wed, 18 Jan 2023 02:52:43 +0000</pubDate>
      <link>https://dev.to/dmacinto/appdev-2-week-3-23l9</link>
      <guid>https://dev.to/dmacinto/appdev-2-week-3-23l9</guid>
      <description>&lt;p&gt;AppDev Week 3&lt;/p&gt;

&lt;p&gt;javascript!&lt;/p&gt;

&lt;p&gt;Always include jQuery when using javascript&lt;br&gt;
be sure to put the jQuery script as the first element before the script &lt;/p&gt;

&lt;p&gt;Be careful of javascript asynchronous movement&lt;br&gt;
Many things operate in parallel so be mindful of the code&lt;br&gt;
To stuff like toggle in a function to help &lt;/p&gt;

&lt;p&gt;callback functions &lt;/p&gt;

&lt;p&gt;jQuery documentation is great&lt;/p&gt;

&lt;p&gt;hover above a link is called a tooltip&lt;/p&gt;

&lt;p&gt;put tooltips on the bottom of application layout for best effect. if on top, it will error because it runs before the html runs &lt;/p&gt;

&lt;p&gt;better is to use $(document).ready(function(){ put in here}) in the head of the application layout &lt;/p&gt;

&lt;p&gt;%i is used for creating an array of symbols&lt;/p&gt;

&lt;p&gt;regular expressions are a pattern matching language &lt;br&gt;
checks a string against a certain pattern &lt;/p&gt;

&lt;p&gt;Pundit has makes sure you get the authorization correct to hide or show parts of the page, theres a chapter on it&lt;/p&gt;

&lt;p&gt;policies folders has a place where we can define methods &lt;br&gt;
becomes the one place where we make the policy on who does what &lt;/p&gt;

&lt;p&gt;font awesome is a font set that we use for the discover nav bar&lt;/p&gt;

&lt;p&gt;validates :recipient_id, uniqueness: { scope: :sender_id, message: "already requested" }&lt;/p&gt;

&lt;p&gt;validate :users_cant_follow_themselves&lt;/p&gt;

&lt;p&gt;def users_cant_follow_themselves&lt;br&gt;
    if sender_id == recipient_id&lt;br&gt;
      errors.add(:sender_id, "can't follow themselves")&lt;br&gt;
    end&lt;br&gt;
  end&lt;/p&gt;

&lt;p&gt;validate is used when wanting to define our own method for validation &lt;/p&gt;

&lt;p&gt;I18n is a class where the purpose is to automatically translate our old app into new languages for different users, multiple languages, make a key and then it changes the language, pulled from devise &lt;/p&gt;

&lt;p&gt;dom_id is a helper function that simplifies class name and id number into one string &lt;/p&gt;

&lt;p&gt;strip_attributes gem is used for setting parameters for user inputs commands like username creation with no white space etc &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;add remote: true to link_to functions to break the link &lt;/li&gt;
&lt;li&gt;add a response in my respond_to block&lt;/li&gt;
&lt;li&gt;update the template with the responses I want &lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;escape_javascript method &lt;/p&gt;

</description>
      <category>python</category>
      <category>softwaredevelopment</category>
      <category>productivity</category>
      <category>discuss</category>
    </item>
    <item>
      <title>AppDev Week 2</title>
      <dc:creator>dmacinto</dc:creator>
      <pubDate>Wed, 11 Jan 2023 02:42:04 +0000</pubDate>
      <link>https://dev.to/dmacinto/appdev-week-2-4l0</link>
      <guid>https://dev.to/dmacinto/appdev-week-2-4l0</guid>
      <description>&lt;p&gt;Always use bootstrap for the basic CSS on a rails app&lt;/p&gt;

&lt;p&gt;When using if statements, until you use a method on a variable, it may be blank and may always be true because it will output “ ”&lt;/p&gt;

&lt;p&gt;rails db:rollback to rollback 1 migration &lt;/p&gt;

&lt;p&gt;If you add a column, you add it to the form, forget that urls can’t be added without permitting the parameter &lt;/p&gt;

&lt;p&gt;rails g migration AddDirectorIdToMovies&lt;/p&gt;

&lt;p&gt;def the subhashes in the controller function to use it as a local variable &lt;/p&gt;

&lt;p&gt;Partials help clean up the CSS on the application layout file significantly &lt;/p&gt;

&lt;p&gt;When using render template: and doing a partial, make sure the partial file name has the _ with it. &lt;/p&gt;

&lt;p&gt;Locals allows you to pass local variables &lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/heartcombo/simple_form" rel="noopener noreferrer"&gt;https://github.com/heartcombo/simple_form&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Bootstrap cards comprise head, body, and footer &lt;/p&gt;

&lt;p&gt;All active record objects have a partial path established&lt;/p&gt;

&lt;p&gt;Read through the Ruby API documentation on partials &lt;/p&gt;

&lt;p&gt;before_action is very useful for repeating actions in the controller, can put in the application controller to make it a little more seamless&lt;/p&gt;

&lt;p&gt;%i is a quick way (ruby ) to create symbols &lt;/p&gt;

&lt;p&gt;jbuilder is a template for creating json using ruby &lt;/p&gt;

&lt;p&gt;Scaffold method to generate stuff very quickly &lt;/p&gt;

&lt;p&gt;Use the devise gem for sign-in and sign-out, very boiler plate and easy to use ! &lt;/p&gt;

</description>
      <category>watercooler</category>
    </item>
    <item>
      <title>AppDev Week 1</title>
      <dc:creator>dmacinto</dc:creator>
      <pubDate>Wed, 11 Jan 2023 00:30:24 +0000</pubDate>
      <link>https://dev.to/dmacinto/appdev-week-1-31if</link>
      <guid>https://dev.to/dmacinto/appdev-week-1-31if</guid>
      <description>&lt;p&gt;resources :movies gives you all 7 routes &lt;/p&gt;

&lt;p&gt;a = [1,2,3]&lt;/p&gt;

&lt;p&gt;h = { :first =&amp;gt; 1, :second =&amp;gt; 2}&lt;/p&gt;

&lt;p&gt;a.at(2)&lt;/p&gt;

&lt;p&gt;h.fetch(“first”)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://exercism.org/"&gt;https://exercism.org/&lt;/a&gt; for more practice&lt;/p&gt;

&lt;p&gt;post used to modify the database&lt;/p&gt;

&lt;p&gt;post needs to come with a password to ensure that a 3rd party isn’t generating a DDoS type of thing &lt;/p&gt;

&lt;p&gt;routes start with the plural name of the table name&lt;/p&gt;

&lt;p&gt;use patch for updates, change http verb for different crud functions&lt;/p&gt;

&lt;p&gt;delete, patch, post, get &lt;/p&gt;

&lt;p&gt;use rails/info on the bin/server url to pull up a listing of all of the routes &lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
