Dev.Lopez | Software developer | Welcome to my personal web page. You can find articles about software development and programming tips. More stuff soon.

How to only use the Bootstrap grid system and the default screen sizes

As many people I have used many times Bootstrap to do scaffolding (css) in my web projects, thus, Bootstrap is a also a good choice to convert an old site to a responsive site (necessary in these times with so many devices in the market). Someone might say that when is used Bootstrap, the website takes a very common style used today, losing originality and personality. Well, that’s true, but you can take Bootstrap only […]

How to take a screenshot with selenium

When we are working with Selenium framework it’s possible that we need to take a screenshot of the webpage loaded by the selenium webdriver. This is easy to do, you only need to cast the driver to “TakesScreenShot” class and call “getScreenshotAs”. Look the snippet and use it at your convenience: 1234WebDriver driver = new FirefoxDriver(); // or other driver.get("http://www.yahoo.com/"); File scrFile = ((TakesScreenshot)driver).getScreenshotAs(OutputType.FILE); FileUtils.copyFile(scrFile, new File("my_screenshot.png"));

Change the order id of orders using MYSQL on Prestashop 1.5

When we are migrating a prestashop installation that is in production, it is possible that the new installation has got a old version of database and that several orders are missing. The reason of this is because we are working with a dump catched in the time X but the shop in production is still working, thus the shop is still receiving new orders and new customers that there are not in our production database […]

Import large mysql dump files using shared hosting

When we are working on a shared hosting, normaly we only have got one tools to manage our database, the well-known phpmyadmin. When it comes to managing databases on a shared hosting, there is one tool that stands out - phpMyAdmin.

This widely used web interface provides database management capabilities to users of all skill levels. But what if you're new to phpMyAdmin and need some assistance to make the most out of it? This is where workday training can come in handy.
Workday training is a learning program that teaches users how to effectively use phpMyAdmin in their workday routine. This program is designed to cater to the needs of both beginner and advanced users, making it the perfect resource for those who want to improve their skills in database management.

The great tool has got a limitation when we are working with large database files. If we were working with a virtual personal server, we’d only need to connect via shell an follow these steps: Connect to our mysql server mysql -u [USERNAME] -p Use our objective database and import the dump file […]

How to remove the admin bar for logged users in WordPress?

If you have a wordpress web page with registered users, you can see that the admin bar on top is shown where the users are logged. This issue could broke the design of you web page or give access to zones that you want keep hidde. To remove this bar you can add this code to you functions.php file, this code removes the admin bar for all users except the adminitrator. 1234567add_action(‘after_setup_theme’, ‘hide_admin_bar’); function hide_admin_bar() […]

How to extract emails from a webpage in PHP?

Sometimes we need to extract the emails contained in a piece of text or html document. Here you can find a simple script that extracts unique emails from a webpage. 123456789101112131415161718192021222324<?         function get_emails_from_webpage($url)     {       $text=file_get_contents($url);       $res = preg_match_all("/[a-z0-9]+[_a-z0-9\.-]*[a-z0-9]+@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})/i",$text,$matches);       if ($res) {           return array_unique($matches[0]);       }       else{         […]

How to get child theme template directory?

Normally when we use child themes we need to get the child theme directory o the child theme template url. In our first attemp, we use this: 123get_template_directory_uri(); // Both returns parent theme url bloginfo(’template_url’);; get_template_directory(); // Returns parent theme path We need to use this: 1get_stylesheet_directory_uri; Hope it helps!

How to use pods fields in existing forms of thirdparty themes

When a developer is using wordpress with pods in a existing theme that comes with exising forms, there is a work to do if he wants to integrate extended fields into those forms. For example if a theme comes with a registration form and there are several extended fields for the user. In this case we need to add inside the form the new fields, and this can be a “pain”, because with form methods […]

How to fix “Unresolved assembly reference not allowed: System.Web.Mvc” with ILMerge

You can find this problem while you are merging your project using ILMerge and you can see that System.Web.Mvc is not in your Visual Studio installation. This dependency belongs to ASP.NET MVC 3, a Microsoft’s framework used for building web applications. Normally these dependencies and others of this framework are not included on Visual Studio installation. In my experience, they are not included in Visual Studio 2013 Express. You need only download this framework from http://www.asp.net/mvc/mvc3 (direct link […]