Tutorial by Examples

// register activation hook register_activation_hook( __FILE__, 'example_activation' ); // function for activation hook function example_activation() { // check if scheduled hook exists if ( !wp_next_scheduled( 'my_event' )) { // Schedules a hook // time() - the f...
For the current shell, this takes you to the previous directory that you were in, no matter where it was. cd - Doing it multiple times effectively "toggles" you being in the current directory or the previous one.
The default directory is the home directory ($HOME, typically /home/username), so cd without any directory takes you there cd Or you could be more explicit: cd $HOME A shortcut for the home directory is ~, so that could be used as well. cd ~
To change to an absolutely specified directory, use the entire name, starting with a backslash \, thus: cd /home/username/project/abc If you want to change to a directory near your current on, you can specify a relative location. For example, if you are already in /home/username/project, you can...
CakePHP 3.x has the ability to bake controllers, models, views and other framework defined objects. Note : If you have had some experience with the Laravel framework, the artisan component is similar to bake. The bake application is located in bin folder; the following are some of the availabl...
You can easily create tables for Your database or drop them if You want. If You wish to do that, You should learn how to write Migrations for desired database. Migrations files must be located in config/Migrations folder. File names can be in next formats: YYYYMMDDHHIISS_(Create|Alter|Delete)Ad...
Want to create a controller? There is 2 ways of creating it: Manually (You will be forced to manually create Controller file in src/Controller) Baked (Running bin/cake bake controller %controllerName% command from CLI) If You want to create it manually, go to src/Controller folder and create ...
from selenium import webdriver driver = webdriver.Chrome() # Creates a new chromedriver instance driver.get("https://www.python.org/") # Go to https://www.python.org/ # Sends the text "python" to the text search box driver.find_element_by_id("id-search-field").s...
This is a basic example of a Selenium testcase using the python Unittest library from selenium import webdriver import unittest class SeleniumTest(Unittest.testcase): def setUp(self): self.driver = webdriver.Chrome() self.driver.implicitly_wait(30) def te...
from selenium import webdriver # Create a new webdriver driver = webdriver.Chrome() # Get a page that has a popup window (Use mouse to click "try it" button) driver.get("http://www.w3schools.com/js/tryit.asp?filename=tryjs_alert") # Accept the opened alert driver.switch_t...
GRANT SELECT ON [dbo].[someTable] TO [aUser]; REVOKE SELECT ON [dbo].[someTable] TO [aUser]; --REVOKE SELECT [dbo].[someTable] FROM [aUser]; is equivalent DENY SELECT ON [dbo].[someTable] TO [aUser];
--implicitly map this user to a login of the same name as the user CREATE USER [aUser]; --explicitly mapping what login the user should be associated with CREATE USER [aUser] FOR LOGIN [aUser];
-- SQL 2005+ exec sp_addrolemember @rolename = 'myRole', @membername = 'aUser'; exec sp_droprolemember @rolename = 'myRole', @membername = 'aUser'; -- SQL 2008+ ALTER ROLE [myRole] ADD MEMBER [aUser]; ALTER ROLE [myRole] DROP MEMBER [aUser]; Note: role members can be any database-level pri...
In this example we have a service, let's call it search service that has a method called search() which will initiate a get request to a back end API. function SearchService($http) { const service = {}; service.search = function() { return $http({method: 'GET', url: `/api/s...
function calculatorService() { const service = {}; service.add = function(a,b) { return a + b } return service; } angular.module('app').factory('calculatorService', calculatorService); Testing describe('calculator service', function() { var calcula...
Files compressed by gzip can be directly concatenated into larger gzipped files. cat file1.gz file2.gz file3.gz > combined.gz This is a property of gzip that is less efficient than concatenating the input files and gzipping the result: cat file1 file2 file3 | gzip > combined.gz A compl...
from selenium import webdriver # Create a new chromedriver driver = webdriver.Chrome() # Go to www.google.com driver.get("https://www.google.com") # Get the webelement of the text input box search_box = driver.find_element_by_name("q") # Send the string "Selen...
The easiest way is to use pip and VirtualEnv. Selenium also requires python 3.*. Install virtualenv using: $: pip install virtualenv Create/enter a directory for your Selenium files: $: cd my_selenium_project Create a new VirtualEnv in the directory for your Selenium files: $: virtualenv -...
Unity layers are similar to tags as in that they can be used to define objects that should be interacted with or should behave in a certain manner, however, layers are mainly used with functions in the Physics class: Unity Documentation - Physics Layers are represented by an integer and can be pass...

Page 923 of 1336