Tutorial by Examples: l

Client metrics cover the traffic between the client and the Varnish cache. sess_conn - Cumulative number of connections. client_req - Cumulative number of client requests. sess_dropped - Dropped connections because of a full queue. Monitor sess_conn and client_req to keep track of traffic vo...
TypeScript enables editors to provide contextual documentation: You'll never forget whether String.prototype.slice takes (start, stop) or (start, length) again!
TypeScript allows editors to perform automated refactors which are aware of the rules of the languages. Here, for instance, Visual Studio Code is able to rename references to the inner foo without altering the outer foo. This would be difficult to do with a simple find/replace.
{-# LANGUAGE OverloadedStrings #-} module Main where import Data.Aeson main :: IO () main = do let example = Data.Aeson.object [ "key" .= (5 :: Integer), "somethingElse" .= (2 :: Integer) ] :: Value print . encode $ example
In foo.vala: void main (string[] args) { stdout.printf ("Hello world!"); } To compile the source into the foo binary: valac foo.vala To compile and run the source: vala foo.vala
project('Posix-based Project', 'vala') add_project_arguments(['--nostdpkg'], language: 'vala') posix_dep = meson.get_compiler('vala').find_library('posix') executable('foo', 'foo.vala', dependencies: [posix_dep])
<?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://api.dropboxapi.com/2/files/list_folder"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_CAINFO, "cacert.pem"); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($ch, CURLOP...
public class Foo : Object { public string prop { construct; get; } } It is meant for interospectable API using GObject Introspection. This is the recommended way for declaring classes.
public class Foo { public string prop { construct; get; } } Pure-Vala and lightweight class. This is useful if you need a compromise between efficiency of a struct and the feature of a full blown GObject class.
[Compact] public class Foo { public string prop; } It is mainly used for writing bindings with specific memory management.
Say "Hello", Rails To get Rails saying "Hello", you need to create at minimum a controller and a view. A controller's purpose is to receive specific requests for the application. Routing decides which controller receives which requests. Often, there is more than one route t...
import javax.inject.Singleton; import dagger.Module; import dagger.Provides; @Module public class VehicleModule { @Provides @Singleton Motor provideMotor(){ return new Motor(); } @Provides @Singleton Vehicle provideVehicle(){ return new Vehicle(...
The connection between the provider of dependencies, @Module, and the classes requesting them through @Inject is made using @Component, which is an interface: import javax.inject.Singleton; import dagger.Component; @Singleton @Component(modules = {VehicleModule.class}) public interface Vehicl...
# Getting started First, let’s generate a new Ruby on Rails application: rails new ModularTodo The next step is to generate an engine! cd ModularTodo && rails plugin new todo --mountable We will also create an ‘engines’ folder to store the engines (even if we just have one!). mk...
/** * A SuiteScript 1.0 example of using nlapiSubmitField to update a single field on a related record */ // From a Sales Order, get the Customer ID var customerId = nlapiGetFieldValue("entity"); // Set a comment on the Customer record nlapiSubmitField("customer", c...
/** * A SuiteScript 1.0 example of using nlapiSubmitField to update multiple fields on a related record */ // From a Sales Order, get the Customer ID var customerId = nlapiGetFieldValue("entity"); // Set a Comment and update the Budget Approved field on the Customer record nlap...
/** * A SuiteScript 2.0 example of using N/record#submitFields to update a single field on a related record */ require(["N/record", "N/currentRecord"], function (r, cr) { // From a Sales Order, get the Customer ID var customerId = cr.get().getValue({"field...
/** * A SuiteScript 2.0 example of using N/record#submitFields to update multiple fields on a related record */ require(["N/record", "N/currentRecord"], function (r, cr) { // From a Sales Order, get the Customer ID var customerId = cr.get().getValue({"fiel...
Create web directory in same folder as the vendor directory. Create index.php file in web directory with contents <?php // web/index.php require_once __DIR__.'/../vendor/autoload.php'; $app = new Silex\Application(); $app->get("/", function () { return "Hello wo...
Detailed instructions on getting ansible-playbook set up or installed.

Page 730 of 861