Tutorial by Examples

You can use conditional operators in WordPress to enqueue scripts on specific pages of your Website. function load_script_for_single_post(){ if(is_single()){ wp_enqueue_script( 'some', get_template_directory_uri().'/js/some.js', array...
Since vim version 7.3 the feature 'persistent_undo' is supported, which makes it possible do undo/redo changes, even after closing vim or restarting your computer. It's possible to configure it by adding the following to your vimrc, but first create a directory, where your undofiles should be saved...
Here's an example on how to use ACF to output differently based on options (color selections in this case). While you can use <?php echo get_field('color_options'); ?> to output the value directly, you can also change the markup depending on the selection. <?php $option = get_field('color_...
Jquery selectors are used to manipulate DOM (Document object model), attach events, add element, remove element on runtime. SelectorDescriptionelement selectorelement selector are used to select particular element Ex: <p>Stackoverflow to help in understanding errors </p> To access this ...
data table; set table; label variable1 = 'label1' variable2 = 'label2' variable3 = 'label3'; run;
Custom formats, also known as user defined formats, can be created and used like any other default formats. /*Create new character format for state variables*/ PROC FORMAT; VALUE $statef 'CA' = 'California' 'MA' = 'Massachusetts' 'NY' = 'New York'; ...
/app/services/greeting.service.ts : import { Injectable } from '@angular/core'; import {greetingTypes,request,response} from './greeting.interface' @Injectable() export class Greeting{ private worker; constructor(){ this.worker = new Worker('../workers /gr...
In this example, we will launch a basic EC2 Instance with Amazon Linux in the quickest manner possible via the AWS Management Console. Amazon frequently improves the user experience of the AWM Management console, so you might experience some changes to the screens below. Important: launching an in...
Using SBT to manage the library dependency, add this to build.sbt: libraryDependencies += "org.scalactic" %% "scalactic" % "3.0.0" libraryDependencies += "org.scalatest" %% "scalatest" % "3.0.0" % "test" More details can be f...
import {User} from 'backend/user'; // import custom class import {inject} from 'aurelia-framework'; // allows us to inject @inject(User) // inject custom class export class ProfileView { constructor(user) { // use instance of custom class as a parameter to the constructor this.user = us...
public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int[] ar = new int[n]; for(int i=0; i<n; i++) ar[i] = sc.nextInt(); quickSort(ar, 0, ar.length-1); } public static void quickSort(...
add_option function ins used to insert new row into options table. This will insert a new row in options table with option name some_option_name and value as some_option_value <?php add_option( 'some_option_name', 'some_option_value' ); ?>
delete_option function is used to delete an option from the options table. This will delete my_custom_option from the options table. <?php delete_option( 'my_custom_option' ); ?>
update_option function is used to update a value that already exists in the options table. If the option does not exist, then the option will be added with the option value. This will set the default comment status to 'closed': update_option( 'default_comment_status', 'closed' );
The observer pattern is where an object, called the subject, maintains a list of its dependents, called observers, and notifies them automatically of any state changes, usually by calling one of their methods. It is mainly used to implement distributed event handling systems. The Observer pattern ...
The subprocess method that allows running commands needs the command in form of a list (at least using shell_mode=True). The rules to create the list are not always straightforward to follow, especially with complex commands. Fortunately, there is a very helpful tool that allows doing that: shlex. ...
It's quite simple to install wordpress in MAMP. You have to follow a few simple steps: 1 - Download MAMP from here, it's free and you probably don't need the pro version. 2 - Install on your PC or Mac. 3 - Run the program -> you will see a little window open, from there you can set MAMP. At t...
Default WooCommerce checkout form comes with several fields for customers to enter their billing details. But in some cases, you might want to hide some of these fields. For example, if you are selling only virtual products, you can get rid of fields like billing address. Use the following code sn...
data table; set table; length state_full $8; if state = 'KS' then state_full = 'Kansas'; else if state = 'CO' then state_full = 'Colorado'; else state_full = 'Other'; run;
Area Light Light is emitted across the surface of a rectangular area. They are baked only which means you won't be able to see the effect until you bake the scene. Area Lights have the following properties: Width - Width of light area. Height - Height of light area. Color - Assign the color...

Page 1028 of 1336