Manage your time and become an expert

I’ll keep this short. If you’re like most of us who work 40 hours per week, have families, and other priorities, you know that time is precious. Now, we’ve all been reading the same material from industry experts on how to get a job in the tech industry. This material constantly expands on the same things such as keep an active blog, some recommend building certain projects, others recommend going to meetups and connecting with other developers. From all of this, I think we’re missing the two most important aspects which are managing your time and becoming an expert.

becomeanexpert

I spent this week thinking about what to blog about and how long it would take me to research and write this blog on Saturday. In this thought process, introspection led me to consider how much time I spend doing my best to write quality content when my focus is on web development. See, in life, priorities rule our every decision. One of my priorities involves taking care of the people around me and the only way I can do that is to become an expert. Life is stressful and it will constantly give you more than you can handle. But thankfully with focus and a single-minded pursuit of a goal you can transcend at least the most menial of these stresses. So like I said I’ll keep this short, I have to utilize my Saturday for becoming an expert at my craft. That’s what will ultimately supply the opportunities I’m looking forward to grasping. Blogging will have to take a backseat. So my message to everyone is simply this, stay hungry and opportunity will come but you have to keep knocking on the door. And by knocking I mean studying.

Luv-PHP Verifying user passwords

phpftw PHP, in my opinion, is one of the worlds most misunderstood programming languages. Older developers who’ve been around since its inception can remember a time when PHP didn’t have object oriented features and OOP has been around since the 60s. But today PHP is a fully functional programming language that can handle its own when paired with good programming practices. So here today I’m going to show you a small useful function in PHP used to verify passwords that have been hashed in the database. In this tutorial I will be assuming you know some PHP and MYSQL basics such as how to setup a database, connecting to the database, etc. All the code is provided in this GitHub repository, so no heavy amount of set-up is needed.

In this exercise, we will be using PHP data-objects(PDO). PDO is amazing in the fact that it provides you with a way to use the same functions to issue queries and fetch data, no matter the database you’re using. With that said let’s jump right in.

loginform

We have a simple log-in form that we will be using to submit data into our database. Assuming you’ve already set-up your database and tables, there is a query provided to insert your username and password in the “main.php” file located below the closing body tag.

hashed

 

After running this query it will populate your database table with the username and password you provided. Be sure to delete or comment out the previous query as it may cause log-in problems with the rowCount() function we will be using. Now you have everything it takes in order to use the password_verify function. Head back to the log-in form and type in the information you provided in the query above.  Under the hood of your login form, there are various functions and forms of verification running behind the scenes. To start we take our user input and sanitize it like so….

sanitizeinputs

Next step is to check if the username submitted is part of a row in the database.  For this, we use a PDO prepared statement.  Using this we need to check if the username corresponds to a row in the designated table associated with our database.

checkifuser

 

 

Now here is where all of the magic happens. We take the information that we get back from the database and insert it into an associative array.

assoc

This returns an array indexed by column name, so now you will be able to grab the password from the results. Using this password, it is now time to use the password_verify function. This function takes two inputs, the first being the password that the user submitted and the password that is currently in our $dbpassword variable. We will also be checking to see if there is more than one user in the database that shares the same username using the rowCount() function. This just returns the number of rows that were affected by the query. Now in a normal web app, you would have the user submit his or her e-mail address which would be his or her unique identifier preventing duplications from happening but for this tutorial, we will just be using a username field.

verify&count

If all is well so far than it is now time to check our work, here we will set up an if statement and see if our $count variable is equal to 1 row affected, and we’ll see if our password_verify() function returns true. If everything goes as planned, we shall set a nice message in our session variable and set our header function to send us back to the homepage. Don’t forget to set your database connection to null and exit so no more code is run.

 

There should be a success message waiting for you and you now know how to verify user passwords using the password_verify function.

correction

 

Congratulations. Don’t forget to follow and leave a comment below.

Get what you’re worth

