Let’s say you’ve made a login form and you want to display a placard whenever the login information is incorrect to alert the user. For example, when the user types an incorrect email address or password, they see the placard above the form, with a white background and red text: This is easy enough to … Continue reading jQuery: How to create an animated alert box
WordPress: How to create a local copy of a live site for development and testing
In this article, I will detail how to make a local “dev” copy of my live WordPress blog for the purpose of testing new styles, developing plugins and experimenting with new themes. My live WordPress blog is at http://bluegalaxy.info/codewalk. On my local Windows PC I have Bitnami WAMP stack installed, which includes an Apache2 server, … Continue reading WordPress: How to create a local copy of a live site for development and testing
Atom: How to enable minimap and file-icons extensions
This article describes a couple of useful plug-ins for the Atom code editor. In order to install the “minimap” and “file-icons” packages, you can follow the same package installation instructions that were used for the “data-atom” package found in this previous article: Atom: How to run MySQL queries in Atom using a package called Data Atom … Continue reading Atom: How to enable minimap and file-icons extensions
Python: How to use the logging module
Sending print statements to the console is very common in Python coding. It is simply a matter of using the key word print, followed by what you want printed to the screen. For example: # variables year = ‘2015’ xldate = 41000 pvid_list = [“19615056”, “15612770”, “15612771”] # print a raw string print “Print this … Continue reading Python: How to use the logging module
Windows Command Line: How to create a directory listing
This article details how to create a plain text directory listing on Windows, using the Windows command prompt. To open a Windows command prompt in Windows 10, simply type “cmd” in the Windows search bar. Once the Command Prompt is open, use the ‘cd’ command to change to the directory you want to get a … Continue reading Windows Command Line: How to create a directory listing
How to move WordPress to a new host
Once I got the new domain name bluegalaxy.info, I wanted to move my blog over to the new domain. It was previously hosted on my laptop with a local apache installation at: http://1uslchriston.ad.here.com:8080/blog On the new domain, I wanted to change the landing from “blog” to “codewalk”, and I also don’t need to use port … Continue reading How to move WordPress to a new host
React: A component render can return only one element!
A component render can return only one element, so if you want more complicated HTML output from your component’s render, it needs to be returned in a single div. In other words, every component can return only a single div. This applies to ReactDOM.render also. So if I want to render a Movie component three … Continue reading React: A component render can return only one element!
React: How to call a parent function from a child function and/or pass data to the parent function
In a continuation of the theme of how to pass information around in react, this article details how to call a parent function from a child function. This previous article details how to pass state from parent to child: React: How to pass state information from parent to child Allowing a child function to call … Continue reading React: How to call a parent function from a child function and/or pass data to the parent function
React: How to pass state information from parent to child
In a react script, to pass state information from a parent component to a child component, the state information needs to be passed as a prop. For example: numturns={this.state.number_of_turns} Now, “numturns” can be used as a prop in the child. For example, inside the child handleclick function: console.log(“Child communication, number of turns from parent: “, … Continue reading React: How to pass state information from parent to child
MySQL: How to run multiple queries in one
Let’s say we have a couple of simple SQL queries, one of which counts the total number of job hours: select sum(Hours) as totalCount from job_details where Job_ID = 42504; and another query that sums the total number of job hours that have been completed: select sum(Hours) as completedCount from job_details where Job_ID = 42504 … Continue reading MySQL: How to run multiple queries in one