Tutorial by Examples: dire

Sometimes you may want to have some login to determine where the user gets redirected to after submitting a form. Form Requests give a variety of ways. By default there are 3 variables declared in the Request $redirect, $redirectRoute and $redirectAction. On top of those 3 variables you can overr...
Usually output of a command goes to the terminal. Using the concept of Output redirection, the output of a command can be redirected to a file. So insted of displaying the output to the terminal it can be send to a file. '>' character is used for output redirection. $ pwd > file1 $ cat file...
The commands normally take their input from the standard input device keyboard. Using Input redirection concept, we can have their input redirected from a file. To redirect standard input from a file instead of the keyboard, the '<' character is used. $ cat file1 monday tuesday wednsday th...
Copying files copy copies the source file in the first argument to the destination in the second argument. The resolved destination needs to be in a directory that is already created. if (copy('test.txt', 'dest.txt')) { echo 'File has been copied successfully'; } else { echo 'Failed to ...
Calling C code from Go package main /* // Everything in comments above the import "C" is C code and will be compiles with the GCC. // Make sure you have a GCC installed. int addInC(int a, int b) { return a + b; } */ import "C" import "fmt" func ma...
create or replace directory DATAPUMP_REMOTE_DIR as '/oracle/scripts/expimp';
This code will prompt you to create the directory with :w, or just do it with :w!: augroup vimrc-auto-mkdir autocmd! autocmd BufWritePre * call s:auto_mkdir(expand('<afile>:p:h'), v:cmdbang) function! s:auto_mkdir(dir, force) if !isdirectory(a:dir) \ && (a:f...
By default modules are placed on ${WILDFLY}/modules directory but you can have more directories with modules, just edit your standalone.conf (or standalone.conf.bat if you are on Microsoft Windows) and properly set the variable JBOSS_MODULEPATH For example in Unix/Linux/MacOSX: JBOSS_MODULEPATH=&q...
You can mount remote directory through ssh by using sshfs. Sshfs does not come as a default on Ubuntu, so you need to install it first by using sudo apt-get install sshfs. You can then mount the remote directory to your local machine like this sshfs [email protected]:/remotedir /localdir Not...
To add a directive with a selector [prefix]Highlight, run: $ ng g d highlight installing directive create src/app/highlight.directive.spec.ts create src/app/highlight.directive.ts update src/app/app.module.ts To prevent prefix usage add --prefix false or -p false flag ...
Service that is used for communication: import { Injectable } from '@angular/core'; import { Subject } from 'rxjs/Subject'; @Injectable() export class ComponentCommunicationService { private componentChangeSource = new Subject(); private newDateCreationSource = new Subject<Date&...
In general, there are two types of Bash scripts: System tools which operate from the current working directory Project tools which modify files relative to their own place in the files system For the second type of scripts, it is useful to change to the directory where the script is stored. T...
/** * 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' );
Scope is used as the "glue" that we use to communicate between the parent controller, the directive, and the directive template. Whenever the AngularJS application is bootstrapped, a rootScope object is created. Each scope created by controllers, directives and services are prototypically ...
DirectByteBuffer is special implementation of ByteBuffer that has no byte[] laying underneath. We can allocate such ByteBuffer by calling: ByteBuffer directBuffer = ByteBuffer.allocateDirect(16); This operation will allocate 16 bytes of memory. The contents of direct buffers may reside outside ...
The raycaster has an origin, where its ray starts, and a direction, where the ray goes. The origin of the raycaster is at the raycaster entity’s position. We can change the origin of the raycaster by setting the position component of the raycaster entity (or parent entities of the raycaster entity)...
Redis-py provides the execute_command method to directly invoke Redis operations. This functionality can be used to access any modules that may not have a supported interface in the redis-py client. For example, you can use the execute_command to list all of the modules loaded into a Redis server:...
Directional lights are like a light source that is infinitely far away, but shining from a specific direction, like the sun. Thus, absolute position do not have an effect on the intensity of the light on an entity. We can specify the direction using the position component. The example below creates...
The example below is taken from the full docs, available here (GitHub) or here (NPM). Installation npm install --save activedirectory Usage // Initialize var ActiveDirectory = require('activedirectory'); var config = { url: 'ldap://dc.domain.com', baseDN: 'dc=domain,dc=com' }; va...
You can restrict the directions the user is able to scroll to using the following code: func scrollViewDidScroll(_ scrollView: UIScrollView) { if scrollView.contentOffset.x != 0 { scrollView.contentOffset.x = 0 } } Every time the user scrolls on the x-axis, the scrollView's c...

Page 12 of 13