Tutorial by Examples: c

$id = $request->cookies->get('PHPSESSID'); This will return the value of the 'PHPSESSID' cookie sent by the browser.
Launch screen is a screen which appears while launching app and lasts till first screen of app appears. Learn more about Launch Screen and guidelines here. Similar to AppIcons we have to mention in project settings about using image assets for launch screen image. By default project settings are ...
There are various types of inheritance and code reuse in Twig: Include The main goal is code reuse. Consider using header.html.twig & footer.html.twig inside base.html.twig as an example. header.html.twig <nav> <div>Homepage</div> <div>About</div> </...
The ternary operator (?:) Support for the extended ternary operator was added in Twig 1.12.0. {{ foo ? 'yes' : 'no' }} Evaluates: if foo echo yes else echo no {{ foo ?: 'no' }} or {{ foo ? foo : 'no' }} Evaluates: if foo echo it, else echo no {{ foo ? 'yes' }} or {{ f...
In Kotlin, variable declarations look a bit different than Java's: val i : Int = 42 They start with either val or var, making the declaration final ("value") or variable. The type is noted after the name, separated by a : Thanks to Kotlin's type inference the explicit typ...
Kotlin does not need ; to end statements Kotlin is null-safe Kotlin is 100% Java interoperable Kotlin has no primitives (but optimizes their object counterparts for the JVM, if possible) Kotlin classes have properties, not fields Kotlin offers data classes with auto-generated equals/hashCode ...
You can use django rest framework permission classes to check request headers and authenticate user requests Define your secret_key on project settings API_KEY_SECRET = 'secret_value' note: a good practice is to use environment variables to store this secret value. Define a permission ...
Create a UITableView cell category class. UITableViewCell+RRCell.h file #import <UIKit/UIKit.h> @interface UITableViewCell (RRCell) -(id)initWithOwner:(id)owner; @end UITableViewCell+RRCell.m file #import "UITableViewCell+RRCell.h" @implementation UITableViewCell (R...
Detailed instructions on getting windows-installer set up or installed.
Prior to iOS 7 when you want to scan a QR code, we might need to rely on third party frameworks or libraries like zBar or zXing. But Apple introduced AVCaptureMetaDataOutput from iOS 7 for reading barcodes. To read QR code using AVFoundation we need to setup/create AVCaptureSession and use captureO...
in Startup.cs // This method gets called by the runtime. Use this method to add services to the container. public void ConfigureServices(IServiceCollection services) { // Add framework services. services.AddMvc(); var controllerActivator = new CompositionRoot(); services...
One of the features in SugarCRM 7.x is being able to easily add and extend custom endpoints to accomplish what you require. In this example, we'll create a couple of custom endpoints to return some data about the request. This custom file is being placed in custom/clients/base/api/DescriptionAPI.p...
Both are used to define error handling for a website, but different software refers to different config elements. customErrors are a legacy (backwards compatable) element, used by Visual Studio Development Server (aka. VSDS or Cassini). httpErrors are the new element which is only used by IIS7. T...
A quick way to test your xpath is in your browser developer tool console. Format is $x('//insert xpath here') $ - specifies it is a selector. x - specifies it is using xpaths Example: $x("//button[text() ='Submit']") When this command is entered it will return all occurrences...
Suppose you want the user to select keywords from a menu, we can create a script similar to #!/usr/bin/env bash select os in "linux" "windows" "mac" do echo "${os}" break done Explanation: Here select keyword is used to loop through a list ...
Example of a TCA field configuration where you can select records from a table 'my_topfeatures' => array( 'label' => 'Select Topfeatures', 'config' => array( 'type' => 'group', 'internal_type' => 'db', 'size' => '4', ...
Create the Newsletter model: rails g model Newsletter name:string email:string subl app/models/newsletter.rb validates :name, presence: true validates :email, presence: true Create the Newsletter controller: rails g controller Newsletters create class NewslettersCont...
HTML <div class="countdown"></div> JS var duration = moment.duration({ 'minutes': 5, 'seconds': 00 }); var timestamp = new Date(0, 0, 0, 2, 10, 30); var interval = 1; var timer = setInterval(function() { timestamp = new Date(timestamp.getTi...
If a file is changed, but you don't like to commit it, set the file as "Assume unchanged" Revert "Assume unchanged" Need some steps:
The following app will start an HTTP server listening on port 8080 that returns Hello world on GET /hello/world import akka.actor.ActorSystem import akka.http.scaladsl.Http import akka.http.scaladsl.server.Directives._ import akka.http.scaladsl.server._ import akka.stream.ActorMaterializer i...

Page 784 of 826