Motivational speaker and successful businessman, Jim Rohn, stated during one of his many seminars “You get paid for bringing value to the marketplace, and if you’re not very valuable you don’t make much money.” That statement should guide you on your journey of becoming a software engineer. Money is not the most important thing in the world, I personally will put family and health as the most valuable aspects of human existence. But when it comes to judging your skills as an entrepreneur or as an employee, your value is determined in dollars. And the only successful way to increase that dollar amount is by increasing your value. How much value are you bringing to the marketplace? What have you done to empower other people and/or businesses around you? These are all questions that you should ask yourself in order to assess where you’re going and how fast you’ll get there at any moment.

themoreyouknow

If you know it… Show it

Right now you’re building your skills as a software engineer which involve hours of personal development that will eventually lead you to become valuable to someone. But if you’re like most self-taught developers, who have become uninspired by their current job, then you want a new life sooner than later. If that’s the case then the rest is simple, it’s time you start to bring value to the marketplace. How many businesses can you find on google maps who have bad websites or older non-responsive sites? I know of at least 50. These are all potential clients that you could be bringing value to by giving them a modern website. Don’t wait for them to come to you, start working right away. How many friends you know that could use some help landing a job. Your skills could help them move forward. Check it out.

hireme

value

 

I wrote their resume and made them a website so they could get a job paying 20 dollars an hour. I essential brought value to the marketplace. Your skills as a software engineer are more valuable than you can imagine. You’re at a time in your life where you have to forego money for the experience. Only then will you be more capable of bringing value and having a matching portfolio that says so.

knowitshowit

Results…Attitude..Discipline

“Discipline is the bridge between goals and accomplishment.” -John Rohn

I don’t know your goals. I can’t understand your life neither/or can I fathom your circumstances. But it is imperative that you learn what discipline means to your success. From your results, I can accurately judge your attitude and your discipline. If you constantly start things and don’t finish them, I can tell. If your GitHub is full of fluff and initial commits, I can tell. If you write a blog post every now and then, but your post constantly lacks purpose, enthusiasm, and drive I can tell and EMPLOYERS can too. You have to make a decision to make personal development the most meaningful part of your life’s journey. Don’t look back and regret the countless hours you spent watching television and giving toxic people your time.

You are the business

What you probably don’t realize right now is you are a business. As famed web developer James Altucher once stated in his amazing article “How to quit your job the right way”, view your life as a business. You rent yourself to other businesses at a portion of the profits they will make off you. This is possible because of the value you haven’t revealed to the market yet. By allowing yourself to be rented out, you will never reach full market value for your work. I encourage you to engage in activities that will bring your market value into the full view of the world.

Want to get a job? Start a Business!

Create your own job. Practice the discipline and skills you’ve learned by creating a viable business. Make a short term goal to get at least 6 client projects under your belt. Start reading more about what it takes to run a successful business and learn how to learn more effectively. During this time you will amass skills in sales, marketing, problem-solving, negotiation, time management, and most of all people skills. These are all skills that directly translate to being valuable. Even if starting a business in web-design isn’t what you want, it still lines up with the bottom line, gaining skills to make yourself more valuable to the marketplace. With those steps taken it would be impossible for you to interview and not land at least a mid level position.

Resolve

Whatever you do don’t give up. Make a covenant with yourself to not give up until…

Your happiness depends on it. Your life depends on its. You children depend on it. I made a pact with myself a while ago that I will value my time and others. That I will not only be good at what I do I will be great. I will dedicate my life to something more important than me. We as individuals don’t matter. It is the human race that will live on when we are no longer here ourselves. Your time is valuable so spend it getting all you can from every moment. Have the desire to change and double down on your goals today. I truly believe you can influence and empower the next generation.

Good Luck if you need it. But I’m sure you won’t if you made it this far.

resolve

Bonus: Successful People.

