Using Git with WordPress

As part of my continued efforts to not lose all of my hard work, I’m implementing tools to help me track changes and have decided to use version control to do it. I’ve chosen to use Git because of my relative familiarity with the tool.

For a bit of background, my web server is running Ubuntu 16.04.3 LTS and the latest version of WordPress at the time of this writing, version 4.9.4. Because GitLab allows for free private repositories and the nature of the project makes a public repository undesirable, it was chosen over GitHub. One thing to note about this setup is that I have full shell access to the server, allowing me to install programs and edit properties as necessary to get things setup. When the website is eventually migrated to its permanent hosting location, some changes may be necessary to the following setup to accommodate the server implementation. Many shared hosting providers do not allow shell access, and a new strategy would need to be considered in this case.

I started the setup by performing a bit of housekeeping with

sudo apt-get update

and then performed the initial Git installation with

sudo apt-get install git

I then performed the usual Git setup, uploading my SSH user’s key to GitLab and setting my username/email with

git config –global user.name “Your Name”

git config –global user.email “youremail@domain.com“

After cd’ing to the directory of the website files, I issued the command

git remote add origin git@gitlab.com:MassHOSA/masshosa-website.git

An important step here is to make sure that no sensitive files are tracked by Git. I did this by adding a .gitignore with the following:

#————————

#  Main ignored items

#————————

/../wp-config.php

/wp-config.php

.maintenance

versionpress.maintenance

/.htaccess

/web.config

