Tutorial by Examples: e

The style attribute can be a string (like any normal attribute) but it can also be an object, which is handy when parts of the style are generated by JavaScript. Code: a(style={color: 'red', background: 'green'}) Result: <a style="color:red;background:green"></a>
The class attribute can be a string (like any normal attribute) but it can also be an array of class names, which is handy when generated from JavaScript. Code: - var classes = ['foo', 'bar', 'baz'] a(class=classes) //- the class attribute may also be repeated to merge arrays a.bing(class=class...
Classes may be defined using a .classname syntax: Code: a.button Result: <a class="button"></a> Since div's are such a common choice of tag, it is the default if you omit the tag name: Code: .content Result: <div class="content"></div>
IDs may be defined using a #idname syntax: Code: a#main-link Result: <a id="main-link"></a> Since div's are such a common choice of tag, it is the default if you omit the tag name: Code: #content Result: <div id="content"></div>
Pronounced "and attributes", the &attributes syntax can be used to explode an object into attributes of an element. Code: div#foo(data-bar="foo")&attributes({'data-foo': 'bar'}) Result: <div id="foo" data-bar="foo" data-foo="bar">&l...
To add for instance a directory scripts to the distribution package: Add to the project a folder scripts On top of the build.sbt, add: import NativePackagerHelper._ In build.sbt, add a mapping to the new directory: mappings in Universal ++= directory("scripts") B...
Server side Meteor.methods({ getData() { return 'Hello, world!'; } }); Client side <template name="someData"> {{#if someData}} <p>{{someData}}</p> {{else}} <p>Loading...</p> {{/if}} </template> Template.someData.on...
Server side Meteor.methods({ getData() { return 'Hello, world!'; } }); Client side <template name="someData"> {{#if someData}} <p>{{someData}}</p> {{else}} <p>Loading...</p> {{/if}} </template> Template.someData.on...
LaraDock is a Laravel Homestead like development environment but for Docker instead of Vagrant. https://github.com/LaraDock/laradock Installation *Requires Git and Docker Clone the LaraDock repository: A. If you already have a Laravel project, clone this repository on your Laravel root director...
You can add new extensions to require() by extending require.extensions. For a XML example: // Add .xml for require() require.extensions['.xml'] = (module, filename) => { const fs = require('fs') const xml2js = require('xml2js') module.exports = (callback) => { // ...
This is an example of Serial Document Middleware In this example, We will write a middleware that will convert the plain text password into a hashed password before saving it in database. This middleware will automatically kick in when creating new user or updating existing user details. FILENA...
Use Ember CLI to generate a new helper in your app: ember generate helper format-currency Then edit helpers/format-currency.js to contain the following: import Ember from 'ember'; export function formatCurrency([value, ...rest]) { const dollars = Math.floor(value / 100); const cents = va...
In Oracle 12g+ SELECT Id, Col1 FROM TableName ORDER BY Id OFFSET 20 ROWS FETCH NEXT 20 ROWS ONLY; In earlier Versions SELECT Id, Col1 FROM (SELECT Id, Col1, row_number() over (order by Id) RowNumber FROM TableName) WHERE RowNumber BETWEEN 21 AND 40 ...
In Oracle 12g+ SELECT Id, Col1 FROM TableName ORDER BY Id OFFSET 5 ROWS; In earlier Versions SELECT Id, Col1 FROM (SELECT Id, Col1, row_number() over (order by Id) RowNumber FROM TableName) WHERE RowNumber > 20
- Initially check your E-Mail Settings In Odoo go to Settings --> Email . Enter the field values in "Incoming Mail Servers" & "Outgoing Mail Servers" Options.
This example shows how to find number of days between two dates. A date is specified by year/month/day of month, and additionally hour/minute/second. Program calculates number of days in years since 2000. #include <iostream> #include <string> #include <chrono> #include <cti...
Retrieves the information pertaining to the currently logged in user, and places it in the global variable $current_user This function does not accept any parameters. Usage: <?php wp_get_current_user(); ?> Example: <?php $current_user = wp_get_current_user(); echo 'Usernam...
Here we create a basic hello world server using Express. Routes: '/' '/wiki' And for rest will give "404" , i.e. page not found. 'use strict'; const port = process.env.PORT || 3000; var app = require('express')(); app.listen(port); app.get('/',(req,res)=>res.send(...
It's quite common to want to check the status of the various partitions/drives on your server/computer to see how full they are. The following command is the one you'll want to run: df -h This will produce output similar to the following: [root@mail ~]# df -h Filesystem Size Used A...
<stock> <add> <item> <name>Milk</name> <quantity>2</quantity> </item> </add> </stock> Putting this body to an resource like /stocks/123 violates the idea behind REST. While this bod...

Page 803 of 1191