You ever notice that successful people study successful people. Warren Buffet who is famously known for consuming more books in a year then more Americans will in a life time, talks about studying the Mellon brothers, J. D. Rockefeller,  and Andrew Carnegie. If you take the time to study people like this you will see that all of them had so much in common. They all worked amazingly hard towards their goals. It is the deciding factor in any success story. Successful People don’t put other successful people on a pedestal. They dissect what makes them successful and apply the lessons to their own lives.

An intelligent person realizes what separates them from Einstein is decades of focus and dedication toward one’s own craft. Einstein lived and breathed physics, he constantly pondered the mysteries of the universe. How much time are you willing to dedicate towards your greatness? How much does it mean to you? I leave you with a young physicist named Sabrina Gonzalez Pasterski. She has become widely known as “The New Einstein”. Pasterski will tell you that she has never drunk alcohol or had a cigarette, and doesn’t have a presence on social media at all. Paterski unlike most people in the world today doesn’t even own a smartphone. Need I say more?

Parenting and Coding 101

Finding time to study with children can be down right challenging. I’ve been blessed with two children of my own(Alaiya-4 and Chrishelle-8) who I devote my full attention to on a day-to-day basis. As a family on a budget summer vacations can be especially hectic because of the massive amount of time your children now have on their hands. And filling in that time is no easy task. Not only do you have to dedicate focused attention to studying, you must also find the time to give your children the same. Honestly, it’s quite impossible but as a parent you’ll know what I mean when I say we make the impossible possible everyday. But for those of you who are just starting out in your coding journey you may find yourself in need of advice to help you along the way. In this article you will learn ways to keep your kids occupied and help them understand the importance of studying. In this article we will discuss topics such as how to start your day, where to study with children, how to study with children, taking breaks and how to structure them, and practicing mindfulness.

Ready Set GO!

When starting the day during summer vacation I like to make sure that the first two hours are dedicated to their learning and continued education.  This is the most important aspect of the day as research shows it is during summer vacation that the knowledge gap between wealthy children and less fortunate children widens. For my girls, I like to have the eldest, Chrishelle, read out loud while her sister and I listen attentively. I also help them work through carefully thought problem sets appropriate for they’re age range. The internet has tons of worksheets that you can print out and have your child work on to stimulate their young minds. But my favorite time of the day is when I teach them the art of programming. I found an amazing book while stumbling through Powell’s city of books in downtown Portland, called “Help your kids with Computer Coding“. Teaching them about coding gives them a proper understanding of what their father is studying all day long and it also creates in them an interest of computer programming. The book teaches kids how to program using the visual language “Scratch” and transitions to python as the child becomes more competent at coding. Now I must admit at their young age it’s a little over their heads but they love the quality time spent making things together. You can start teaching your kids scratch here.

20170819_113620

How to study with kids.

Now that you’ve taken care of your kids education it’s time to focus on yours. This is where you have to get crafty. Coding requires focus and attention. If you have little ones running around you might tend to get distracted. I find the best way to keep focused on the task at hand is starting a Pomodoro and working on a 25 minute study / 5 minute break cycle. I find that 25 minutes is about the longest they will go without needing my input or assistance. After about 4 Pomodoros it’s time to make snacks because the little ones will be hungry. Now for those of you saying that there is no way to keep your kids occupied at home. Yes, you are 100% right. How to study is only 10% of the problem. Where to study is the other 90% of the problem. So let’s keep this section short and jump right in.

Where to Study with kids.

Now as I stated earlier as a parent on a budget we have to be resourceful. So when I tell you I’ve categorized every park in and around Portland, I’m not kidding.

Screenshot_20170819-123025

This is my secret weapon when figuring out the ideal place to study depending on the conditions of the day. For example when they want to run through water all day, West Linn has a ton of great water play areas. If they want to climb and play in sand, Sellwood has the best nature park in Oregon. Preparation is everything when planning a good day in the park. Be sure to pack a lunch bag full of snacks and sandwiches. Another thing is knowing how far away from home you are and planning where to take them during bathroom emergencies. Now if you are as paranoid as me finding the right bathroom for your children is important. There’s no way we’re using the public restroom at the park, not even in an emergency. So I always know where a library is. Library bathrooms are the ultimate kid friendly alternative when out and about with your children. Now there are a few cons about a day out in the park, one of them being that depending on how hot it is you’re going to roast. Even when I go to the parks with a good amount of shade it’s still no protection against the heat. So that leads me to destination number 2.