/wp-content/*

!/wp-content/db.php

!/wp-content/index.php

!/wp-content/plugins/

/wp-content/plugins/versionpress/

!/wp-content/mu-plugins/

!/wp-content/themes/

!/wp-content/languages/

!/wp-content/uploads/

!/wp-content/vpdb/

#————————

#  Log files

#————————

*.log

error_log

access_log

#————————

#  OS Files

#————————

.DS_Store

.DS_Store?

._*

.Spotlight-V100

.Trashes

ehthumbs.db

*[Tt]humbs.db

*.Trashes

at this point it was safe to issue a

git add .

and commit with

git commit -m “Initial commit”

and finally push changes with

git push –set-upstream origin master

And that’s all there was to it. I’m now tracking all of the changes that I’m making to theme and plugin files. These are the only files that I really care about reverting and recovering changes that I’ve made. Everything else is backed up regularly using Updraft.

From the blog CS@Worcester – ~/GeorgeMatthew/etc by gmatthew and used with permission of the author. All other rights reserved by the author.

Using Git with WordPress

As part of my continued efforts to not lose all of my hard work, I’m implementing tools to help me track changes and have decided to use version control to do it. I’ve chosen to use Git because of my relative familiarity with the tool.

For a bit of background, my web server is running Ubuntu 16.04.3 LTS and the latest version of WordPress at the time of this writing, version 4.9.4. Because GitLab allows for free private repositories and the nature of the project makes a public repository undesirable, it was chosen over GitHub. One thing to note about this setup is that I have full shell access to the server, allowing me to install programs and edit properties as necessary to get things setup. When the website is eventually migrated to its permanent hosting location, some changes may be necessary to the following setup to accommodate the server implementation. Many shared hosting providers do not allow shell access, and a new strategy would need to be considered in this case.

I started the setup by performing a bit of housekeeping with

sudo apt-get update

and then performed the initial Git installation with

sudo apt-get install git

I then performed the usual Git setup, uploading my SSH user’s key to GitLab and setting my username/email with

git config –global user.name “Your Name”

git config –global user.email “youremail@domain.com“

After cd’ing to the directory of the website files, I issued the command

git remote add origin git@gitlab.com:MassHOSA/masshosa-website.git

An important step here is to make sure that no sensitive files are tracked by Git. I did this by adding a .gitignore with the following:

#————————

#  Main ignored items

#————————

/../wp-config.php

/wp-config.php

.maintenance

versionpress.maintenance

/.htaccess

/web.config

/wp-content/*

!/wp-content/db.php

!/wp-content/index.php

!/wp-content/plugins/

/wp-content/plugins/versionpress/

!/wp-content/mu-plugins/

!/wp-content/themes/

!/wp-content/languages/

!/wp-content/uploads/

!/wp-content/vpdb/

#————————

#  Log files

#————————

*.log

error_log

access_log

#————————

#  OS Files

#————————

.DS_Store

.DS_Store?

._*

.Spotlight-V100

.Trashes

ehthumbs.db

*[Tt]humbs.db

*.Trashes

at this point it was safe to issue a

git add .

and commit with

git commit -m “Initial commit”

and finally push changes with

git push –set-upstream origin master

And that’s all there was to it. I’m now tracking all of the changes that I’m making to theme and plugin files. These are the only files that I really care about reverting and recovering changes that I’ve made. Everything else is backed up regularly using Updraft.

From the blog CS@Worcester – ~/GeorgeMatthew/etc by gmatthew and used with permission of the author. All other rights reserved by the author.

Post # 25 – Reflection on the “Your First Language” Pattern

This week, I will be writing a reflection on the “Your First Language” pattern.  This pattern addresses those are seeking a job in software development but obtaining said job requires a proficiency in a specific language and/or developers who feel comfortable in one or two languages but are expected to maintain the same standard of quality as their teammates/coworkers.  I chose to reflect on this pattern because I am currently trying to obtain a software development internship and most, if not all, of them require proficiency in at least one or two languages.  I do feel as though I am proficient in Java and C, but I am unsure how my skills compare to those that I might work with in one of the internships I am applying for.  I found this pattern particularly helpful in my current situation.

To deal with this problem, Oshineye and Hoover recommend picking one language and becoming a master of it.  They advise developers to spend a few years solving problems in a single language while honing their abilities.  I found this to be useful because I have had the idea, for the past few years, that employers would look for a diverse skillset in novice developers, but Oshineye and Hoover believe that being a master of one language is more useful than being sufficient in many.

To help improve your experience while learning your first language, Oshineye and Hoover believe that it is incredibly helpful to have an actual problem to solve.  I was at this point last year, which is when I decided to join a website that offers free coding challenges that deal with both real world issues and the type of work you might do in school like programming functions in a specific data structure.  They go on to suggest that, in addition to spending a lot of your own time practicing a language, novice developers should find also experienced mentors to aid in their learning.

Oshineye and Hoover conclude the pattern by describing ways to create short feedback loops and use testing frameworks so that novice software developers can easily track their progress as they learn a language.  This pattern has inspired me to ‘master’ a language, find a mentor, and begin creating feedback loops (such as testing) to track my progress.  I think all of these things will give me a sturdier foundation when I enter the field.

From the blog CS@Worcester – by Ryan Marcelonis and used with permission of the author. All other rights reserved by the author.

Apprenticeship Patterns – Unleash Your Enthusiasm

Summary

My Reaction

From the blog Rick W Phillips - CS@Worcester by rickwphillips and used with permission of the author. All other rights reserved by the author.

Apprenticeship Patterns – Sweep the Floor

The Sweep the Floor pattern in Apprenticeship Patterns: Guidance for the Aspiring Software Craftsman[AP] by Dave Hoover and Adewale Oshineye discusses some of the obstacles a person may face when joining a new team. Joining a new team is challenge for everyone, no matter their skill level or amount of experience [AP]. The team your are joining has to feel you out and you have to feel out the new team to get an idea of where you place is within it [AP]. This can be a daunting task, especially if you have never done it before.

The pattern suggests to try and take on simpler tasks to start such as code review or product support [AP]. The team is more apt to let you take on these tasks not only because their time could probably be better spent elsewhere, but also because the simple tasks inherently have less risk involved [AP]. Chances are it isn’t the end of the world if it isn’t completed in time and if it does have to be completed by a certain time they know that it is easy enough for them to pick up and finish. The other suggestion the pattern has is to take on the “dirty work” [AP]. This could be something like updating documentation (what developer wants to spend time of documentation?) or maintaining a development environment [AP]. Chances are you’ll earn some brownie points for taking on tasks like this as well.

I can personally attest to this. When I first started my internship I did a lot of documentation work. It was one of the few things at the time I felt comfortable doing because I knew it wasn’t the end of the world if it was done incorrectly or not completed on time. This helped me a lot because by writing documentation I got to know the project I was working on well. Gradually I was given more complex and critical tasks. Almost two years later I am comfortable with grabbing just about any task off the board.

One thing you have to be careful of is becoming the teams “gopher” as the book puts in it [AP]. In other words, you don’t want to get stuck doing these tasks all of the time simply because the team knows you can do them and/or assumes you like to do them. You have to be willing to push your boundaries a bit to assure this doesn’t happen [AP].

 

Link to pattern in book: https://www.safaribooksonline.com/library/view/apprenticeship-patterns/9780596806842/ch04s05.html

 

From the blog CS@Worcester – README by Matthew Foley and used with permission of the author. All other rights reserved by the author.

Thoughts on “Find Mentors” apprenticeship pattern

The problem addressed by this pattern is one that should be familiar to most: needing guidance in unfamiliar ground.  The authors propose that you find a “master craftsperson” to guide you, but recognize a flaw: it is difficult to find true masters in a craft that is still fairly young, and in which the tools evolve very quickly.  Most of all, they emphasize the importance of getting over the anxiety of reaching out, because the upside of success is so high.

This resonates with me and with my experiences.  I find that I am very successful when I have found a mentor of whom I can ask questions and bounce ideas without fear of ridicule or rejection.  Even if my mentor doesn’t respond right away or have the answer, the act of formulating my thoughts enough to send them as a question to someone else can help me find what I’m looking for.

The authors also recommend taking on a mentor role when you have the opportunity.  This is also something that I’ve found helps me learn.  It may be common wisdom at this point, but I’ve found that I don’t know how much I know (or what critical knowledge I lack) until I go to teach it to someone else.  My family members often find themselves in the (hopefully patient) position of listening to me test my knowledge by explaining things to them — doing that by teaching someone that is really invested  in learning the topic is even better!

I can also connect with the anxiety of reaching out, especially to someone with whom I do not have a previous connection.  No matter how beneficial the outcome may be, and no matter what my past experiences have been (overwhelmingly positive) I tend to have trouble taking that first step of making a connection.  In my life in general, the anxiety of reaching out to other people for help is one of the largest obstacles I struggle with and one of the most important for me to work on.

Like with many of the other patterns, I find that this one did not necessarily teach me anything truly novel.  However, it validates what I thought I knew and backed that up, which is just as important.

From the blog CS@Worcester – orscsblog by orscsblog and used with permission of the author. All other rights reserved by the author.

Find Mentors

It seems fitting to discuss the Find Mentors apprenticeship pattern this week. I recently finished up a successful refactoring of the AMPATH online-tracker. My pull request was accepted by their development team, and is officially part of the ng2-amrs repository. I am adamant the end result was possible only after receiving the help from a mentor of sorts. I consider Felix from AMPATH a mentor in the sense that he helped clarify many questions I had concerning the online-tracker refactoring, the overall project, and Angular in general. One of the objectives when applying the Find Mentors pattern is to seek someone with knowledge in an area of interest that far exceeds your own. Since Felix’s knowledge of the AMPATH application is leaps and bounds ahead of mine, I think I’ve made a considerable effort to begin applying this pattern.

I have come to the realization I am going to need mentors to gain any sort of momentum in my professional career. My greatest struggles that have been preventing me from reaching out to mentors are intimidation and fear of rejection. But as those describing this pattern point out, the potential payoffs reaching out to mentors far outweigh the risks.

I need to remind myself that the vast majority of open-source communities are very knowledgeable and friendly people, more than willing to help others. I can cite the AMPATH development community as an example here. When I first learned that we would be working with on an actual open-source project with seasoned developers, sure it was intimidating to say the least. It took a little while for me to gain the courage to ask for help from them. But honestly, it was certainly worth it. Not only did I get a pull request accepted, we now have a online tracker service to work with for our offline module implementation. I also gained a whole lot of priceless knowledge concerning the functionality of the overall project.

One of the suggested actions given by those describing the Find Mentors pattern is to actively observe open-source communities. The intention is to, over time, find one or more communities that seem especially helpful and inviting to newcomers. The aspiring apprentice should then reach out to potential mentors from those communities. After I graduate, I plan on finding such a mentor to help me get through the whole job interviewing process. I know I am going to need a lot of help and support for this.

 

From the blog CS@Worcester – Jason Knowles by Jason Knowles and used with permission of the author. All other rights reserved by the author.

CS@Worcester – Fun in Function 2018-03-26 10:38:43

“Practice, Practice, Practice” is a pattern which encourages exactly what you’d expect: continuous practice. Like Breakable Toys, the problem this pattern is intended to address is that failure in your professional responsibilities is too costly to risk. You can’t effectively learn without the freedom to fail, though, and for that reason you need somewhere safe to practice.

This is another pattern in which the writers say the ideal application of it would be in a world with formal software apprenticeship, but in reality, software apprentices have to create an approximation for themselves. In their ideal world, a mentor would assign their apprentice practice based on the apprentice’s strength and weaknesses, reinforcing what the apprentice does well and correcting their weaknesses. The writers emphasize the need for objective metrics to evaluate your abilities as a substitute for this; if you practice without getting feedback, you will reinforce bad habits.

One way of making sure you receive regular feedback is to practice in a way that’s public to some degree. The example they give is a group that meets in person to perform code katas, exercises which are meant to help programmers to sharpen their skills through repetition. For some apprentices, an activity like this probably isn’t practical or immediately accessible. Online communities devoted to practice are another option which can likely serve as a good source of feedback. Importantly, any method of getting feedback on your practice should take place in a relaxed and playful setting, since the point is to remove the stress of mandatory success. The practice itself should be something just beyond what you know you can do easily. In having to struggle with a problem, the practice will strengthen your abilities in addition to providing the benefits of repetition.

This is a pattern that appeals to me, because I’ve discovered that I learn the most by actually writing code. To that end, the writers suggest some older books that teach important programming techniques and design principles through fun problems. This seems like a useful, concrete recommendation, and I might look into obtaining one of their suggested books or find one of my own to improve my coding skills.

From the blog CS@Worcester – Fun in Function by funinfunction and used with permission of the author. All other rights reserved by the author.

Unleash Your Enthusiasm

This section of the chapter is very relatable because when I first got into computer science most of my friends and family were not very impresses or helpful with my interest in it because most of them were in business or the medical field. so just as it says in the section i had to nourish my curiosity of computer science by reading up on things myself and I was just getting the bare minimum of CS. Luckily I had one cousin who was already in computer science and he told me about these competitions called Hackathons that were programming competitions that people did for computer science that you can win prizes and learn about programming and making connections. At first I turned him down many times because in my head I thought that those Hackathons were for people who has experience programming and at least has one or two years of knowledge under their belt. However, I was very wrong when I finally went I meet many people who never programmed in their lives. This was the start of my fascination of computer science. When I first started all I did was give out ideas and suggestions of what the product, website, or program should do. I talked to many different companies such as google, dell, hp, twillio, and ect. They all told me about their own path in their computer science careers. From there I started to want to learn more and more programming and wanted to write my own stuff just for fun and learn how things work.

To me this chapter has a deeper meaning such that we all do need to unleash our enthusiasm. This doesn’t just mean computer science it can mean anything and everything. Once we find a group of people that share common interest and ideas as what we want to do. This will stoke the fire within us to want to learn more, do more, and get out there. Once we get that push we can encourage each other to do what we love and besides just flying under the radar we can be out there learning, helping, and teaching others about our own passion.

From the blog CS@Worcester – The Road of CS by Henry_Tang_blog and used with permission of the author. All other rights reserved by the author.

The Long Road

Problem

You aspire to become a master software craftsman, yet your aspiration conflicts with what people expect from you. Conventional wisdom tells you to take the highest-paying job and the first promotion you can get your hands on, to stop programming and get onto more important work rather than slowly building up your skills.

Solution

The solution the text offers is to first accept that what you want to become might be strange to others, and second to always think in the long term. Value learning and long term growth opportunities over salary and traditional notions of leadership. By focusing on your long term development, you are enriching yourself with a set of skills that aide learning, problem solving, and developing strong relationships with your customers. Keep in mind the length of your journey, if you have 20 years of work ahead of you, you have plenty of time to master your skills. The text mentions that this pattern is not for someone who wants to become CIOs or product managers, or filthy rich. Thankfully the software development field is constantly changing and new opportunities are always available.

I think this pattern is a good grounding for anyone who may be a little too ambitious, and may take promotions without understanding how this may affect the Long Road. Unfortunately, sometimes taking a promotion means a break from learning, and while you may be making better money, you may be setting yourself up for failure down the road, or at least you want have the same skills and knowledge you would if you continuously worked on being a software craftsman.  I do think it’s important to always consider the Long Road, where you are in your career and what kind of job you want. I think this pattern is subtlety saying that taking jobs as mangers or corporate executives may not be as rewarding as working on their craft their entire career. This pattern is a good reminder to me to keep the long road in the back of my mind and focus on always putting myself in a position where I can learn new things and hopefully avoid burn out.

The post The Long Road appeared first on code friendly.

From the blog CS@Worcester – code friendly by erik and used with permission of the author. All other rights reserved by the author.