Tutorial by Examples: er

Getting elements to center or bottom align vertically has always been a challenge with CSS and Bootstrap. The desired vertical alignment may be within a parent container, or relative to adjacent elements. Now that Bootstrap 4 is flexbox by default there are many different approaches to vertical ali...
You can see the running demo by clicking here. HTML: <p> <span>Counter State</span><br /> (<em>Will increase each minute</em>): <p> <span id="counter-state" style="font-weight: bolder"></span> </p> &l...
Active Record Transactions can be applied to Model classes as well as Model instances, the objects within the transaction block need not all be instances of same class. This is because transactions are per-database connection, not per-model. For example: User.transaction do account.save! prof...
In order to deploy the application on docker, first we need to get the image from registry. docker pull php This will get you the latest version of image from official php repository. Generally speaking, PHP is usually used to deploy web-applications so we need an http server to go with the imag...
Dockerfile is used to configure the custom image that we will be building with the web-application codes. Create a new file Dockerfile in the root folder of project and then put the following contents in the same FROM php:7.0-apache COPY /etc/php/php.ini /usr/local/etc/php/ COPY . /var/www/html/ ...
Once we have an image ready, we can start and serve the same. In order to create a container from the image, use docker run -p 80:80 -d <Image name> In the command above -p 80:80 would forward port 80 of your server to port 80 of the container. The flag -d tells that the container should r...
Ensure that you have Polymer CLI installed in your system globally. If not, open your command line/terminal interface and run this command: npm install -g polymer-cli Note: If you're an Ubuntu user, you may have to prefix the above code with sudo keyword. After Polymer CLI installs, ...
Application visits are initiated by clicking a Turbolinks-enabled link, or programmatically by calling Turbolinks.visit(location) By default, the visit function uses the 'advance' action. More understandably, the default behavior for the visit function is to advance to the page indicated by the ...
Consider the following situation: Imagine that you are the developer of a social media website that allows users to be friends with other users and that employs turbolinks to make page loading faster. In the top right of every page on the site, there is a number indicating the total number of friend...
To allow multiple user registration on Ejabberd server, we need to configure file ejabberd.yml in Ejabberd latest versions. Configure ejabberd.yml like: in access_rules: add register: - allow register_from: - allow registration_timeout: - infinity mod_register: acc...
Run the following command one by one: npm install -g vulcanize crisper Use Vulcanize: Crunches all the HTML import files into a single file Crisper: Extracts inline js to its own file Note: Ubuntu users may need to prefix the above command with sudo.
Put all the html imports in your files in a single file elements.html. Don't worry about a file being imported more than once, it'll be crunched down to a single import.
on your elements.html file, run the following commands: cd PATH/TO/IMPORTFILE/ vulcanize elements.html -o elements.vulc.html --strip-comments --inline-css --inline-js crisper --source elements.vulc.html --html build.html --js build.js Vulcanize retrieved source code of all the imports, then re...
Link function is best way in custom directives to manipulate DOM. It takes three attributes as input (scope, element, attribute) in sequence scope: its local scope object of directive. element: html element on which directive is used. attribute: it gives access to all attributes used in element ...
For this example we will use the Live Test RavenDB instance. We will build a simple console app here which demonstrates the most basic operations: Creation Retrieval by Id Querying Updating Deletion Begin by creating a new Visual Studio solution and add a Console Application project to it...
If you try and create a recursive enum in Rust without using Box, you will get a compile time error saying that the enum can't be sized. // This gives an error! enum List { Nil, Cons(i32, List) } In order for the enum to have a defined size, the recursively contained value must be in...
Let's say you have already created the custom Test Work Orders screen to manage test work orders in your Acumatica ERP application: There is already NoteID field declared in the TestWorkOrder DAC, managed on the Test Work Orders screen: [Serializable] public class TestWorkOrder : IBqlTable { ...
func loginHandler(w http.ResponseWriter, r *http.Request) { // Steps to login } func main() { http.HandleFunc("/login", loginHandler) http.ListenAndServe(":8080", nil) }
// logger middlerware that logs time taken to process each request func Logger(h http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { startTime := time.Now() h.ServeHttp(w,r) endTime := time.Since(startTime) log...
func Recovery(h http.Handler) http.Handler { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request){ defer func() { if err := recover(); err != nil { // respondInternalServerError } }() h.ServeHTTP(w , r) }...

Page 367 of 417