Indoor Play Areas!

playstructure

When the budget allows for it an indoor play area can be the ultimate destination for the studying parent. At $8/kid this place is probably one of the greatest alternatives you will find in Portland. The majority of this articles was written at the Monkey King Play House. MKPH has an incredibly huge play area with tons of other children to keep them occupied for hours. Now by far the greatest benefits this place has to offer is free wi-fi and charging stations for your devices. Another huge benefit this place has to offer is air conditioning, recently Portland experienced a heat wave that brought temperatures in the 100 degree range, during this time the MKPH was our home away from home.

Mindful Studying.

To conclude this article I want to talk about being mindful of the things you learn. As I’ve stated earlier kids demand a ton of attention, which will ultimately lend itself to mindless hours of studying without any real gains. I’ve talked in-depth about learning how to learn here. The most important take away is doing things in more than one way so that you engage as many of your senses as possible. At least 2 to 3 times in the week I like to forego a laptop in order to focus on the knowledge I’ve gathered throughout the week. This time is also best spent filling in the gaps in your knowledge. As you learn to practice recall you’ll be able to easily identify where your short comings are. Learning to program doesn’t just involve sitting in front of a computer all day. You should take the time to write hand written notes while watching your tutorials or reading through books. Knowing that you can slow down because Rome wasn’t built-in a day will ultimately be your greatest weapon. Now go forth and learn knowing that time is your greatest asset as long as you use it wisely.

If you’ve found these tips useful leave a comment below. Also let me know your favorite destinations or study tips so they can be shared with others. Good luck on your coding journey Everyone…

 

 

 

 

5 Best tips for New Coders

If you’re happy and you know leave a comment.(repeat 2x) If you happy and you know and you really want to show it, if you’re happy and you know it leave a comment.

passion

1. Keep a Coding Journal

If you keep up with me at all on twitter or read my blog you’ll know I’m a big proponent of keeping a coding journal. Learning to code not only includes sitting in front of a computer all day, it involves the same activation of as many senses as possible in order for you to learn more effectively. If you’re only doing it this way then your brain is missing out on the opportunity to encode what you are learning in more ways than one. There are other benefits too by the way, your journal will also be a place where you write down code snippets and explain them for later use. If you’ve been coding for any significant amount of time then you think about programming a lot throughout the day. I frequently write down solutions to problems I couldn’t solve when I was in front of the computer.

2. Take your time… Let me explain

Or rather I’ll let you explain. Stop speeding through the massive amount of material you’re learning. As I stated in number 1 everything you’re learning is worth spending time on. When learning how to learn you will hear about the illusion of knowing. The only way to break free of these constraints is through proper testing on the material. Make it your life’s mission to create flash cards as you learn in order to test your self later. Another good practice is to use the Feynman technique after learning new material. The purpose is simply to write until you figure out what you don’t know and fill in the gaps.

understood
This is your new motto now.

3. Double down on your coding journey.

Is this really what you want to do? Are you in love with the process? Are you not happy with where you are right now? Then double down on your goals. Why is “The Walking Dead” more important then practicing your craft. When you’re not where you want to be in life, sacrifices must be made. I’ll stop right there. What you need to know is cutting out the distractions is how you compound knowledge. Beating down on your craft everyday will help you in leaps and bounds when it comes to mastery. Which is an excellent read by the way.  If it takes 10,000 hours to master your craft wouldn’t you want to get there quicker. Lets do some math. If you only studied for 10 hours per week it would take you 19 years in order to reach mastery. Let’s double down, if you studied 20 hours per week it would take you 9.5 years to master your craft. Lets double down again. If you studied for 40 hours a week, the same amount of time you give that life force draining job, you would be able to reach mastery in 5 years. Wow…. Double down now.

