Tutorial by Examples: ect

As of Jekyll 3.2, you can use the filter where_exp to filter a collection by any of its properties. Say you have the following collection item in an "albums" collection: --- title: My Amazing Album --- ... You can combine the where_exp and first filters to grab just that one item: ...
Given an 'albums' collection, you can loop through and output each item: {% for album in site.albums %} {{ album.content }} {% endfor %} Any custom front matter variables are also available within the loop. {% for album in site.albums %} {{ album.title }} {{ album.content }} {%...
Given an 'albums' collection, an item can be added by creating a file in the <source>/_albums directory. Note that files not including frontmatter will be ignored. For instance, adding a file called my_album.md to the _albums directory would add it to the collection: --- title: "My Alb...
The code snippet below shows the various ways you can filter on an array of objects using lodash. let lodash = require('lodash'); var countries = [ {"key": "DE", "name": "Deutschland", "active": false}, {"key": "ZA&qu...
After a while, you end up with many configuration items in your config.yml. It can make you configuration easier to read if you split your configuration across multiple files. You can easily include all files from a directory this way: config.yml: imports: - { resource: parameters.yml } ...
Including a Static Section on a page is similar to including a snippet. The only difference is instead of using the word include you use the word section. {% section 'section-file-name' %} Using this tag will "hardcode" the section into your theme at the place where you put the code an...
Instead of invoking the Angular’s bootstrap code directly, wrap the bootstrap code into a function and export the function. This function can also accept parameters. import { platformBrowserDynamic } from "@angular/platform-browser-dynamic"; import { AppModule } from "./src/app&quot...
Navigate to project's app module and create libs directory. Place your .aar file there. For example myLib.aar. Add the code below to android block of app level's build.gradle file. repositories { flatDir { dirs 'libs' } } This way you defined a new ext...
In mathematics, especially Set Theory, we have a collection of things which is called set and we name those things as elements. We show a set with its name like A, B, C, ... or explicitly with putting its member on brace notation: {a, b, c, d, e}. Suppose we have an arbitrary element x and a set Z, ...
Type Families are not necessarily injective. Therefore, we cannot infer the parameter from an application. For example, in servant, given a type Server a we cannot infer the type a. To solve this problem, we can use Proxy. For example, in servant, the serve function has type ... Proxy a -> Server...
//This example gets the response from iTunes { "rest": { "name": "rest", "connector": "rest", "debug": true, "options": { "useQuerystring": true, "timeout": 10000, "headers": { "accepts": "application/json", "content-type": "applicati...
<ItemGroup> <ProjectReference Include="Foo.csproj"> <Project>{01234567-0123-0123-0123-0123456789AB}</Project> <Name>Foo</Name> </ProjectReference> </ItemGroup>
With a simple for loop, all zip archives in a directory can be extracted. for (i in dir(pattern=".zip$")) unzip(i) The dir function produces a character vector of the names of the files in a directory matching the regex pattern specified by pattern. This vector is looped through w...
General Properties: An Azimuthal Equidistant projection is best recognized when used in polar areas. It is used in the UN's emblem. From the center point, angle and distance are preserved. But the projection will distort shape and area to achieve this, especially as one moves further from the cente...
Note in this example we will use PostgreSQL DBMS, but you can use any DBMS We will use a database bd_test witch contain a Schema: sch_test and two tables users and test : CREATE TABLE sch_test.users ( id serial NOT NULL, username character varying, password character varying, CONSTRAI...
BFS can be used to find the connected components of an undirected graph. We can also find if the given graph is connected or not. Our subsequent discussion assumes we are dealing with undirected graphs.The definition of a connected graph is: A graph is connected if there is a path between every p...
It's common practice in JavaScript to pass object literals to functions: // JavaScript printOptions({responsive: true}); Unfortunately we cannot pass Dart Map objects to JavaScript in these cases. What we have to do is create a Dart object that represents the object literal and contains all of...
Note: You need to know which data referenced by getReference() first before you can completely understand this example. There are three common method to get your data from Firebase Realtime Database: addValueEventListener() addListenerForSingleValueEvent() addChildEventListener() When w...
Throwable has two direct subclasses, Exception and Error. While it's possible to create a new class that extends Throwable directly, this is inadvisable as many applications assume only Exception and Error exist. More to the point there is no practical benefit to directly subclassing Throwable, as ...
This example demonstrate how to dynamically insert data into MySQL using Python Scrapy. You do not need to edit pipelines.py file for any project. This example can be used for all your project. Just yield you_data_dictionary from your Spider and inside pipelines.py a query will be created automat...

Page 86 of 99