Skip to content

Instantly share code, notes, and snippets.

@goncaloperes
goncaloperes / WooCommerce_Disable_Purschases
Last active April 9, 2019 17:47
WooCommerce Catalog mode - Disable all products from being purchasable
<?php
// Disable all products from being purchasable - Add this to your (child) theme functions.php file
add_filter( 'woocommerce_is_purchasable', '__return_false' );
@goncaloperes
goncaloperes / us-city.json
Last active January 24, 2019 21:52
1000 most popular cities of the USA, their growth from 2000 to 2013 and their population in 2013.
[
{
"city": "New York",
"growth_from_2000_to_2013": "4.8%",
"latitude": 40.7127837,
"longitude": -74.0059413,
"population": "8405837",
"rank": "1",
"state": "New York"
},
@goncaloperes
goncaloperes / Windows_Tools_Clean
Last active June 19, 2020 08:39
Windows Alternative for Clean Up Tools
1. Disk cleanup.
2. Open run then use the %TEMP% command and delete every file in there. Windows won't delete anything it needs
3. Open up run again but this time use the prefetch command and delete everything in this folder. Again, Windows won't delete anything it needs.
4. If there's memory issues (Windows telling you you're running out of memory when opening a lot of different apps), increase the virtual memory. For example, if you have 4GB of RAM, do 1024 x 4 so that would be 4096 then take that number and multiply by 2 and get 8192 so initial size would be 8192 and max size would be 91992.
5. Run msconfig, go to boot tab, then advanced options, check the number or processors box and then change the number to the number of processors you have. Also check the max memory box. Uncheck anything in startup you don't need as well.
@goncaloperes
goncaloperes / Automatic_Open_Browser
Last active April 9, 2019 17:45
Automate Opening Browser Tabs with Windows Batch Files (.bat)
#Example:
start "Firefox" "C:\Program Files (x86)\Mozilla Firefox\firefox.exe" https://www.goncaloperes.com https://career.goncaloperes.com https://contexper.pt
@goncaloperes
goncaloperes / Common_htaccess
Last active April 9, 2019 17:46
Common .htaccess
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@goncaloperes
goncaloperes / Automatic_Backup_Data
Last active April 9, 2019 17:44
Windows Batch File (.bat) to run on specific periods of the day in order to backup data.
@echo off
robocopy "FROM_LOCATION" "TO_LOCATION" /mir /R:0 /W:0
@goncaloperes
goncaloperes / Update_PHPMyAdmin.md
Last active November 8, 2018 10:09
Update PHPMyAdmin (XAMPP)

1. Find your phpMyAdmin Version

Access your phpMyAdmin interface and scroll to the bottom to check if you are using the updated version.

2. Download the Newest phpMyAdmin Version

Access phpMyAdmin Official Website and download the most recent version.

3. Find your phpMyAdmin Directory