4. Solve a problem.

I think Eli the Computer Guy said this one best. You need to find problems to solve. STOP LEARNING STUFF ON ACCIDENT. If you can’t find a problem to solve then you’ll be lost in your self-studying journey. There is simply no excuse as to study programming, which is the art of learning how to think, and not be able to find a problem to solve. I hear it all the time from new coders. They don’t have a structure so they get discouraged and don’t want to move forward on their learning journey. I can not find or conceptualize no better way to find structure in your journey then to find a problem to solve. If you’ve found a problem to solve then you now know what coding looks like in the real world. As of recently I found out what it was like working with another developer. It is the most productive thing you can do and it offers tremendous learning opportunities. But wait till you have to combine your code!!! >> If I didn’t find a problem to solve that could be benefited by the addition of another coder, I never would have gained this experience. Keep that in mind for the length of your career and you will be successful.

5. Get involved.

I know why you’re doing this. You want to take it to the next level. This is a new life for you and pursuing this dream is what makes you happy. There are other people out there like you. If you want to go anywhere in your coding journey then you have to get out of your bedroom, stop coding in the coffee shops, stop consuming, and start producing for those around you. Whether its writing technical blogs to help the code newbies coming up with you or whether you’re going to meetups and providing value to others with the problems you’ve learned to solve so far. Just get involved. No one will know what you can do unless you make a commitment to put yourself out there. I don’t think I have to tell you how important soft skills will be in your tech career. Developing them early, while also providing value to the coding community, will put you in the position you want your future self to occupy. Good luck on your coding journey everyone. I’m jogging right there next to you on the road to greatness. Don’t sell yourself short, believe in the neuroplasticity of your brain and sacrifice who you are now for what you shall become.

shinetoo

 

Why smart people carry pencils?

 For almost 4,500 years books were handwritten in ink mixtures with no way of correcting errors. The pencil has changed the world with its presence encompassing 500 years of solid history from the discovery of graphite blocks in England to the refinement of the graphite and clay mixture invented in France and still used today. If you’ve ever pondered something important or dreamed of creating your own business while daydreaming the intricacies of the endeavor, then you need a pencil.  Famed company and notebook maker Field Notes has a quote that states “I’m not writing it down to remember it later, I’m writing it down to remember it now.”  So in the words of Field Notes…

Write it down now.

Let’s be honest your memory in its entirety has no place being the relied upon method for retaining information. In short, your memory sucks. How many times have you forgotten someones name immediately after they told you. How often do you read an article and can’t recall the details but know the overall point. I’d like you to remember what it’s like being a student. Going to class without a pencil was a sin. It has been documented that students who have hand-written notes have better recall come test time, so why on earth would we forego a pencil during your daily life. Unless you’re Nikola Tesla or have extensive knowledge surrounding the use of mnemonics, then a pencil should be your go to method for encoding your most important thoughts.

xpencil

It begins with a pencil

Want to know why Kendrick Lamar, Ice Cube, and J. Cole are known for compelling lyrics and unrivaled storytelling abilities? Want to know why Thomas Edison always carried a special made #2 pencil in his breast pocket?  Do you think it was a coincidence that Henry David Thoreau owned a pencil company with his family before becoming the famous author, historian, poet and philosopher that we know him as today? The greats knew the secret to success. Leaders in the field of philosophy, psychology, architecture, psychics and anything other the obvious craft of writing all honed their genius through the art of translating their mental thoughts and images to the written word. Theirs no difference in the wiring of the brain between these greats and that of yours. It’s a simple matter of the habitual use of a pencil to record your most important thoughts. Mr. Antolini in J.D. Salinger’s classic novel “The Catcher in the Rye” sums this fact up very well ‘I’m not trying to tell you,’ he said, ‘that only educated and scholarly men are able to contribute something valuable to the world. It’s not so. But I do say that educated and scholarly men, if they’re brilliant and creative to begin with — which, unfortunately, is rarely the case — tend to leave infinitely more valuable records behind them than men do who are merely brilliant and creative’.

