Asides
Utility CSS Stylesheet finding duplicate selectors and declaration differences
Utility CSS Stylesheet finding duplicate selectors and declaration differences
Occasionally we run into a style sheet which has not been managed well and has duplicate style block and style definitions.
When this happens it can be difficult to evaluate which style blocks are duplicated, and which ones are still in use.
CSS Validators do not do a good enough job at identifying the duplicates and allowing me to make decisions on how to merge discrepancies.
So we came up with a utility that helps us to evaluate the duplicate selectors. The utility is here:
To use it we can simply paste in a giant style sheet block, or type in the url of the css and it will download it. Downloading it can be useful as you fix your style sheet and want to know how it looks.
The output of the utility is an ordered list of all of the selectors, in the case where there are duplicate selectors, the duplicated attributes are highlighted, if the value in the attribute is duplicated that shows red, if it is unique, it shows blue.
http://www.webuildplugins.com/css-stylesheet-evaluator/
The utility does not attempt to resolve the issues, it simply highlights the duplicates to potentially help you identify the issues.
The utility does not attempt to recognize which classes may override each other.
Future enhancements to this tool may include
- the ability to download multiple style sheets – to help identify styles that may clobber eachother.
- the ability to paste in an html block or url which then extricates the css style blocks and linked style sheets to help identify clobbering or duplicated selectors
- a utility which combines unique attributes from multiple duplicated selectors and gives a copyable text block with the combined text.
In addition to the need we have while building websites or taking over other customer sites, this too highlights our ability to build custom plugin utilities within WordPress. We also sell this WordPress plugin to customers that may need it.
Utility – Bulk Convert the Unix Timestamp in log messages To a Readable Date
Utility – Bulk Convert the Unix Timestamp in log messages To a Readable Date
I have often run into the need to convert a large list of timestamps from Unix Timestamp to a readable date.
Often times this is simply a need that I have when receiving an error message from a server, or when reviewing log files which only use Unix Timestamps.
So I created a simple utility, just paste in your text from the log file, the utility will search out the string for timestamps listed as the first part of each line, and convert the timestamp to a date.
While this might be useful at some point as an automated process, for now I just use it when I need it.
I am documenting the tool here with a link for myself (or any one else that may need it) so that it is simple to find.
http://matraex.com/batch-timestamp-to-date.php
Possible future upgrades to this utility will likely search out Unix Timestamps anywhere in the text and convert them, instead of just at the first of the line.
9th Annual Matraex River Trip – Photos
9th Annual Matraex River Trip – Photos
On the 25th of July the Matraex crew all headed back to Cascade Raft and Kayak for this years River Trip.
Mac, Jeff, Jeremy, Parker and Vlade all rode the rafts, Michael showed up but wimped claiming ACL surgery recovery. Most of the team had been on a previous river trip, but this was Parker’s first time.
Every one had a good time and there were lots of pictures. Most of the team wore the T-Shirts which Jeremy designed last month (Jeremy one the T-Shirt design contest and got two extra shirts out of it)
Some Smiles and Action as the Matraex team faces challenges
9th Annual Matraex River Trip – Google Photo Album
Michael Photobombing
When building an alexa skill – some gotchas with understanding workds
When building an alexa skill – some gotchas with understanding workds
When building an alexa skill there are some gotchas with Alexa understanding some words
- Words with repeated consonants seem to have a problem, such as papaya.
- Be sure to instruct the speaker to speak strong an clear
- Slow speakers may get cut off before they finish there phrase, instruct speakers to speak fast to make sure Alexa does not cut them off.
ColdFusion: SQL Server – Cannot use empty object or column names. Use a single space if necessary
ColdFusion: SQL Server – Cannot use empty object or column names. Use a single space if necessary
When upgrading from an OLD version of Coldfusion to a newer one. We would occassionally receive the message
Cannot use empty object or column names. Use a single space if necessary
This message seemed as though it came from an error sent back from the database but the database version did not change at all.
However CF changed their version of SQL Server driver as the progressed and made it more compliant. Basically they made it so that you could no longer use double quotes (“”) in order to enclose an empty string.
So the SQL query that may have worked before
select * from myusers where username <> “”
would need to become
select * from myusers where username <> ”
proftpd stops running – once a week when logrotate.d runs
proftpd stops running – once a week when logrotate.d runs
On Sunday mornings at 6:30AM I receive this log entry at the bottom of my /var/log/proftpd/proftpd.log file and proftpd stops running
2015-07-05 06:28:24,870 servera proftpd[31258] 127.0.1.1: ProFTPD killed (signal 15) 2015-07-05 06:28:24,871 servera proftpd[31258] 127.0.1.1: ProFTPD 1.3.5rc3 standalone mode SHUTDOWN
The time (about 6:30AM) on sunday leads me to know from experience that is when the log files rotate if they are set to rotate weekly using logrotate.
So I go in search of the logrotate commands for proftpd with grep and find the following file
#grep proftpd -l /etc/logrotate.d/*
/etc/logrotate.d/proftpd-basic
Inside of /etc/logrotate.d/proftpd-basic file, there is a command which restarts proftpd after the logs files are rotated
postrotate
# reload could be not sufficient for all logs, a restart is safer
invoke-rc.d proftpd restart 2>/dev/null >/dev/null || true
When I run this at the CLI, I find that every other time I run the command, proftpd does not start! This seems to me to be a timing issue, so I simply but a sleep command between the stop and start commands in the restart script
/etc/init.d/proftpd force-reload|restart) if [ "x$RUN" = "xyes" ] ; then signal stop 1 sleep 1 #ADDED BY Michael Blood to avoid a timing issue that would not allow the start if the stop did not complete. start
This appears to fix the problem perfectly.
9th annual Matraex River Trip – Tshirt Design Contest Winner
9th annual Matraex River Trip – Tshirt Design Contest Winner
3 Designs were entered into the 9th annual Matraex River Trip – Tshirt Design Contest by Matraex employees. The designs were printed out and everyone voted by SurveyMonkey.
The winner was….. Jeremy Trull with this design.
Jeremy wins bragging rights and two additional T-Shirts.
We are now orderings shirt so they show up in time for the River Trip scheduled for the 25th of July.
How Do You Monetize A Blog
How do you monetize a blog? There are a few key items needed to monetize a blog. Do you have them? Here is a list:
- Internet traffic
Short list eh? Well in the amazing Internet-age, you can sell traffic! However, traffic is cheap and better used for alternative revenue streams such as:
- Product sales
- Advertising
- Donations
- Affiliate sales
- Upsales
- Email list generation
- Lead generation
Typically, PPC sales sell your traffic for pennies per click. Unless you are in a highly competitive keyword realm, it will be pennies. Is this worth it? If you’re selling a widget, wouldn’t it be a bigger return to sell the widget or obtain the visitor’s contact information for future opportunities at sales?
For example, if I was selling a widget for $20 and say one in 2000 visitors make a purchase it could be said that each visitor is potentially worth a dollar. However, the visitor is worth more than that. He or she could be a source of brand development.
How do you monetize a blogInstead of selling that visitor for say $0.05 to a PPC, the better value is in presenting your widget brand in a positive manner. This way, that visitor may not buy today but perhaps in the future or the brand awareness can help your word-of-mouth sales. This is the power of social media marketing as well. Brand awareness. ok I’m getting off track.
How do you monetize your blog? Develop your traffic funnel. Is your upsale on every landing page? Is your widget “buy now” link or button easy to find? How about your logo? Do you have a brand?
If you have ANY traffic, you should be analyzing it. Use Google Analytics, AWStats, Webalizer etc. What are your visitors doing? Do they land then bounce or click a link or two? How long are they on your website? Lost opportunities are wasted opportunities.
This all being said, don’t go and overload your site with advertisements and popups, driving your customers away. There is a balance and you must find it. Create case studies, experiment with different ideas/methods then use what works! Good luck out there!
Configure Google Analytics Conversions Track Events Contact Form 7
How To Configure Google Analytics Conversions Track Events Contact Form 7
Tracking conversions in Google Analytics using Contact Form 7 requires setup on Google Analytics Conversion Goals control and in the Contact Form 7 contact form Additional Settings.
The Additional Settings tab requires you to customize your button event to send Google Analytics the expected values.
This setup was quite a challenge for me to overcome because their were several factors preventing success that I had to work through. Apparently, this is a common need for many WordPress administrators but an even more common problem getting to work. I will explain in three steps:
- Obtaining your Google Analytics tracking code
- Preparing your Google Analytics account to track incoming data
- Configuring your Contact Form 7 “send” button to send Google Analytics the data
- Testing/Verification
Step 1:
Google has a javascript function for you to send the data. This is probably already on your site for general statistics tracking. Open an Incognito Window, open your website, then right click your page and View Page Source, then perform a Find or Search for “analytics” and you should jump to the javascript code. If you found it, then you can go to the next step, otherwise check out this article for adding the GA code.
Step 2:
In your Google Analytics account, click Admin, Goals, +New Goal. Now Custom, enter a name for the Goal, Event for type,
- Category (Equals to) “contact form”
- Action (Equals to) “submission”
- Label (Equals to) “my contact form”
- Create Goal to save
Step 3:
Edit your contact form, click the Additional Settings tab, and add this code:
on_sent_ok: "__gaTracker('send', 'event', 'contact form', 'submission', 'my contact form');"
Now here is where many admins seem to be having trouble and I did as well. The issue is determining what your Google Analytics function is then making sure it is used here. In this case, __gaTracker is the function.
You will find your function back in Step 1. Perform your View Page Source search again for “analytics” this time at the end of the javascript look for the function name. Common names I’ve seen are “ga”, “__gaTracker”, “gaq.push”, and “gaq”. Just replace __gaTracker with the function name you happen to have.
gaq.push is a little different:
on_sent_ok: "_gaq.push(['_trackEvent', 'contact form', 'submission', 'my contact form']);"
Testing/Verification:
In Google Analytics, at the top, click Reporting, expand Real Time, and click Conversions. This interface is displaying real-time data that GA is receiving from your website. So in another window, goto your Contact Form, fill it out, and hit send. Switch back to your GA, Real Time tab and you should see a hit!
If you see a hit then you’ve properly configured your form! Congrats! If not, please re-read the steps to verify you did everything and check that you didn’t overwrite a ( or ‘ in the button tracker code.
Many WordPress administrators have the need to track Contact Form 7 conversion data in Google Analytics. Configuring the button code to use the proper javascript function is vital.
Tips: When I was working through my troubleshooting, I eventually took the Contact Form 7 out of the formula by making a simple html page that had two things: 1. The GA javascript in the <head> and 2. a hyperlink with the GA tracking code. Here is an example:
<html> <head> <script type="text/javascript"> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','__gaTracker'); __gaTracker('create', 'UA-34343434-34', 'auto'); __gaTracker('set', 'forceSSL', true); __gaTracker('require', 'displayfeatures'); __gaTracker('require', 'linkid', 'linkid.js'); __gaTracker('send','pageview'); </script> </head> <body> <a href="/c.html" target="_blank" onClick="__gaTracker('send', 'event', 'contact form', 'submission', 'my contact form');">Test</a> </body> </html>
The idea is to have a test link that I could use to verify that my tracking code and function were even working because I had the suspicion (I was correct) that the Contact Form 7 code needed tweaking. If you use this example, you MUST change the UA-343434′ line with your Tracker ID, check your View Source for this or you can find it in Google Analytics, Admin, Tracking Info, Tracking Code.
Finally, you should be aware that it takes a day or two for GA to start displaying your conversions in the normal area where you can run reports and analysis (not the Real-Time area).
Thanks for reading How To Configure Google Analytics Conversions Track Events Contact Form 7