Tutorial by Examples: direct

There are use cases when you might want to rename your app directory to something else. In Laravel4 you could just change a config entry, here's one way to do it in Laravel5. In this example we'll be renaming the app directory to src. Override Application class The directories name app is hardcod...
if we want to change the Controllers directory we need: Move and/or rename the default Controllers directory where we want it. For example from app/Http/Controllers to app/Controllers Update all the namespaces of the files inside the Controllers folder, making they adhere to the new path, re...
$ mkdir 20{09..11}-{01..12} Entering the ls command will show that the following directories were created: 2009-01 2009-04 2009-07 2009-10 2010-01 2010-04 2010-07 2010-10 2011-01 2011-04 2011-07 2011-10 2009-02 2009-05 2009-08 2009-11 2010-02 2010-05 2010-08 2010-11 2011-02 2011-05 2011-08 2011...
In the assets initalizer (config/initializers/assets.rb) are a few files explicitly defined to be precompiled. # Precompile additional assets. # application.coffee, application.scss, and all non-JS/CSS in app/assets folder are already added. # Rails.application.config.assets.precompile += %w( sea...
div { direction: ltr; /* Default, text read read from left-to-right */ } .ex { direction: rtl; /* text read from right-to-left */ } .horizontal-tb { writing-mode: horizontal-tb; /* Default, text read from left-to-right and top-to-bottom. */ } .vertical-rtl { writing-mode: v...
server { listen 80 default_server; listen [::]:80 default_server; server_name example.com www.example.com; return 307 https://$host$request_uri; } A 301 redirect is also an alternative but if a POST is made to a 301, then many clients will resubmit the request as a GET - whic...
server { server_name example.com; return 301 $scheme://example.net$request_uri; }
To execute a script file with the bash interpreter, the first line of a script file must indicate the absolute path to the bash executable to use: #!/bin/bash The bash path in the shebang is resolved and used only if a script is directly launch like this: ./script.sh The script must have exe...
If you want to add all the JARs in directory to the classpath, you can do this concisely using classpath wildcard syntax; for example: someFolder/* This tells the JVM to add all JAR and ZIP files in the someFolder directory to the classpath. This syntax can be used in a -cp argument, a CLASSPA...
for /r command can be used to recursively visit all the directories in a directory tree and perform a command. @echo off rem start at the top of the tree to visit and loop though each directory for /r %%a in (.) do ( rem enter the directory pushd %%a echo In directory: cd rem leave...
The following uses a variable with a for loop to rename a group of files. SetLocal EnableDelayedExpansion for %%j in (*.*) do ( set filename=%%~nj set filename=!filename:old=new! set filename=Prefix !filename! set filename=!filename! Suffix ren "%%j" "!filename!%%~x...
Instead of linking to an external file, you can also include the JS code as-is in your HTML: <script> // JavaScript code </script>
docker run --name="test-app" --entrypoint="/bin/bash" example-app This command will override the ENTRYPOINT directive of the example-app image when the container test-app is created. The CMD directive of the image will remain unchanged unless otherwise specified: docker run -...
The data can be imported directly into Hive: sqoop import --hive-import --table EventLog --connect "jdbc:sqlserver://192.168.1.99:1433;database=Test_db" --username user --password password --split-by id ...
You can use the header() function to instruct the browser to redirect to a different URL: $url = 'https://example.org/foo/bar'; if (!headers_sent()) { // check headers - you can not send headers if they already sent header('Location: ' . $url); exit; // protects from code being executed afte...
Sometimes you may need additional features from a directive. Instead of rewriting (copy) the directive, you can modify how the directive behaves. The decorator will be executed during $inject phase. To do so, provde a .config to your module. The directive is called myDirective, so you have to con...
Angular js directives can be nested or be made interoperable. In this example, directive Adir exposes to directive Bdir it's controller $scope, since Bdir requires Adir. angular.module('myApp',[]).directive('Adir', function () { return { restrict: 'AE', controlle...
The thing is; you can't connect Ionic to any database (MySQL, Postgres, MSSQL, ...) directly. The keyword here is directly. No, there's no workaround, no magic involved, it's just not the way this is supposed to work. Ionic works on top of Angular and Angular is a frontend framework. However, the ...
Enabled directory index means that if someone access to any folder which don't contains index.php , index.html, index.htm or any other default file defined in DirectoryIndex in apache configuration then all files in that folder will be listed in browser if you try to visit that page. Often director...
public void iterate(final String dirPath) throws IOException { final DirectoryStream<Path> paths = Files.newDirectoryStream(Paths.get(dirPath)); for (final Path path : paths) { if (Files.isDirectory(path)) { System.out.println(path.getFileName()); } } ...

Page 5 of 13