catcher
Put on your reading list now!

For every situation deserves a pencil

We judge people by the most superficial inconsequential aspects everyday. Why not judge individuals based on the issue that matters most. Does this individual carry a pencil to actively record their most important thoughts and events. You want to impress at a job interview? Carry a pencil and let the interviewer know how important it is to learn from the experience. Want to find out if you should continue to date that new someone? On the next date ask that person if they have a pencil, see what they say. You may find yourself asking why is this important? Individuals who don’t carry pencils most likely don’t have goals. Ask them where they see themselves in 5 years, 1 year, or 3 months even. What to look for here is whether or not they had to think about it. People with pencils have written goals and aspirations that they can refer to at any minute. They don’t leave their day up to chance, it has already been planned. You will find that people without pencils are the same people who prefer jobs of a monotonous nature. Simply speaking they don’t have to think.

Start now

Your memory will only take you so far. Do yourself a favor and form the habit of writing! Start by writing down your intellectual experiences. Continue to write down new goals and aspirations. Find the man or woman of your dreams by choosing those who leave records. Bring a pencil to your next meeting or interview and watch as they take you more seriously. Success is closer than you think. Creating this simple habit will bring clarity and direction for the rest of your life.  Lastly, do you want to make sure that new employee or person of romantic interest is really worth taking the risk on? See if they bring paper too. 😉notIntellectual

Bonus: Keeping a Coding Journal

The most important thing I have done on my journey to becoming a competent coder was to start a coding journal. I use this journal to keep track of the worst bugs I’ve encountered, syntax meaning, code snippets and much more. This journal has been the inspiration for this article and my driving force on writing down whats most important, my thoughts. So code newbies to inspire the next phase in your coding journey here are a few excerpts from my coding journey from my recent battle with PHP sessions. Hopefully this will convince you to carry your own coding journal to keep track of all your wins and losses.

20170804_14302020170804_143027

 

Top 5 Terminal tricks for Penguins

Most people avoid the command line like they were being told to take a job using visual basic. I’ve seen the terminal invoke fear in greater men than me. But when you love linux you’re willing to take that dive into the abyss.

Tux

 

So you still wanna build some command line skills huh. Well would you look at that… we got us challenger. Alright, I’m gonna teach you 6 command line tricks that’ll have you navigating linux like a boss.

 areyouready

1. Super User DO -sudoTux

Super user say what! You want to remove that file that locked by tons of permissions – sudo. You want to create a folder in that directory but linux has the parental controls on cause it thinks you’re retarded -sudo. Just kidding please don’t do any of that, linux provides great security that stops you from deleting necessary system files and keeps malicious activity at bay. But on the off hand you do have what it takes to administer justice amongst your file system sudo is the way to go. Now that you have become super user. You’re ready to do some damage.

superuser
Super user power activate

2. Change directory -cdTux

Changing directories is going to be the most used command you’ll be dulling out during your command line adventures. This command also works well in conjunction with cd .. which will take you up one directory. Just keep in my when changing directories all of your file names are case sensitive. So when in doubt…

keep-calm-and-change-direction

3. List files -lsTux

Feeling lazy after all that typing. Don’t feel like checking the spelling on that file you named using your hybrid camel case/snake case naming convention. ls will quickly solve your problems. ls gives you a list of all the files in the current directory. You can also list the file recursively meaning you will see the files inside of the folders of the current directory by typing ls -R.

recursive
Windows keeps calling itself…

 

Tux

4. Touch…. yea touch

Touch lets you create a file or multiple files in the directory you’re currently in. Touch also has a myriad of other uses not explicitly pertaining to file creation. But I’ll leave it up to you to discover the almighty powers of touch , just remember though….

touchit

5. Remove Files -rmTux

