tronik.conf

coffee to code

Cars, Logan, GF

This weekend has been a busy one spent with good friends, hanging around the car scene, and watching Logan! Saturday for the most part was spent dwelling at home and getting much needed R&R. Sunday kicked off with a car meet, despite waking up to hail / snow the weather cleared up for a few hours. Most of my afternoon was spent exploring Seattle and playing with photography. Later that evening, I went to see Logan and man I’d highly recommend going to see it.

A Free Weekend

Today I have a open schedule, I am not entirely sure what to do today aside from play a little bit of Fallout 4 and sit down and thumb through my Javascript code. I may not head out to a coffee shop until later today when things wind down. As a previously mentioned, I’m not a fan of over populated coffee shops with wifi dwellers hunch over their Americano as they look over each others shoulders for the next available outlet. Yesterday I finished the Week 3 exam of Javascript Coursera, it’s actually a lot of fun.

New Hangout Spot

I just discovered that a local Starbucks is quite dead in the evenings. It kind of looks ravaged, like they were super busy this afternoon. It does seem insanely busy during the mornings and afternoons. According to Google Maps, their business at this location falls flat on its face after 4pm… This is great! Time to give them a reason to stay open until 10pm!

Notes On Migrating WP Multi Network Site To Single Installation

Just taking notes on how to migrate a site from a WP Multi Network instance and bring it into a single WP installation instance.

1.) Get The blog_id and site_id of target site. This can be obtained through wpblog
2.) Export the appropriate tables pertaining to the targeted WP Multi Network site. Include the Drop statement.
3.) Find and Replace the prefixes for the new installation, for example lets revert back to wp

4.) Editing your hosts file and redirect traffic from targetdomain.com to 127.0.0.1 - this will allow you to mock up the new installation and have it resolve. You might run into cookie issues, so be sure to run incognito only when your local LAMP/XAMP setup is setup. Personally, I use vhosts.
5.) Install WP on your localhost. Copy all the active plugins and the theme into the new localhost installation.
6.) Download all the files in the specific media directory in blogs.dir - retain the Mu blogs.dir file path.
7.) Import the exported sql file

There can be metadata that breaks with this, off the top of my head in wp_options file upload URL and various serialized data with paths might break. Theme options are one of these. I would recommend using Database Search And Replace Script in PHP by Interconnect/it. In most of my cases, I have to fix header, logo, and favicon paths. Depending on what theme you’re dealing with, this could be either simple or complex enough to run the script mentioned above.

UPDATE: I just realized, there is another adjustment that needs to be made in wp_options which is crucial. In wp_options, look for the option_name similar to wp_user_roles. If you have a different prefix on your Multi Network, this name needs to change. For example, if it’s called myblogprefix_user_roles - the user roles are broken upon signing in. Just quickly go in and change this to wp_user_roles

There’s obviously a lot of steps missing, these are merely notes.

Remember backup everything.

Gym Code Laundry?

I’m starting to take a liking to listening/watching to Coursera videos while at the gym, although it’s challenging when they start talk about specifics in code and I have to slow down, pick up my phone, and squint at the screen to read the code. I really wish I had a tablet with 4GLTE or a tablet connected to my phone’s hotspot. Wouldn’t that be nice?

Gym, Meal Prep, Code Execise

These evening I spent a good 60 minutes on cardio. After the gym decided I needed go head to the grocery store and pick up ingredients and tupperware to try out meal prep. I spent about 2 hours cooking meals for the week and realized it was getting very late. Luckily earlier today I spent time blogging and tinkering with WordPress. At the gym, I did watch a few videos on Coursera and caught a few videos from Simple Programmer.

I think I may just kick back and thumb through my Javascript book and save experimental coding for tomorrow morning. I’m really happy to be on a good path with Javascript!

Change Password Email Notification On WordPress

Below is an example on how to alter the password notification email that WordPress sends users when their password changes. This simply uses the password_change_email hook and passes the $new_message_txt to it.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
add_filter(
'password_change_email',
'wpse207879_change_password_mail_message',
10,
3
);
function wpse207879_change_password_mail_message(
$pass_change_mail,
$user,
$userdata
) {
$new_message_txt = __( 'Some text ###USERNAME### more text
even more text ###EMAIL### more text after more text
last bit of text ###SITENAME###' );
$pass_change_mail[ 'message' ] = $new_message_txt;
return $pass_change_mail;
}

I will likely just throw this into a Must Use plugin just so that the message is covered across the network.

Working On A Daily Routine

Lately I’ve been really trying to work on a daily routine, where I can really set higher standards for myself and make it the norm.

Obviously, my work takes up most of my time throughout the day. I try to keep on top of things with use of my Moleskin Weekly Notebook. I keep this book at my desk, specifically for day to day tasks that needs to be addressed and worked on. I fill it with todo’s and daily reminders.

Right now, I’m not using any fancy apps asides using Google Reminders or Kitchen Timer. Google Reminders are for quick and simple reminders. I specifically use Kitchen Timer to track time blocks shorter than an hour, like 15 - 30 minutes. Aside from those two Android apps, I also relay heavily on SimpleNote to keep notes stored on the cloud. All of those digital notes are accessible on any computer with internet and on my Android devices.

I feel like I’m going to start focusing on creating activity blocks throughout my day to focus on specific tasks, such as household tasks, maintenance, debugging, escalated tickets, documentation, etc.

Outside of work, I have a few things that I really want to keep on the daily routine. One of which is committing at least an hour at the gym. The gym mostly consists of cardio workouts, as I do love watching YouTube and Coursera on the elliptical and/or treadmill. Then there is weights, specific muscle groups, etc. And if the basketball court is free, practice my free throw and layups. With the weather as shitty as it has been, BMX and Skateboarding is out of the picture until it drys up and warms up at least above 40 degrees…

When I get back home from the gym, I have time for R&R. I may play a few matches of CSGO or put an hour or so into Fallout 4. I am trying to minimize my gaming right now and trade that off for focusing on this blog, git, and Javascript. I’ve mentioned it before, HTML, CSS, PHP, and MySQL is great and all… But one of my biggest draw backs, including UI, is not having good experience with Javascript and jQuery. I’m determined to keep experimenting with all of this to get a better understanding of the DOM.

This would be my regular Monday through Friday routine. I doubt I’ll have time to deal with urban exploration and photography… Seattle’s traffic is a nightmare at times, so traveling around the city can be a headache. My weekends are usually wide open for photography.

When I have time, I think I’ll make a list of bullet points of daily vs weekly items. I might include chores since I’ll be getting a new roommate soon.

Good Weekend

I had a great weekend, spent a good amount of time in Seattle. I got to spend quality time tinkering with git and hexo, setting up a local instance, etc. I also spent time brushing up on other Javascript related basics, specifically looking at DOM related features. I’m breezing through the basics just as an exercise.

Setting Up Laptop

It’s been a while since I’ve been out and about at a coffee shop. I realized that my local repository seemed to be borked. I went ahead and backed up my config.yml file and pulled the hexo source down. I’m hoping I don’t accidentally break things.

I ran into a few little issues with the .git and config.yml, but I think I have it fixed.