Tutorial by Examples: dir

Creating a custom directive with isolated scope will separate the scope inside the directive from the outside scope, in order to prevent our directive from accidentally change the data in the parent scope and restricting it from reading private data from the parent scope. To create an isolated scop...
Assume you've initialized a project with the following directory structure: /build app.js Then you add everything so you've created so far and commit: git init git add . git commit -m "Initial commit" Git will only track the file app.js. Assume you added a build step to your applicat...
The ls command has several options that can be used together to show more information. Details/Rights The l option shows the file permissions, size, and last modified date. So if the root directory contained a dir called test and a file someFile the command: user@linux-computer:~$ ls -l Would ...
A list of references to members of a group, such as a static table of contents. <ul role="directory"> <li><a href="/chapter-1">Chapter 1</a></li> <li><a href="/chapter-2">Chapter 2</a></li> <li><a ...
A simple context tree (containing some common values that might be request scoped and included in a context) built from Go code like the following: // Pseudo-Go ctx := context.WithValue( context.WithDeadline( context.WithValue(context.Background(), sidKey, sid), time.Now().A...
package main import ( "fmt" "io/ioutil" ) func main() { files, err := ioutil.ReadDir(".") if err != nil { panic(err) } fmt.Println("Folders in the current directory:") for _, fileInfo := range files { ...
Early bound (requires a reference to Microsoft Scripting Runtime): Public Sub EnumerateDirectory() Dim fso As Scripting.FileSystemObject Set fso = New Scripting.FileSystemObject Dim targetFolder As Folder Set targetFolder = fso.GetFolder("C:\") Dim foundFi...
It is considered good practice to use a prefix when creating git archives, so that extraction will place all files inside a directory. To create an archive of HEAD with a directory prefix: git archive --output=archive-HEAD.zip --prefix=src-directory-name HEAD When extracted all the files will be...
It is also possible to create archives of other items than HEAD, such as branches, commits, tags, and directories. To create an archive of a local branch dev: git archive --output=archive-dev.zip --prefix=src-directory-name dev To create an archive of a remote branch origin/dev: git archive --...
You can rescue a RecordNotFound exception with a redirect instead of showing an error page: class ApplicationController < ActionController::Base # your other stuff rescue_from ActiveRecord::RecordNotFound do |exception| redirect_to root_path, 404, alert: I18n.t("errors.record...
ng-app Sets the AngularJS section. ng-init Sets a default variable value. ng-bind Alternative to {{ }} template. ng-bind-template Binds multiple expressions to the view. ng-non-bindable States that the data isn't bindable. ng-bind-html Binds inner HTML property of an HTML element....
If you are working with vectors or lines you will at some stage want to get the direction of a vector, or line. Or the direction from a point to another point. Math.atan(yComponent, xComponent) return the angle in radius within the range of -Math.PI to Math.PI (-180 to 180 deg) Direction of a vect...
If you have a vector in polar form (direction & distance) you will want to convert it to a cartesian vector with a x and y component. For referance the screen coordinate system has directions as 0 deg points from left to right, 90 (PI/2) point down the screen, and so on in a clock wise direction...
Whatever you do to customize Vim, it should NEVER happen outside of $HOME: on Linux, BSD and Cygwin, $HOME is usually /home/username/, on Mac OS X, $HOME is /Users/username/, on Windows, $HOME is usually C:\Users\username\. The canonical location for your vimrc and your vim directory is at ...
This bidirectional mapping requires the mappedBy attribute on the OneToMany association and the inversedBy attribute on the ManyToOne association. A bidirectional relationship has both an owning and inverse side. OneToMany relationships can use join tables, so you have to specify an owning side. Th...
The @if control directive evaluates a given expression and if it returns anything other than false, it processes its block of styles. Sass Example $test-variable: true !default =test-mixin @if $test-variable display: block @else display: none .test-selector +test-mixin ...
The first thing you need to know when structuring your apps is that the Meteor tool has some directories that are hard-coded with specific logic. At a very basic level, the following directories are "baked in" the Meteor bundler. client/ # client applicati...
Many people find themselves eventually supporting multiple applications, and desire to share code between apps. This leads to the concept of microservice architecture, and all-package apps. Essentially, the code from the entire classic directory structure is refactored out into packages. Even tho...
The most recent versions of Meteor ship with support for ecmascript, aka ES6 or ES2015. Instead of packages, Javascript now supports import statements and modules, which replaces the need for package-only applications. The latest directory structure is similar to the package-only structure, but us...
And, of course, you can mix these approaches, and use both packages and imports along side your application specific code. A mix-mode structure is most common in three situations: a franken-app, which is just sort of pulling a bit from here-and-there without any overall strategy; an app that's bei...

Page 4 of 13