We all mess up every now and then. I’m sure you have a ton of useless files and directories taking up a bunch of space on your new 2 TB Samsung SSD. Well lets fix that now. Navigate to your desktop and get rid of all those cat photos for practice. Got a cat photos directory try rmdir to delete the entire folder.

Now that I’ve turned you into a command line ninja in less than 5 minutes. Get out there and show your boss what you’re made of. For further reading check out this awesome command line tutorial at How-to Geek that helped me in my times of need .

 

 

PHP & Apache over JavaScript and Node

First and foremost, let’s do an experiment. Go to google.com and first type in node.js. Now take a look at the results.

nodejs

Now for our next experiment, I want you to go back to google and type in PHP and observe greatness…

php

9 billion results my friend…

Ok, Node let us try this one more time I’ll even give you a handicap and type javascript that should cover everything right…

javascript pic

LOL, Even the backbone of the web can’t even stand up against the almighty PHP. Alright for all of you wondering why this matters

splain

  •  As a code newbie, you are going to run across all types of problems, errors, misunderstanding, bad tutorials, outdated tutorials, new books, old books, etc. You get the message. Php has a community that is 10x more deeply rooted than the up and coming node.js.
  • Next thing is I thought about my problems that I needed to solve. As of right now, I’m working on a form for the ‘American Postal Worker Union’ that submits information to a database and emails a confirmation to the union steward. In this situation and in any you always need to think about the job, not the tools.

PHP has a wealth of information about security and submitting information to databases. And as for my current problems such as creating a website that uses login credentials and accepts user uploads, I find that PHP will be more enough for the task.

Don’t make the mistake of blindly following the trends in order to keep up with the Joneses. We all know what happens to those guys.'Well, well! It's the Joneses and their neighbors, who I see are still managing to keep up with them'

 

Good luck on your coding journey code newbies and check out mmtuts for great PHP tutorials.

Pomodoro Study Hack

tomato

What’s up code newbies. I wanted to share this awesome focus hack to use during your studies. The Pomodoro Technique is a study hack developed in the late 80’s by Francesco Cirillo during his time in university. For those of us who lack focus in this world filled with social media distractions I must admit this technique has been a game changer for me. To begin using this technique you should start with the recommended 25 minutes of focused study followed by a 5 minute break. As you begin to get better at focusing on the task at hand,(In my case Front End Development) you may find that the regular 25/5 split is too small. If you get to this point by all means increase the timer. Currently, Im following a 45/5 split with a 30 minute break after 4 pomodoros. Code newbies I highly recommend you give the technique a try by visiting Marinara timer. Marimara timer is a highly customizable online timer you can use during your studies or you can always buy a old fashion Tomato timer. Leave me a comment below if you found this study hack to be effective.

Back in Action!(FCC challenge Factorialize a Number)

Sorry for the hiatus. I’ve been away for so long. It’s been 10 months since I’ve coded and completed any FCC challenges. But I must say since I began to review the old material and go through old bonfire challenges I can tell you the knowledge and passion haven’t gone anywhere. Today I began going over the basic algorithm scripting challenges and I completed the “Reverse a string” challenge easy enough. Then the next challenge began which indeed was the “Factorialize a Number” bonfire. When I first began my coding journey May 24th 2016 I remember arriving at this challenge and have so many problems with…….. everything. But today I completely smoked this challenge.

To begin, I setup a simple if statement to satisfy the criteria that states a 1 must return if your number is 0.And that simply looks like this

function factorialize(num) {
if(num === 0){
return 1;
}

Next I made a variable that contains an empty array and setup a for loop that would deposit the number to be multiplied into that array.

 

var myArray = [];
for (var i = 1; i <= num; i++){
myArray.push(i);
}

Lastly all that was needed to be done was to use the reduce method in order to turn that array into my solution. 

var newFact = myArray.reduce(function(a,b){
return a * b;
});

return newFact;

}

 

I hope that helps someone if they’re stuck and if at you need any motivation to keep going. Be Good and Happy Coding!