/**
* Set a custom add to cart URL to redirect to
* @return string
*/
function custom_add_to_cart_redirect() {
return 'http://www.yourdomain.com/your-page/';
}
add_filter( 'woocommerce_add_to_cart_redirect', 'custom_add_to_cart_redirect' );
Compress-Archive -Path C:\Documents\* -CompressionLevel Optimal -DestinationPath C:\Archives\Documents.zip
This command:
Compresses all files in C:\Documents
Uses Optimal compression
Save the resulting archive in C:\Archives\Documents.zip
-DestinationPath will add .zipif not present.
-Li...
Compress-Archive -Path C:\Documents\* -Update -DestinationPath C:\Archives\Documents.zip
this will add or replace all files Documents.zip with the new ones from C:\Documents
Expand-Archive -Path C:\Archives\Documents.zip -DestinationPath C:\Documents
this will extract all files from Documents.zip into the folder C:\Documents
To work with Json using C#, it is need to use Newtonsoft (.net library). This library provides methods that allows the programmer serialize and deserialize objects and more.
There is a tutorial if you want to know details about its methods and usages.
If you use Visual Studio, go to Tools/Nuget P...
This getting started assumes you are working with create-react-app, or something equivalent using Babel and all the goodies out there.
Also check out the great documentation right here.
First, install react-router-dom:
npm install react-router-dom or yarn add react-router-dom.
Then, create a com...
Due to its computational goals, mathematical operations on arrays are straight forward in Fortran.
Addition and subtraction
Operations on arrays of the same shape and size are very similar to matrix algebra.
Instead of running through all the indices with loops, one can write addition (and subtra...
Basically to apply a theme for SearchView extracted as app:actionViewClass from the menu.xml, we need understand that it depends completely on the style applied to the underlying Toolbar. To achieve themeing the Toolbar apply the following steps.
Create a style in the styles.xml
<style name=&qu...
To get all the server variables run this query either in the SQL window of your preferred interface (PHPMyAdmin or other) or in the MySQL CLI interface
SHOW VARIABLES;
You can specify if you want the session variables or the global variables as follows:
Session variables:
SHOW SESSION VARIABLE...
A for loop iterate through items in an array
program ArrayLoop;
{$APPTYPE CONSOLE}
const a : array[1..3] of real = ( 1.1, 2.2, 3.3 );
var f : real;
begin
for f in a do
WriteLn( f );
end.
Output:
1,1
2,2
3,3
This is similar to Docker-machine or minikube which are used to learn Docker and Kubernetes. It will run a virtual machine containing everything you need to test openshift-origin.
Here is the documentation from openshift-origin and how to install it on any OS here
I'll write doc for Debian-lik...
F() expressions can be used to execute arithmetic operations (+, -, * etc.) among model fields, in order to define an algebraic lookup/connection between them.
Let model be:
class MyModel(models.Model):
int_1 = models.IntegerField()
int_2 = models.IntegerField()
Now lets assum...
As a workaround, you may use the wildfly-specific VFS api and write your own ResourceAcessor implementation, such as this one below.
public class WildflyVFSClassLoaderResourceAccessor extends AbstractResourceAccessor {
private ClassLoader classLoader;
public WildflyVFSClassLoaderResou...
As mentioned in another example a subset of the elements of an array, called an array section, may be referenced. From that example we may have
real x(10)
x(:) = 0.
x(2:6) = 1.
x(3:4) = [3., 5.]
Array sections may be more general than this, though. They may take the form of subscript trip...
In the new Angular framework, Components are the main building blocks that compose the user interface.
So one of the first steps that helps an AngularJS app to be migrated to the new Angular is to refactor it into a more component-oriented structure.
Components were also introduced in the old Angu...
You can get JCodec automatically with maven. For this just add below snippet to your pom.xml .
<dependency>
<groupId>org.jcodec</groupId>
<artifactId>jcodec-javase</artifactId>
<version>0.1.9</version>
</dependency>
A generalization of std::condition_variable, std::condition_variable_any works with any type of BasicLockable structure.
std::cv_status as a return status for a condition variable has two possible return codes:
std::cv_status::no_timeout: There was no timeout, condition variable was notified
st...
def read_data():
global m, n
m = 50
n = 1
train_X = np.array(
Internal data for the array
).astype('float32')
train_Y = np.array(
Internal data for the array
).astype('float32')
return train_X, train_Y
Laravel Scout - Laravel Scout provides a simple, driver-based solution for adding full-text search to your Eloquent models.
Laravel Passport - API authentication without a headache. Passport is an OAuth2 server that's ready in minutes.
Homestead - The official Laravel development environment. Po...