Tutorial by Examples: e

class InitialsImageFactory: NSObject { class func imageWith(name: String?) -> UIImage? { let frame = CGRect(x: 0, y: 0, width: 50, height: 50) let nameLabel = UILabel(frame: frame) nameLabel.textAlignment = .center nameLabel.backgroundColor = .lightGray nameLabel.textColor = .white nam...
Detailed instructions on getting ngrx set up or installed.
First of all you need to initialize the angularfire modules in your app module like this: const firebaseConfig = { apiKey: 'XXXXXXXXXX', authDomain: 'XXXXXXXXXX', databaseURL: 'XXXXXXXXXX', storageBucket: 'XXXXXXXXXX', messagingSenderId: 'XXXXXXXXXX' }; You can get this keys by...
Once you have it on your app, just import it: import { AngularFireDatabase } from 'angularfire2/database'; constructor (private _af: AngularFireDatabase) {} With this Observable List you can access to a list of items under a path, for example if you have root/items/food you can get food items l...
Bukkit has a system called Event Priorities to help plugins handle events in the correct older. The seven priorities are (in older from first executed to last): Lowest Low Normal (default) High Highest Monitor If you are planning to cancel a lot of events (e.g. protection plugin) it would...
hosts: mysql tasks: name: Add mysql user user: name: mysql shell: /sbin/nologin name: install the latest version of libselinux-python yum: name: libselinux-python state: latest name: install perl yum: name: perl state: latest name: remove the mysql-libs package y...
Open3.popen3 or Open3.capture3: Open3 actually just uses Ruby's spawn command, but gives you a much better API. Open3.popen3 Popen3 runs in a sub-process and returns stdin, stdout, stderr and wait_thr. require 'open3' stdin, stdout, stderr, wait_thr = Open3.popen3("sleep 5s && ls&q...
Exec: exec 'echo "hello world"' or exec ('echo "hello world"') The System Command: system 'echo "hello world"' Will output "hello world" in the command window. or system ('echo "hello world"') The system command can return a true if ...
Steps to create MYSQL database Login to amazon account and select RDS service Select Launch DB Instance from the instance tab By defaul MYSQL Community Edition will be selected, hence click the select button Select the database purpose, say production and click next step Provide the mysql ver...
This post shows how to use most of the functions in the Regex class, work with null safely related to the Regex functions, and how raw strings makes it easier to write and read regex patterns. The RegEx class To work with regular expressions in Kotlin, you need to use the Regex(pattern: String) cl...
Asymmetric encryption is often regarded as preferable to Symmetric encryption for transferring messages to other parties. This is mainly because it negates many of the risks related to the exchange of a shared key and ensures that whilst anyone with the public key can encrypt a message for the inten...
Shopify themes can also be developed locally. Follow the steps below to setup local development environment: Install Shopify Theme Kit Get API Access Use a new theme or Configure an existing theme with theme kit Explanation of the above steps are as follows: Install Shopify Theme Kit A...
To list available mix tasks use: mix help To get help on a specific task use mix help task e.g.: mix help cmd
Detailed instructions on getting boto3 set up or installed.
import { Injectable } from '@angular/core'; import { HttpEvent, HttpHandler, HttpInterceptor, HttpRequest } from '@angular/common/http'; import { UserService } from '../services/user.service'; import { Observable } from 'rxjs/Observable'; @Injectable() export class AuthHeaderInterceptor imple...
Events triggered by actions inside a HTML form (applies to almost all HTML elements, but is most used in form elements): AttributeDescriptiononblurFires the moment that the element loses focusonchangeFires the moment when the value of the element is changedoncontextmenuScript to be run when a conte...
AttributeDescriptiononkeydownFires when a user is pressing a keyonkeypressFires when a user presses a keyonkeyupFires when a user releases a key
To find whether an object was constructed by a certain constructor or one inheriting from it, you can use the instanceof command: //We want this function to take the sum of the numbers passed to it //It can be called as sum(1, 2, 3) or sum([1, 2, 3]) and should give 6 function sum(...arguments) {...
It is occasionally desirable to deny a certain Permission to some ProtectionDomain, regardless of any other permissions that domain accrues. This example demonstrates just one of all the possible approaches for satisfying this kind of requirement. It introduces a "negative" permission clas...
Note, if you are not familiar with the google maps api, you may read the precedent example (basics) in order to understand this little example. First, initialize the map. You may add an map's element in your HTML code and a bite of CSS like this: <!DOCTYPE html> <html> <h...

Page 1187 of 1191