Tutorial by Examples: er

Simple Example (centering a single element) HTML <div class="aligner"> <div class="aligner-item">…</div> </div> CSS .aligner { display: flex; align-items: center; justify-content: center; } .aligner-item { max-width: 50%; /*for d...
Sass uses the colon (:) operator to assign values to variables. Example $foreColor: red; p { color: $foreColor; }
Sass supports the following standard arithmetic operators: OperatorDescription+Addition–Subtraction*Multiplication/Division%Remainder Examples p { font-size: 16px + 4px; // 20px } h3 { width: 2px * 5 + 12px; // 22px } h2 { width: 8px + (12px / 2) * 3; // 26px } Norm...
Sass supports all the usual comparison operators: <,>,==,!=,<=,>=. Examples (10px == 10) // Returns true ("3" == 3) // Returns false $padding: 10px; $padding <= 8px; // Returns false
HTML <div class="wrap"> <img src="http://lorempixel.com/400/200/" /> </div> CSS .wrap { height: 50px;/* max image height */ width: 100px; border: 1px solid blue; text-align: center; } .wrap:before { content:""; di...
It is possible to upload multiple parts, each with a different name. For each part name, you will need one parameter annotated with @RequestPart, whose name matches the part name. To receive a file uploaded via an HTTP Post, you need to do the following: @RequestMapping( value = "...&quo...
The function angular.merge takes all the enumerable properties from the source object to deeply extend the destination object. The function returns a reference to the now extended destination object angular.merge(destination, source) Examples angular.merge({}, {}) // {} angular.merge({name...
The angular.isNumber function returns true if and only if the object or value passed to it is of the type Number, this includes +Infinity, -Infinity and NaN angular.isNumber(value) This function will not cause a type coercion such as "23" == 23 // true Examples angular.isNumber...
This code makes sure that all nested containers are always the same height. This is done by assuring that all nested elements are the same height as the containing parrent div. See working example: https://jsfiddle.net/3wwh7ewp/ This effect is achieved due to the property align-items being set to...
By injecting $filter, any defined filter in your Angular module may be used in controllers, services, directives or even other filters. angular.module("app") .service("users", usersService) .controller("UsersController", UsersController); function usersService...
Get the window height and width var width = window.innerWidth var height = window.innerHeight
String literal types allow you to specify the exact value a string can have. let myFavoritePet: "dog"; myFavoritePet = "dog"; Any other string will give a error. // Error: Type '"rock"' is not assignable to type '"dog"'. // myFavoritePet = "rock&qu...
A method can be converted to a closure using the & operator. def add(def a, def b) { a + b } Closure addClosure = this.&add assert this.add(4, 5) == addClosure(4, 5)
Early Bound (with a reference to Microsoft Scripting Runtime) Sub EnumerateFilesAndFolders( _ FolderPath As String, _ Optional MaxDepth As Long = -1, _ Optional CurrentDepth As Long = 0, _ Optional Indentation As Long = 2) Dim FSO As Scripting.FileSystemObject Set ...
Create Table mysql> CREATE TABLE account (acct_num INT, amount DECIMAL(10,2)); Query OK, 0 rows affected (0.03 sec) Create Trigger mysql> CREATE TRIGGER ins_sum BEFORE INSERT ON account -> FOR EACH ROW SET @sum = @sum + NEW.amount; Query OK, 0 rows affected (0.06 sec) The CRE...
Deploy Meteor App to Ubuntu with Nginx Proxy How to Create an SSL Certificate on Nginx for Ubuntu 14 How to Deploy a Meteor JS App on Ubuntu with Nginx How to Install an SSL Certificate from a Commercial Certificate Authority NameCheap SSL Certificates
MySQL does not provide a built-in way to create pivot queries. However, these can be created using prepared statements. Assume the table tbl_values: IdNameGroupValue1PeteA102PeteB203JohnA10 Request: Create a query that shows the sum of Value for each Name; the Group must be column header and Name...
1) Create a Contract Class A contract class defines constants that help applications work with the content URIs, column names, intent actions, and other features of a content provider. Contract classes are not included automatically with a provider; the provider's developer has to define them and t...
globalize gem is a great solution to add translations to your ActiveRecord models. You can install it adding this to your Gemfile: gem 'globalize', '~> 5.0.0' If you're using Rails 5 you will also need to add activemodel-serializers-xml gem 'activemodel-serializers-xml' Model translations...
Due to type erasure the following will not work: public <T> void genericMethod() { T t = new T(); // Can not instantiate the type T. } The type T is erased. Since, at runtime, the JVM does not know what T originally was, it does not know which constructor to call. Workarounds ...

Page 125 of 417