text:
SpreeSizeChart
==============

SpreeSizeChart feature extracted from [http://www.hallyustyle.com](http://www.hallyustyle.com).

SpreeSizeChart is a spree extension helping your store to provide pertinent product information.

Example
-------

![Spree SizeChart Admin](http://i49.tinypic.com/27ybj8x.png)

![Spree SizeChart Store](http://i50.tinypic.com/wk2fs.png)

Installation
------------

To install SpreeSizeChart, just add the following to your Gemfile:

```ruby
# for spree 1.0.X
gem 'spree_size_chart', '~> 1.0.0'

# for spree 1.1.X
gem 'spree_size_chart', '~> 1.1.0'

```

Now, bundle up and run the generator:

```ruby
bundle
rails g spree_size_chart:install
```

Customization
-------------

The SizeChart markup should let you customize the way you want your SizeChart by using Deface or overriding views/spree/shared/_size_chart.html.erb in your spree app.

If you want to display yourself the size chart, just disable the deface :

```ruby
# disable size_chart, explicitly put in the view
Deface::Override.new( :virtual_path => "spree/products/show",
                      :name => "add_size_chart_to_show_product",
                      :replace => '',
                      :disabled => true)
```

See [Spree Guide](http://guides.spreecommerce.com/view_customization.html) for more information.

Todo
-------

- Better html markup and HTML test for customization
- Add translation to size type.

Compatibility
------------

Tested under Spree 1.0.4
Need feedback on Spree 1.1.X

Testing
-------

Be sure to bundle your dependencies and then create a dummy test app for the specs to run against.

    $ bundle
    $ bundle exec rake test_app
    $ bundle exec rspec spec

Contribute
----------

Pull requests for features and bug fix with tests are welcome.

Copyright (c) 2012 [Stephane BOUNMY], released under the New BSD License


text:
ansible-rbenv
====================================

[![Build Status](https://travis-ci.org/FGtatsuro/ansible-rbenv.svg?branch=master)](https://travis-ci.org/FGtatsuro/ansible-rbenv)

Ansible role for rbenv.

Requirements
------------

The dependencies on other softwares/libraries for this role.

- Debian
- OSX
  - Homebrew (>= 0.9.5)

Role Variables
--------------

The variables we can use in this role.

|name|description|default|
|---|---|---|
|rbenv_ruby_versions|Installed ruby versions with rbenv.|It isn't defined in default. No ruby is installed.|
|rbenv_global_version|This version is used as global in target host.|It isn't defined in default. Default version isn't set.|
|rbenv_login_shell|Login shell used when this role installs rbenv and ruby.|/bin/bash|

Role Dependencies
-----------------

The dependencies on other roles for this role.

- FGtatsuro.python-requirements
- FGtatsuro.anyenv

Example Playbook
----------------

    - hosts: all
      roles:
         - { role: FGtatsuro.rbenv }

Test on local Docker host
-------------------------

This project run tests on Travis CI, but we can also run them on local Docker host.
Please check `install`, `before_script`, and `script` sections of `.travis.yml`.
We can use same steps of them for local Docker host.

Local requirements are as follows.

- Ansible (>= 2.0.0)
- Docker (>= 1.10.1)

Notes
-----

- `anyenv_profile` variable of `FGtatsuro.anyenv` must exist on path `rbenv_login_shell` can load automatically. For example, the combination of `rbenv_login_shell=/bin/bash` and `anyenv_profile=.bash_profile` will be good.
- Tasks of this role are executed by `anyenv_owner`(variable of `FGtatsuro.anyenv`).
- If rbenv is already installed in different place from `anyenv_home`(variable of `FGtatsuro.anyenv`), this role mayn't work as you expect.

License
-------

MIT

license: MIT

repository: FGtatsuro/ansible-rbenv

branch_name: refs/heads/master

extension: md

gha_language: Ruby

gha_license_id: MIT

license_type: permissive

repo_name: FGtatsuro/ansible-rbenv


text:
---
layout: post
title: 1181 - Before And After Puzzle
date: 2020-01-01
tags:
- Leetcode
categories:
- Array
author: Jason
---
**Given a list of phrases, generate a list of Before and After puzzles. A phrase is a string that consists of lowercase English letters and spaces only. No space appears in the start or the end of a phrase. There are no consecutive spaces in a phrase. Before and After puzzles are phrases that are formed by merging two phrases where the last word of the first phrase is the same as the first word of the second phrase. Return the Before and After puzzles that can be formed by every two phrases phrases[i] and phrases[j] where i != j. Note that the order of matching two phrases matters, we want to consider both orders. You should return a list of distinct strings sorted lexicographically.**

```python
from collections import defaultdict
class Solution:
    def beforeAndAfterPuzzles(self, phrases: List[str]) -> List[str]:
        if not phrases:
            return []

        first = defaultdict(list)
        last = defaultdict(list)
        for i, phrase in enumerate(phrases):
            words = phrase.split()
            first[words[0]].append(i)
            last[words[-1]].append(i)

        ret = set()
        for w in set(first) & set(last):
            for i in first[w]:
                for j in last[w]:
                    if i != j:
                        ret.add(phrases[j] + phrases[i].split(w, 1)[1])
        return sorted(list(ret))
```

extension: markdown


text:
# My First Feature

A ForrestJS feature is an isolated module that implements existing hooks, creating new business value for the application.

## Install the Dependencies

In this toutorial we will use the hooks library in order to describe a modular application:

```bash
npm add @forrestjs/core
```

Also, we use [Nodemon](https://nodemon.io/) as development runner:

```bash
npm add -D nodemon
```

## Step By Step

- [The App Scaffold](./010-forrestjs-app-scaffold/README.md)
- [A Feature Anathomy](./020-forrestjs-feature-anathomy/README.md)
- [The Boot Order & App's Lifecycle](./030-forrestjs-app-lifecycle/README.md)

repository: forrestjs/forrestjs

gha_language: JavaScript

repo_name: forrestjs/forrestjs


text:
# OpenpayCashier

## Introduction

OpenpayCashier provides an expressive, fluent interface to [Openpay's](https://openpay.com) subscription billing services. It handles almost all of the boilerplate subscription billing code you are dreading writing. In addition to basic subscription management, OpenpayCashier can handle coupons, swapping subscription, subscription "quantities", cancellation grace periods, and even generate invoice PDFs.

## License

OpenpayCashier is open-sourced software licensed under the [MIT license](LICENSE.md).

repository: IvanSotelo/OpenpayCashier

repo_name: IvanSotelo/OpenpayCashier


text:
+++
draft = false
author = "jdhorwitz"
description = "Last week's Pony news, reported this week."
categories = [
    "Last Week in Pony",
]
title = "Last Week in Pony - July 29, 2018"
date = "2018-07-29T22:16:40-04:00"
+++

_Last Week In Pony_ is a weekly blog post to catch you up on the latest news for the Pony programming language. To learn more about Pony check out [our website](https://ponylang.io), our Twitter account [@ponylang](https://twitter.com/ponylang), or our [Zulip community](https://ponylang.zulipchat.com).

Got something you think should be featured? There's a GitHub issue for that! Add a comment to the [open "Last Week in Pony" issue](https://github.com/ponylang/ponylang.github.io/issues?q=is%3Aissue+is%3Aopen+label%3Alast-week-in-pony).
<!--more-->

## Items of note

- Pony 0.24.1 released: [Pony 0.24.1](https://www.ponylang.io/blog/2018/07/0.24.1-released/)

- Pony 0.24.2 released: [Pony 0.24.2](https://www.ponylang.io/blog/2018/07/0.24.2-released/)

- Pony Stable 0.1.5 and 0.1.6 released: [Pony Stable Releases 0.1.5 and 0.1.6](https://www.ponylang.io/blog/2018/07/pony-stable-0.1.5-and-0.1.6-released/)

repository: kapilash/ponylang-website

branch_name: refs/heads/main

repo_name: kapilash/ponylang-website


text:
# sphinx-design (IN-DEVELOPMENT)

[![Github-CI][github-ci]][github-link]
[![Coverage Status][codecov-badge]][codecov-link]
[![PyPI][pypi-badge]][pypi-link]

A sphinx extension for designing beautiful, view size responsive web components.

Created with inspiration from [Bootstrap](https://getbootstrap.com/) (v5), [Material Design](https://material.io) and [Material-UI](https://material-ui.com/) design frameworks.

## Usage

Simply pip install `sphinx-design` and add the extension to your `conf.py`:

```python
extensions = ["sphinx_design"]
```

## Supported browsers

- Chrome >= 60
- Firefox >= 60
- Firefox ESR
- iOS >= 12
- Safari >= 12
- Explorer >= 12

(Mirrors: <https://github.com/twbs/bootstrap/blob/v5.0.2/.browserslistrc>)

## Theme support

View the documentation in multiple themes:

- [alabaster](https://sphinx-design.readthedocs.io/en/alabaster-theme)
- [sphinx-book-theme](https://sphinx-design.readthedocs.io/en/sbt-theme)
- [pydata-sphinx-theme](https://sphinx-design.readthedocs.io/en/pydata-theme)
- [sphinx-rtd-theme](https://sphinx-design.readthedocs.io/en/rtd-theme)
- [furo](https://sphinx-design.readthedocs.io/en/furo-theme)

## Comparison to sphinx-panels

This package is an iteration on sphinx-panels and intends to replace it.

- Replaces `panel` directive with top-level `grid` + children `grid-item-card`
  - less "bespoke" syntax
  - `grid-item` can be used when no card is needed
  - `card` can be used independently of grids
- tabs changed:
  - top-level `tab-set`
  - `tabbed` -> `tab-item`
  - include `:sync:` option to synchronize tab selection across sets
- Minimises direct use of CSS classes (encourage to not use them)
  - More declarative, easy to understand options, easier to validate
  - Easier to work with non-HTML outputs
  - Easier to improve/refactor
- Updated Bootstrap CSS v4 -> v5
  - top-level grid can define both column numbers and gutter sizes
- All CSS classes are prefixed with `sd-` (no clash with other theme/extension CSS)
- All colors use CSS variables (customisable)

## TODO

- note design goal; to be flexible, but limit the amount of directive nesting required.
  This factors in to
  - card header/footer syntax? (don't really want to have to use separate directives for these, hence `^^^`/`+++` syntax)
  - auto-wrap `grid-item` and `tab-item`, if not already inside `grid` or `tab-set`?

grids items cannot contain headers; is this in anyway possible with docutils structure?

naming of directives/roles: standard prefix?

why are cards setup with "word-wrap: break-word;"?

handle latex

Use autoprefixer when compiling SASS (see <https://getbootstrap.com/docs/5.0/getting-started/browsers-devices/#supported-browsers>)

horizontal card (grid row inside card, picture on left)

horizontally scrollable cards: (see <https://stackoverflow.com/questions/35993300/horizontally-scrollable-list-of-cards-in-bootstrap>)

subtitle for card (see <https://material.io/components/cards#anatomy>)

paragraph and tab-set in grid-item

rtd PRs not working

size octicons to 1rem etc

empty grid item

[github-ci]: https://github.com/executablebooks/sphinx-design/workflows/continuous-integration/badge.svg?branch=main
[github-link]: https://github.com/executablebooks/sphinx-design
[codecov-badge]: https://codecov.io/gh/executablebooks/sphinx-design/branch/main/graph/badge.svg
[codecov-link]: https://codecov.io/gh/executablebooks/sphinx-design
[pypi-badge]: https://img.shields.io/pypi/v/sphinx-design.svg
[pypi-link]: https://pypi.org/project/sphinx-design


text:
---
id: environment_art
name: Environment Art in Core
title: Environment Art in Core
tags:
    - Tutorial
---

# Environment Art in Core

![Finished Scene](../img/EnvironIntro/EnvironmentalArt/EnvironmentalArt_FinishedScene.png){: .center loading="lazy" }

## Overview

Learn how to generate, sculpt, and paint terrain, as well as adding foliage and a swimmable water post-process effect. This tutorial will focus on making a landscape with a path and river, but can be customize to build any natural environment.

- **Completion Time:** 30 minutes
- **Previous Knowledge:** [Introduction to the Core Editor](editor_intro.md)
- **Skills you will learn:**
    - Creating and sculpting terrain
    - Creating swimmable volumes
    - Painting terrain and foliage
    - Customizing sky templates
    - Adding rain visual effects

## The Terrain Creator

The Terrain Creator tool creates different landscapes using premade HeightMaps.

### Open the Terrain Creator

1. Start from a new empty project.
2. Click the ![Terrain](../img/EditorManual/icons/Icon_Terrain.png) button to open the **Terrain Creator**.
 {: .image-inline-text .image-background .image-background}
3. Choose **Generate New Terrain** from the drop down menu.

![Open Terrain Creator](../img/EnvironIntro/edits/TerrainTutorial/OpenTerrainCreator.png){: .center}

### Generate Terrain

There are different options for types of terrain that can be generated in Core. You can click any of the terrain types to see a description of what it will generate.

1. Select **Rolling Hills**.
2. Change the size to ``256 x 256`` voxels and ``0.50`` meters.
3. Click **Generate**.
4. Press ![Play](../img/EditorManual/icons/Icon_Play.png) or ++equal++ to explore the newly generated terrain from a player perspective.
 {: .image-inline-text .image-background .image-background}

![ArtIntro](../img/EnvironIntro/image36.png "Art Screenshot"){: .center loading="lazy" }

### Rearrange the Scene

You may have fallen through your terrain, and you may see an unusually flat area where Default Floor still exists in the scene.

1. Find the **Spawn Point** in the **Hierarchy** and move it to a new spot, above the terrain and just outside of the default floor.
2. Right click on **Default Floor** in the **Hierarchy** and select **Delete**.
3. Click the ![Terrain](../img/EditorManual/icons/Icon_Terrain.png) **Terrain** button again to see that it now lists the **Terrain (Rolling Hills)** as **Primary**
 {: .image-inline-text .image-background .image-background}

!!! note
    Primary Terrain is the terrain in your scene with collision enabled. You can have multiple terrains, but only one that players can actually walk on.

### Apply a Material

Any material can be added to a terrain. However, materials that begin with "Terrain" are designed to be used for terrain and will apply different textures to the steeper and flatter parts of the terrain.

1. Open the **Materials** tab of **Core Content**.
2. Test out different materials by dragging them onto the terrain.
3. Search the **Core Content** tab for  `terrain`.
4. Find **Terrain - Grass** and drag it onto the terrain.

![Add a Material to the Terrain](../img/EnvironIntro/EnvironmentalArt/EnvironmentalArt_AddGrassMaterial.png)

## Terrain Sculpting

### Open the Sculpt Menu

The shape of terrain can be changed using sculpting tools in the **Properties** menu.

1. Select the terrain in the **Hierarchy**.
2. Open the **Properties** window.
3. Click on the ![Terrain Sculpt](../img/EditorManual/icons/Icon_TerrainSculpt.png){: .image-inline-text .image-background } icon to open the **Sculpt** menu..

![Sculpt Tool Menu](../img/EnvironIntro/edits/TerrainTutorial/SculptToolSetup.png){: .center}

### Create a Flat Area

![Select Level Tool](../img/EnvironIntro/EnvironmentalArt/EnvironmentalArt_ConfigureLevelTool.png){ .center loading="lazy" }

1. In the **Tool** menu, select the ![Level](../img/EditorManual/icons/Icon_TerrainLevel.png){: .image-inline-text .image-background } **Level** tool.
2. Click on an area that is the ideal height, then drag around it to make the rest of the terrain match.

![Leveled Terrain](../img/EnvironIntro/EnvironmentalArt/EnvironmentalArt_LeveledArea.png){ .center loading="lazy" }

### Carve out a Pond and Stream

1. In the **Tool** menu, select the ![Surface](../img/EditorManual/icons/Icon_TerrainSurface.png){: .image-inline-text .image-background } **Surface** tool.
2. Change the mode from ![Additive](../img/EditorManual/icons/Icon_TerrainPull.png){: .image-inline-text .image-background } **Additive** to ![Destructive](../img/EditorManual/icons/Icon_TerrainPush.png){: .image-inline-text .image-background } **Destructive**.
{: .image-inline-text .image-background}
3. Lower the **Strength** value in the **General** subcategory to ``0.1``
4. Click and drag on the terrain to carve bowl shape for a pond, and extend it to a river on either side.

![Carved Pond and River](../img/EnvironIntro/EnvironmentalArt/EnvironmentalArt_CarvePondAndRiver.png){: .center loading="lazy" }

### Smooth the Terrain

1. Change the sculpting tool from ![Terrain Sculpt](../img/EditorManual/icons/Icon_TerrainSurface.png){: .image-inline-text .image-background } **Surface** to ![Terrain Smooth](../img/EditorManual/icons/Icon_TerrainSmooth.png){: .image-inline-text .image-background } **Smooth**.
2. Click and drag the pond  and rivers to give it a more natural appearance.

![Smoothed Pond and River](../img/EnvironIntro/EnvironmentalArt/EnvironmentalArt_SmoothedPond.png){: .center loading="lazy" }

## Water and Swimming

### Add a Cube to the Scene

1. Search for a cube in the **Core Content** window.
2. Drag the cube into the scene, above the spaces sculpted for the water.

![Add Cube to Scene](../img/EnvironIntro/EnvironmentalArt/EnvironmentalArt_ResizeACube.png){: .center loading="lazy" }

### Resize and Reposition the Cube

1. Resize the cube until it fills your crater.
2. Move the cube down until it looks like a pool of water inside the sand dunes.

![Move Cube Down for Water](../img/EnvironIntro/EnvironmentalArt/EnvironmentalArt_PositionTheCube.png){: .center loading="lazy" }

### Add a Material

1. Search **Core Content**  for ``water``.
2. Choose a water material, and drag it onto the cube.
3. Preview the scene to see the water in person.

![Cube with Water Material](../img/EnvironIntro/EnvironmentalArt/EnvironmentalArt_AddWaterMaterial.png){: .center loading="lazy" }

!!! note
    Select the **Cube** in the Hierarchy and press ++F2++ to rename it to **Water Cube**.

### Disable Collision on the Water

The water cube now has the appearance of water, but a player will walk over it, rather than into it, because the cube has collision by default.

![Force Off Collision](../img/EnvironIntro/EnvironmentalArt/EnvironmentalArt_ForceOffCollision.png){: .center loading="lazy" }

1. Select the water cube.
2. On the **Properties** window, and find the **Scene** section.
3. Change the **Collision** property to **Force Off**.
4. Preview again to test that you can now pass through the water as a player.

### Use the Underwater Post Process

Now you can pass through the water, but once inside it looks like the volume disappears. We can use the **Underwater Post Process** volume to achieve an underwater effect.

1. Find the **Underwater Post Process** volume under the **Post Processing** section of **Core Content**.
2. Drag it into your scene on top of your water.

![Find Underwater Post Process](../img/EnvironIntro/EnvironmentalArt/EnvironmentalArt_FindUnderwaterPostProcess.png){: .center loading="lazy" }

### Resize the Underwater Post Process

Core makes it easy to copy properties from one object to another. We can use this to make the Underwater Post Process match the size and position of the Water cube.

1. Select the cube that represents the water and open **Properties** window.
2. Click the ![Copy Properties](../img/EnvironIntro/edits/TerrainTutorial/Icon_PropertyCopy.png){: .image-inline-text .image-background}**Copy Properties** button in the top right corner.
3. Select the **Underwater Post Process** volume and return to the **Properties** window.
4. Click the ![Paste Properties](../img/EnvironIntro/edits/TerrainTutorial/Icon_PropertyPaste.png){: .image-inline-text .image-background} **Paste Properties** button, in the top right corner.
5. Check **Position**, **Rotation** and **Scale** in the menu that pops up and press **Paste Selected Parameter Values**

![Copy and Paste Properties](../img/EnvironIntro/EnvironmentalArt/EnvironmentalArt_CopyPasteProperties.png){: .center loading="lazy" }

### Test Swimming

With the Underwater Post Process in the same area as the water, you should now start swimming automatically when you enter it. Press **Play** to preview and jump in the water. If it is deep enough, your character should switch to the swimming animation. You will also notice some distortion and color in the water. You can change how these work in the **Properties** menu for the Underwater Post Process.

![Swimming](../img/EnvironIntro/EnvironmentalArt/EnvironmentalArt_Swimming.png){: .center loading="lazy" }

## Terrain Painting

### Open the Terrain Painting Tool

The terrain painting tool is also found in the terrain **Properties** tab. Terrains must have painting enabled, and this can be done through the painting menu.

1. Select the terrain in the **Hierarchy**.
2. Open the **Properties** window.
3. Click on the ![Terrain Sculpt](../img/EditorManual/icons/Icon_TerrainPaint.png){: .image-inline-text .image-background } icon to open the **Paint** menu..
4. Click **Create new terrain material**

This will change the terrain's material to **Terrain Material**, but keep the grassy appearance.

### Choose Materials

To paint terrain, we need to create a palette of materials to use on the terrain. In the **Palette** section, select **Edit Materials**

Each of the Materials, labeled **Material1** through **Material4** corresponds to one of the visible materials in the **Paint** menu. Each has two Materials channels, one for flat sections of the material, **Material Base**, and another for the steeper, vertical sections of the game, **Material Side**.

### Paint a Path

1. In the Edit Materials menu, find **Material2**
2. Click the empty image next to **Material Base** to open the **Material Picker**
3. Select **Bricks Cobblestone Floor 01**
4. Close the Edit Materials menu.
5. Select the second Material in the Paint menu **Palette**
6. In the **General** section, increase the **Target Value** value to ``0.4`` to blend the brick material with the grass.
7. Click and drag where you want a path to create some stones coming out of the grass.

![Terrain Painted Path](../img/EnvironIntro/EnvironmentalArt/EnvironmentalArt_StonePath.png){: .center loading="lazy" }

!!! Hint
    You can hold ++Alt++ while dragging on the scene to unpaint materials from areas that you recently painted.

### Paint the River Bottom

#### Choose the Materials

![Choose Riverbed Materials](../img/EnvironIntro/EnvironmentalArt/EnvironmentalArt_SelectRiverBottom.png){: .center loading="lazy" }

1. In the Hierarchy, click the **eye** icon next to the Water Cube to hide it temporarily.
2. In the Edit Materials menu, find **Material3**
3. Set the **Material Base** to **Rocks River Bed 01**
4. Set the **Material Side** to **Grass and Soil** and close the Edit Materials menu.

#### Paint the River

1. Select the third Material in the Paint menu **Palette**
2. Click and drag along the river to cover it with the new materials.
3. Click the **eye** icon next to the Water Cube to show it again

![Painted River](../img/EnvironIntro/EnvironmentalArt/EnvironmentalArt_PaintedRiver.png){: .center loading="lazy" }

#### Preview the Materials Underwater

Press the **Play** button to preview the new materials under the Underwater Post Process effect by swimming through the river.

![River Materials Underwater](../img/EnvironIntro/EnvironmentalArt/EnvironmentalArt_SwimmingTheRiver.png){: .center loading="lazy" }

### Paint the River Bank

#### Using a Mask

Masks allow you to use more complex shapes in applying a new material.

1. In the Edit Materials menu, find **Material4**
2. Set the **Material Base** to **Rocks River Bed 01**
3. In the **Mask** section, check the **Use Mask** box.
4. Click the image icon in the **Mask** property, and select **Cells**

![Cells Mask for Painting Materials](../img/EnvironIntro/EnvironmentalArt/EnvironmentalArt_PaintWithMask.png){: .center loading="lazy" }

#### Using Wetness

Terrain materials can be further customized **Wetness**. It allows you to make areas look soaked by making them darker and shinier.

1. Select **Wetness** from the **Modifiers** section of the Palette.
2. Click and drag on the edge of the riverbank to give an impression that it is soaked on the edges.

![Painted Wetness Channel](../img/EnvironIntro/EnvironmentalArt/EnvironmentalArt_PaintedWetnessChannel.png){: .center loading="lazy" }

## Foliage

In addition to painting textures, objects can be added to the terrain materials as **foliage**. These will not have collision and will be made to work better on a machine than just adding lots of objects.

### Open the Foliage Tool

In the **Properties** window with the terrain selected, click the tab next to **Paint** called **Foliage**

### Choose Foliage

1. Click the **Add Foliage** button.
2. In the **Static Mesh Picker**, search for ``grass`` to find **Grass Tall**.

### Access Foliage Settings

You should have grass springing up on your terrain as soon as you add the object. Click on the object image that appears now in the **Foliage** tab to see its customizable properties.

![Grass on the Grassy Terrain](../img/EnvironIntro/EnvironmentalArt/EnvironmentalArt_GrassOnGrass.png){: .center loading="lazy" }

### Grow Grass along the River

Next, we're going to change the river to look more like a marsh by filling it with tall grasses.

![Foliage with Tall Grass Selected](../img/EnvironIntro/EnvironmentalArt/EnvironmentalArt_FoliageProperties.png){: .center loading="lazy" }

1. In the **General** section,  change the **Material Channel** to the third material, the one used to paint the river.
2. Change the **Distance Between Instances** to ``2.0m``.
3. In the **Spawn Settings**, change the **Scale** property to have a ``Min 3.0x``.
4. You can now return to the **Paint** menu to repaint with the River bottom material any areas that are missing grasses. The foliage will generate with the terrain paint.

![Grass along the River](../img/EnvironIntro/EnvironmentalArt/EnvironmentalArt_GrassTaller.png){: .center loading="lazy" }

!!! Hint
   If foliage is spawning in unexpected places, use the **Show Debug Material** option in the **Paint** terrain **Palette** menu to check which material is being applied in any area of the terrain.

## Stormy Ambience

In the next few steps, we will focus on making the scene overcast and rainy, as well as adding props. There are many options to customize for different effects.

### Change the Sky

The **Default Sky** in Core is composed of three parts, **Sun Light** and **Sky Light** which are currently the only two sources of light in the scene, and **Sky Dome** which controls the appearance of the sky. Each of these can be customized through the **Properties** menu.

There are other complete sky templates available, as well as the different versions of these individual components.

1. Search for ``sky overcast`` in **Core Content** and find the **Sky Overcast 01** template.
2. Drag the sky template into the scene.
3. Delete the **Default Sky** template.

![Overcast Sky](../img/EnvironIntro/EnvironmentalArt/EnvironmentalArt_Overcast.png){: .center loading="lazy" }

### Customize the Sky

1. Open up the **Sky Overcast 01** folder in the **Hierarchy**.
2. Select the **Environment Fog Default VFX** and open the **Properties** window.
3. In the **Smart** section, change the **Color** property to a bright white.
4. Increase the **Fog Density** property to whatever value gives the scene a misty look.

### Add Rain

1. In **Core Content** search for ``rain`` and add the **Rain Volume VFX** and **Rain Splash Volume VFX** objects to your scene.
2. Place the **Rain Volume VFX** object up in the sky, and expand it using the **Transform Scale** tool to cover the area with droplets falling from the sky
3. Place the **Rain Splash Volume VFX** on the ground and expand it to cover the area under the rain to create splashes on the ground.

![Overcast Sky](../img/EnvironIntro/EnvironmentalArt/EnvironmentalArt_FinishedScene.png){: .center loading="lazy" }

### Finish the Scene

The final step is to add structures and props that finish the scene. See the [Complex Modeling](modeling.md) and [Community Content](community_content.md) reference to learn about creating props and using props made by other Core creators.

## Learn More

[Custom Materials](custom_materials.md) | [Complex Modeling](modeling.md) | [Community Content](community_content.md) | [Visual Effects](vfx_tutorial.md)

repository: PopThosePringles/platform-documentation

branch_name: refs/heads/development

repo_name: PopThosePringles/platform-documentation


text:
# UIU_Smart_Card
Support android application of UIU Smart Card Project for taking attendance and making payments in a modern and automated way using RFID technology coupled with NodeMCU.

Demo Video Of The Android Application: https://youtu.be/Y_koTdcVOfI <br>
Demo Video Of The Entire Project : https://youtu.be/2hITx4YWFkU

Web Application: https://github.com/sayam56/UIU-Smart-Card-Web-App

gha_language: Java


text:
---
layout: cos
title: The Old Bonegrider
---

![Header](/images/header_hags.jpg)

### Overview
After they leave [Tser Pool Encampment](https://thevinter.github.io/2018/12/31/tser-pool-encampment/) your players will most certainly encounter the Old Bonegrinder: a massive and spooky windmill in the middle of some misty fields.

This is a high level area and I'm pretty sure did this intentionally. The party will be around level 4 here and they won't be able to kill three hags if they anger them.

I really like the **Old Bonegrinder**. It's probably my favourite zone in all of Barovia.

### Deadly Premonitions

One way of steering this players away from this area is making use of the crow. Crows are always seen as bad omens, so if you describe one of them circling and croaking above their heads they will be cautious.

But other than that I wouldn't stress too much on this, you don't want to give away immediately the dark secret of the Bonegrider.

### The Hags

The hags aren't really chaotic evil, or rather, they won't kill the characters on sight. They will invite the players inside, make them sit in front of the fireplace and tell them some stories of Barovia while asking questions and trying to gather as much information as they can.

They will present themselves as poor old grannies trying to survive in Barovia by making and selling pastries. If asked what's inside they will tell that they have multiple types: meat ones (made from chickens), vegetable ones (made from vegetables bought in Vallaki) and empty ones.

They will then try to sell some pastries to the players, but not without giving them a free sample. Try to keep this as natural as possible and don't force it on the players.

If the players ask to go upstairs the hag will tell them that her sister is walking and doesn't like to be bothered. And also that "Mommy isn't home, you should ask her. She will be back in an hour". This phrase is a reference to Morgantha which is out selling pastries.

### Fighting the Evil

If there's a paladin in the party they might notice an aura of evil coming from the windmill. The hags will justify it by saying that "an old witch once cast a spell on this windmill preventing it from working thanks to the wind. Now we have to manually rotate the shovels. Have you seen our humps?

The hags won't fight back unless it's really necessary. They will drop down on their knees, calling the party "murderers, and awful people for going after an old granny like this".

After a couple of turns Morgantha comes home, and after seeing the scene tries to strike a deal with the party. Hags are known for offering deals to people and this ones are no exception.

She will promise some spell, a powerful item, or some secret if the characters stop fighting and do something for her.

An example of such a request could be to go and sell some pastries to Vallaki, a place where they didn't have yet the chance to expand the market.

Try to challenge the morality of the players and make them do deeds  that at first seem innocuous but turn out to be evil

If not even  a deal satisfies the players then make the hags disappear using their magical artifacts. Let the players explore the bonegrider and free the children and leave safely.

The hags will be perfect for a recurrent villain ;)


text:
# Introduction

Computer Vision is an exciting new field with the recent advances in
deep learning. This documentation serves to compile knowledge
acquired through various courses and online readings.
Note that I do not claim copyright over any of these code, and you may
attribute any of the resources I tagged to them instead.

repository: Dhinagaran-s/computer-vision-python

repo_name: Dhinagaran-s/computer-vision-python


text:
# Tu><board [![Build Status](https://jdanylko.visualstudio.com/Tuxboard/_apis/build/status/jdanylko.Tuxboard?branchName=master)](https://jdanylko.visualstudio.com/Tuxboard/_build/latest?definitionId=3&branchName=master) [![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)

![Tuxboard Example](images/TuxboardExample.png)

Tuxboard is a dashboard framework specifically for the ASP.NET Core platform. It was meant to be
a Lego-style way to build dashboards.

#### Technology Stack

  - ASP.NET Core 3.1 (using C#)
  - Entity Framework Core 3.1
  - Bootstrap.native 4.x (w/ NO jQuery)
  - FontAwesome 5
  - Web Essentials (for Markdown, Task Runner/Gulp integration, bundler, etc.)

#### Features

 * Easily attach a dashboard to your project
 * Customize dashboards for general audiences (a static dashboard), user-based dashboards, or even role-based dashboards (both dynamic dashboards).
 * Extend your dashboard by building dynamic or static widgets.
 * Small, compact code for performance in C# and JavaScript (native JavaScript)
 * While the Tuxboard uses Bootstrap, easily conform Tuxboard to any CSS Framework.

#### Why build a Dashboard framework
In my career, I've built a number of dashboards from scratch.
As with all projects, each dashboard had pluses and minuses as each project completed.

Even with existing libraries out there, there really wasn't anything out there for the ASP.NET platform.

So the initiative was set to write one.

The developer could start with a simple structure where
ANY type of dashboard could be generated quickly and
provide an easy front-end with
their own custom widgets and robust layouts.

## Getting Started

Please check the [Wiki](https://github.com/jdanylko/TuxBoard/wiki) for installation.


text:
---
title: Mapping snowmelt progression in the Upper Indus Basin with synthetic aperture
  radar
date: '2019-01-01'
publishDate: '2022-12-05T20:14:04.948402Z'
authors:
- Jewell Lund
- Richard Robert Forster
- Summer B. Rupper
- H. P. Marshall
- Elias J. Deeb
- Muhammad Zia Ur Rahman Hashmi
publication_types:
- '2'
abstract: The Indus River is a vital resource for food security, ecosystem services,
  hydropower, and economy for millions of people living in Pakistan, India, China,
  and Afghanistan. Glacier and snowmelt from the high altitude Himalaya, Karakoram,
  and Hindu Kush mountain ranges are the largest drivers of discharge in the Upper
  Indus Basin, and contribute significantly to Indus flows. Complex climatology and
  topography, coupled with the challenges of field study and meteorological measurement
  in these rugged ranges, elicit notable uncertainties in predicting seasonal runoff
  as well as cryospheric response to changes in climate. Here we utilize Sentinel-1
  Synthetic Aperture Radar (SAR) imagery to track ablation season development of wet
  snow in the Shigar Watershed of the Karakoram Mountains in Pakistan from 2015-2018.
  We exploit opportune local image acquisition times to highlight diurnal differences
  in radar indications of wet snow, and examine the spatial and temporal contexts
  of radar diurnal differences for 2015, 2017, and 2018 ablation seasons. Radar classifications
  for each ablation season show spatial and temporal patterns that indicate a dry
  winter snowpack undergoing diurnal surface melt-refreeze cycles, transitioning to
  surface snow that remains wet both day and night, and finally snow free conditions
  following melt out. Diurnally differing SAR signals may offer insights into important
  snowpack energy balance processes that precede melt out, which could provide useful
  constraints for both glacier mass balance modeling and runoff forecasting in remote
  alpine watersheds.
featured: false
publication: '*Frontiers in Earth Science*'
tags:
- '"diurnal radar"'
- '"Indus river"'
- '"Karakoram Mountains"'
- '"Sentinel-1"'
- '"snowmelt"'
- '"Synthetic aperature radar"'
url_pdf: https://www.frontiersin.org/articles/10.3389/feart.2019.00318/full
doi: 10.3389/feart.2019.00318
---

repository: highmountainasia/himat-website

gha_language: TeX

repo_name: highmountainasia/himat-website


text:
# Hyperbone Router

## This is no longer being maintained.

It has been replaced by [HalogenJS](https://github.com/halogenjs/router)

[![Build Status](https://travis-ci.org/green-mesa/hyperbone-router.png?branch=master)](https://travis-ci.org/green-mesa/hyperbone-router)

Of all the parts of Hyperbone, this is probably the most peculiar and least necessary: Hyperbone is made of individual modules and just about any router will do in place of this.

However, right now, we need a router that supports express style routes **and** hashbangs, so this is what this is for. It's also designed to be at least in the Hyperbone family - it makes use of Hyperbone events for registering callbacks. Page activation and page teardown are the priority rather than server side style middleware.
## Features

- Hashbang based because the particular usecase we have for this module requires this
- Express/Sinatra style route syntax `/blah/:someparam/:someotherparam` etc
- Hyperbone event based. `on('activate', fn)`
- Some handy conventions for Hyperbone models

## Installation

Browserify

```sh
$ npm install --save hyperbone-router
```

## Tests

Clone the repo, do an npm install, install grunt-cli if you don't already have it then
```js
$ npm test
```

## Example Usage

This example is how this router might be used with Hyperbone Model and Hyperbone View for a single screen application that has multiple virtual pages. We start with an application model that contains a separate model for each route, and then we bind the HTML to that model. Using the `hb-with` attribute we can turn sections of the HTML into partials for each route model.

Every time a route is activated we update the model for that route. That could be via code or by updating the uri and then fetching from a server. Either way the view is updated automatically.

Setting up the application model and the view...

```js
var Router = require('hyperbone-router').Router;

// our appModel contains two models
var appModel = new HyperboneModel({
	// our list of products. Note the HAL hypermedia..
	productList : [
		{
			_links : {
				self : {
					href : "/products/product-1"
				}
			},
			title : "Some product"
		},
		{
			_links : {
				self : {
					href : "/products/product-1"
				}
			},
			title : "Some other product"
		}
	]
	// a stub model for the product route
	product : {
		active : false
	},
	// a stub model for the resource route
	resource : {
		active : false
	}
});

// bind our application model to our HTML
var view = new HyperboneView({
	el : '#application-root',
	model : appModel
});
```

This is some example HTML. It shows how we render the list of products, taking advantage of the hypermedia extensions to get the correct uri and using `hb-with` to change the scope from the application model to our route models.

The `if="active"` means that if product.active is true then the product section element will be displayed.

```html
<section id="applications-root">
	<section>
		<ul hb-with="product-list">
			<li><a href="#!{{url()}}">Product: {{title}}</a></li>
		</ul>
	</section>
	<section hb-with="product" if="active">
		<h3>I'm the product route. This is product ID {{id}}</h3>
		<ul hb-with="resource-list">
			<li><a href="#!{{url()}}">Resources in our product: {{title}}</a></li>
		</ul>
	</section>
	<section hb-with="resource" if="active">
		<h3>{{title}}</h3>
		<p>{{description}}</p>
	</section>
</section>
```
Now we need to do a little more coding to set up our logic around handling various routes. This is *not* our business logic - we just want to make sure the right section is displayed depending on the route.

We don't care here about anything that happens after we've loaded data from a server, or what happens while we're on a particular route.
```js
var app = new Router();

app
	.route('/products/:id') // this route will match any products
		.on('activate', function(ctx, uri){
			// ctx is our context. it has any params gathered from the route.
			// see component/page.js for more

			// set active as true so that the product section is displayed
			appModel.set('product.active', true);

			// set the id part of the url as an attribute on our model
			appModel.set('product.id', ctx.id);

			// update the uri for the product model
			// and trigger a load from the server...
			appModel.get('product')
				.url(uri)
				.fetch();

		})
		.on('deactivate', function(uri){

			// set product.active to false which
			// because of our 'if' attribute will
			// hide the product section
			appModel.set('product.active', false);
		})
	.route('/resources/:id') // this route will match any resources
		.on('activate', function(ctx, uri){

			// same again for resources but in a slightly
			// different style
			var resources = appModel.get('resource');
			resource
				.set({
					id : ctx.id,
					active : true
				})
				.url(uri)
				.fetch();

		})
		.on('deactivate', function(uri){

			var resource = appModel.get('resource');
			resource.set('active', false);

		});
// finally we want the application to start listening for hashchange (History API support may come later)
app.listen();
```

Because marking a route `active = true` and `active = false` is always going to be necessary, Hyperbone Router can do this for you. If you pass a model when defining the route, it will automatically add an activate and deactivate handler that toggles 'active' on and off.

```js
app
	.route('/product/:id', appModel.get('product'))
		.on('activate', function( ctx, uri ){
			var product = appModel.get('product');
			product.url( uri );
			product.set('id', ctx.id);
			product.fetch();
		})
	.route('/resource/:id', appModel.get('resource'))
		.on('activate', function( ctx, uri ){
			var resource = appModel.get('resource');
			resource.url( uri );
			product.set('id', ctx.id);
			product.fetch();
		})
	.listen();
```

## API

### Router()

Create a new Router instance

### Router#route( path )

Create a new route.

### Router#route( path, model )

Create a new route and use some default activate/deactivate handlers to toggle the 'active' attribute true and false. This can be used in your view to turn sections of the page on and off.

### Router#route( path [, model]).on( event, callback )

A route is a Hyperbone event emitter. The two significant events are 'activate' and 'deactivate'. Activate handlers are passed a context object `ctx` which contains the paramters of the url as per PageJS. It is shared between all activate handlers for that route. You can register as many activate handlers as you like.

### Router#listen()

Begin listening for routes

### Router#navigateTo(uri, options)
### require('hyperbone-router').navigateTo(uri, options)

Navigate to a different route. If you want to make sure that the route handlers fire even if the route hasn't changed, use `{trigger : true}` as per Backbone as `options`.

## License

  MIT

repository: nice-digital/hyperbone-router

repo_name: nice-digital/hyperbone-router


text:
[Intrinsic triangulations](/surface/intrinsic_triangulations/basics) provide high quality _function spaces_, even on near-degenerate geometry, which dramatically improves the accuracy of PDE-based algorithms (e.g. the heat-based methods in geometry-central). However, these accurate solutions live on the intrinsic triangulation, and cannot be represented exactly as piecewise-linear functions on the original mesh.

Given an input mesh of some surface, and an [intrinsic triangulations](/surface/intrinsic_triangulations/basics) of that surface (which may have additional vertices inserted), these functions allow you to transfer values between the two domains via several different strategies.

## Pointwise Transfer at Vertices

The simplest method to transfer functions between two triangulations of the same surface is to simply copy values at vertices.  The following methods, from the `IntrinsicTriangulation` class, implement this simple transfer scheme in both the forward and reverse direction.

??? func "`#!cpp VertexData<T> IntrinsicTriangulation::sampleFromInput(const VertexData<T>& dataOnInput)`"

    Given data defined on the vertices of the input triangulation, samples it to the vertices of the intrinsic triangulation.

    If the intrinsic triangulation contains new, inserted vertices which are not in common with the input triangulation, they sample a linearly-interpolated value from the input function.

??? func "`#!cpp VertexData<T> IntrinsicTriangulation::restrictToInput(const VertexData<T>& dataOnIntrinsic)`"

    Given data defined on the vertices of the intrinsic triangulation, restrict it to the vertices of the input triangulation (that is, simply copy values from the shared vertices).

    If the intrinsic triangulation contains new, inserted vertices which are not in common with the input triangulation, their values are ignored for the purposes of restriction.

## Transfer to the Common Subdivision

Another possibility is to transfer data to the [common subdivison](/surface/intrinsic_triangulations/common_subdivision), a special triangulation which is a superset of both the input and the intrinsic triangulation. This transfer is easy to define, because the common subdivision is precisely the triangulation whose linear bases can exactly represent functions from either the input or intrinsic triangulation.

Of course, unlike the other methods described on this page, this strategy _does not_ transfer functions directly between an input triangulation and an intrinsic triangulation, but rather transfers values from either the input or intrinsic triangulation _to_ the common subdivision.

One common use for transferring values to the common subdivision is visualization, because the common subdivision is naturally embedded in space as an ordinary mesh.

??? func "`#!cpp VertexData<T> CommonSubdivision::interpolateAcrossA(const VertexData<T>& dataA)`
`#!cpp VertexData<T> CommonSubdivision::interpolateAcrossB(const VertexData<T>& dataB)`"

    Linearly interpolates data on `meshA` (resp. `meshB`) to the common subdivision.

??? func "`#!cpp FaceData<T> CommonSubdivision::copyFromA(const FaceData<T>& dataA)`
`#!cpp FaceData<T> CommonSubdivision::copyFromB(const FaceData<T>& dataB)`"

    Copy data at faces from one of the meshes to the common subdivision. Each face of the common subdivision gets the value from the face which contains it. The return value is defined per-face of the common subdivision mesh.

??? func "`#!cpp SparseMatrix<double> CommonSubdivison::interpolationMatrixA()`
`#!cpp SparseMatrix<double> CommonSubdivision::interpolationMatrixB()`"

    Yields a `|V| x |V_A|` matrix (resp. `|V| x |V_B|`) which linearly interpolates data on `meshA` (resp. `meshB`) to the common subdivision. Here `|V|` denotes the number of vertices in the common subdivision.

## L2-Optimal Transfer

`#include "geometrycentral/surface/transfer_functions.h"`

When transferring data directly between the input triangulation and intrinsic triangulation, simple sampling values is naive, and has no reason to be the "best" approach.  Instead, one can directly compute the function on the other surface, in the sense of $L_2$-distance between functions---see [Integer Coordinates for Intrinsic Geometry Processing](https://arxiv.org/pdf/2106.00220.pdf) for details.

Computationally, this amounts to solving a sparse linear least-squares problem defined via the common subdivision. Though somewhat more expensive, this approach can greatly improve accuracy.

### Single Transfer Functions

A one-off utility function is provided which transfers functions between different triangulations of the same surface.
Repeated solves should use the stateful version below.

Example
```cpp
#include "geometrycentral/surface/meshio.h"
#include "geometrycentral/surface/signpost_intrinsic_triangulation.h"
#include "geometrycentral/surface/transfer_functions.h"

// Load a mesh
std::unique_ptr<SurfaceMesh> mesh;
std::unique_ptr<VertexPositionGeometry> geometry;
std::tie(mesh, geometry) = loadMesh(filename);

// Create an intrinsic triangulation
SignpostIntrinsicTriangulation intTri(*mesh, *geometry);

// Change the intrinsic triangulation
intTri.delaunayRefine();

// Compute something useful on the intrinsic triangulation
VertexData<double> f_intrinsic = /* some function */

// Transfer function back to extrinsic mesh
VertexData<double> f_extrinsic = transferBtoA(intTri, f_intrinsic, TransferMethod::L2);
```

??? func "`#!cpp VertexData<double> transferAtoB(IntrinsicTriangulation& intTri, const VertexData<double>& valuesOnA, TransferMethod method)`"
    Transfers a scalar function from `intTri.inputMesh` to `intTri.intrinsicMesh`

    - `valuesOnA` : the data on `intTri.inputMesh` to be transferred.

    - `method` : either `TransferMethod::Pointwise` for pointwise transfer of `TransferMethod::L2` for $L^2$-optimal transfer.

??? func "`#!cpp VertexData<double> transferBtoA(IntrinsicTriangulation& intTri, const VertexData<double>& valuesOnB, TransferMethod method)`"
    Transfers a scalar function from `intTri.intrinsicMesh` to `intTri.inputMesh`

    - `valuesOnB` : the data on `intTri.intrinsicMesh` to be transferred.

    - `method` : either `TransferMethod::Pointwise` for pointwise transfer of `TransferMethod::L2` for $L^2$-optimal transfer.

### Transfer Method

The `method` argument is an enum:

```cpp
enum class TransferMethod { Pointwise = 0, L2 };
```

for completeness, the`TransferMethod::Pointwise` option implements the [pointwise transfer](/surface/intrinsic_triangulations/function_transfer/#pointwise-transfer-at-vertices) described above, while `TransferMethod::L2` is the optimal scheme described here.

### Repeated Transfer Functions

If many functions are to be transferred, pre-factoring the linear least-squares problem can greatly improve performance.  The stateful class `AttributeTransfer` facilitates this precomputation.

```cpp
#include "geometrycentral/surface/meshio.h"
#include "geometrycentral/surface/signpost_intrinsic_triangulation.h"
#include "geometrycentral/surface/transfer_functions.h"

// Load a mesh
std::unique_ptr<SurfaceMesh> mesh;
std::unique_ptr<VertexPositionGeometry> geometry;
std::tie(mesh, geometry) = loadMesh(filename);

// Create an intrinsic triangulation
SignpostIntrinsicTriangulation intTri(*mesh, *geometry);

// Change the intrinsic triangulation
intTri.delaunayRefine();

// Create the AttributeTransfer object
AttributeTransfer transfer(intTri);

// Compute several functions on the intrinsic triangulation
std::vector<VertexData<double>> intrinsicFunctions = /* some functions */

// Transfer functions back to extrinsic mesh
for (VertexData<double> f_intrinsic : intrinsicFunctions) {
    VertexData<double> f_extrinsic = transfer.transferBtoA(f_intrinsic, TransferMethod::L2);
    /* do something with f_extrinsic */
}

```

#### Constructors

??? func "`#!cpp AttributeTransfer::AttributeTransfer(CommonSubdivision& cs, VertexPositionGoemetry& geomA)`"

    Create a new solver for attribute transfer. Precomputation is performed lazily as needed.

    - `cs` is the common subdivision of the two triangulations between which the solver will transfer data.

    - `geomA` is the geometry of `meshA`.

??? func "`#!cpp AttributeTransfer::AttributeTransfer(CommonSubdivision& cs, IntrinsicTriangulation& intTri)`"

    Create a new solver for attribute transfer. Precomputation is performed lazily as needed.

    - `cs` is the common subdivision of the two triangulations between which the solver will transfer data.

    - `intTri` is the `IntrinsicTriangulation` object representing the two triangulations.

#### Methods

??? func "`#!cpp VertexData<double> AttributeTransfer::transferAtoB(const VertexData<double>& valuesOnA, TransferMethod method)`"
    Transfers a scalar function from `meshA` to `meshB`

    - `valuesOnA` : the data on `meshA` to be transferred.

    - `method` : either `TransferMethod::Pointwise` for pointwise transfer of `TransferMethod::L2` for $L^2$-optimal transfer.

??? func "`#!cpp VertexData<double> AttributeTransfer::transferBtoA(const VertexData<double>& valuesOnB, TransferMethod method)`"
    Transfers a scalar function from `meshB` to `meshA`

    - `valuesOnB` : the data on `meshB` to be transferred.

    - `method` : either `TransferMethod::Pointwise` for pointwise transfer of `TransferMethod::L2` for $L^2$-optimal transfer.

repository: nmwsharp/geometry-central

repo_name: nmwsharp/geometry-central


text:
[**Review #627 | Scotch Review #212 - Ardbeg Dark Cove Committee Release**]( https://t8ke.review/review-627-ardbeg-dark-cove-cr/)

**The Schtick:** Released in 2016, this Committee Release of Dark Cove was matured in ex-bourbon and dark Sherry casks for The Darkest Ardbeg Ever. Whilst the colour isnt actually that dark at all, those dark casks provide plenty of oaky depth. - Master of Malt

-----

**Distiller:** Ardbeg

**Bottler:** Ardbeg

**Selection:** N/A

**ABV:**  55% ABV

**Age:** NAS

-----

**Nose:**   Cocoa, ashy telephone pole on fire, faint stewed fruits and some nice brine character. There is faint sweetness hidden beneath the deep layers of ashy Ardbeg smoke.

**Taste:** Medium mouthfeel, no real heat. Lots of ashy, peppery peat that pairs really well with some big cocoa, toffee and honey notes. Good balance of sherry and sweetness to smoke.

**Finish:** Long, sweet and ashy. Savory. Ardbegs classic smoke profile is dominant here, as well.

**Overall:** This is a nice balance and the added proof really helps things along.

Thanks for reading!

**Rank: 7**

-----

**10 Most Recent Ardbeg Expressions I Have Reviewed:**

- [Review #845. Ardbeg 2006 Airigh Nam Beist]( https://t8ke.review/review-845-ardbeg-2006-airigh-nam-beist/)

- [Review #911. Ardbeg 12yr The Boutique-y Whisky Company 2004]( https://t8ke.review/review-911-ardbeg-12yr-the-boutique-y-whisky-company-2004/)

- [Review #627. Ardbeg Dark Cove Committee Release]( https://t8ke.review/review-627-ardbeg-dark-cove-cr/)

- [Review #1259. Ardbeg Drum Committee Release]( https://t8ke.review/review-1259-ardbeg-drum-committee-release)

- [Review #520. Ardbeg An Oa]( https://t8ke.review/review-520-ardbeg-an-oa/)

- [Review #1285. Ardbeg Drum Committee Release]( https://t8ke.review/review-1285-ardbeg-drum-committee-release)

- [Review #997. Ardbeg Auriverdes]( https://t8ke.review/review-997-ardbeg-auriverdes/)

- [Review #317. Ardbeg Perpetuum]( https://t8ke.review/review-317-ardbeg-perpetuum/)

- [Review #629. Ardbeg Kelpie Committee Release]( https://t8ke.review/review-629-ardbeg-kelpie-cr/)

- [Review #24. Ardbeg Corryvreckan]( https://t8ke.review/review-24-ardbeg-corryvreckan/)

-----

[WEBSITE](https://t8ke.review) | [SEARCHABLE ARCHIVE](https://t8ke.review/review-archive/) | [SUBREDDIT](https://reddit.com/r/t8kereviews)

-----

Decoded:

**1** | **Disgusting** | So bad I poured it out.

**2** | **Poor** | I wouldn't consume by choice.

**3** | **Bad** | Multiple flaws.

**4** | **Sub-par** | Not bad, but many things I'd rather have.

**5** | **Good** | Good, just fine.

**6** | **Very Good** | A cut above.

**7** | **Great** | Well above average

**8** | **Excellent** | Really quite exceptional.

**9** | **Incredible** | An all time favorite

**10** | **Perfect** | Perfect

----


text:
---
title: "Setting up StandardJS"
date: 2021-08-10
author: javi
type: post
img: img/standardjs-vscode.png
altImg: Vue, Typescript, ESLint and, Prettier logos
tags:
    - javascript
---
In this post, we will cover the setup of [StandardJS][1] in VSCode to fix all the errors when saving a file automatically.

## What is StandardJS?

Initially, you could think that StandardJS is the standard used for Javascript code, and, that is its main goal: provide
a **style guide, linter and, formatter for Javascript**. Really, it's not, we know about the different opinions about
all concerning to Javascript ecosystem. The idea behind StandardJS is good, you install it, and you don't worry about
defining rules anymore. I had heard about it, but I had never given it a try (personally, I am used to Prettier as
formatter). Here are some of the advantages:

- Avoid setting up rules for style decisions.
- Code auto formatting running `standard --fix`.
- Error and incorrect style detection  in code.

StandardJS uses a fixed set of rules defined with [ESLint][2].

## Setting up StandardJS

The first is step is installing the package. You can do it globally or locally in a project. I always try using the last
one in order to have under control all the dependencies.

```bash
npm install standard --save-dev
```

You can fix at any moment all the problems founds automatically (some errors can't be auto-fixed, you must fix it on
your own) with:

```bash
standard --fix
```

You can create a npm script to run the command, but in my opinion integrating into the editor is much better.

## Autoformat in VSCode

I have used StandardJS for the first time in a job mate project, and at the beginning it was driving me crazy. I had
**Prettier** as default formatter and when I was saving a file I had different kind of formats because Prettier was
violating StandardJS rules.

Is asked my teammate how did he format the code when saving a file, and he answered me that he didn't do it. Simply
when he saw an error in a file he clicked the bubble  and selected **Fix all**. I hate this kind of repetitive tasks,
so I investigated the solution in VSCode which I proceed to describe in the next lines.

First, we have to install [StandardJS extension for VSCode][3]. As StandardJs is using ESLint under the hood, we
will also install [ESLint extension][4].

If you use Prettier as default formatter for Javascript as I do, you should disable it on the workspace of your project.
At workspace level we will use the following setting which appears in the extension documentation. This way we are
enabling auto-fix, but it's necessary adding the highlighted lines to make work everything properly.

```json {linenos=table,hl_lines=["12-14"]}
{
  "standard.enable": true,
  "standard.run": "onSave",
  "standard.autoFixOnSave": true,
  "standard.validate": [
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact"
  ],
  "javascript.validate.enable": false,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  },
  "[javascript]": {
    "editor.defaultFormatter": null
  }
}
```

Let's check that everything is working as expected. We just have to open a Javascript file and save it. File must be
auto-formatted and all the error should disappear.

As conclusion, I prefer Prettier for formatting because I can use the same tool as well for HTML and CSS. I can define and apply rules
directly with ESLint, but StandardJS is a superb tool that can avoid long discussions about opinionated things.

[1]: https://standardjs.com/
[2]: https://eslint.org/
[3]: https://marketplace.visualstudio.com/items?itemName=standard.vscode-standard
[4]: https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint

gha_language: HTML


text:
# grappling-hook
[![Build Status](https://travis-ci.org/keystonejs/grappling-hook.svg)](https://travis-ci.org/keystonejs/grappling-hook)
[![npm version](https://badge.fury.io/js/grappling-hook.svg)](http://npmjs.org/packages/grappling-hook)
[![Coverage Status](https://coveralls.io/repos/keystonejs/grappling-hook/badge.svg?branch=master)](https://coveralls.io/r/keystonejs/grappling-hook?branch=master)

>pre/post hooking enabler

`grappling-hook` allows you to add pre/post hooks to objects and prototypes.
A number of modules already exist that allow you to do just the same, but the most popular one ([hooks](https://www.npmjs.com/package/hooks)) is no longer maintained.
Also, we wanted a more granular control of the hooking process and the way middleware is called.

**NEW:**

* since v3.0 you can [use promises as middleware][thenable-middleware] and have [thenable hooks][thenable-hooks] (i.e. promise returning hooks).
* since v2.4 you can [wrap sync methods and call sync hooks][synchronous-hooks].
* since v2.3 you can [configure `grappling-hook` to use other method names][other-qualifiers] than `pre` or `post`, e.g. `before` and `after`.

## Installation

```sh
$ npm install grappling-hook
```

## Usage

From here on `grappling-hook` refers to the module itself (i.e. what you get when you `require('grappling-hook')`) and `GrapplingHook` refers to any GrapplingHook object (i.e. an object which allows you to register `pre` and `post` middleware, et cetera)

`grappling-hook` and `GrapplingHook` expose two different API's:

1. a consumer-facing API, i.e. it allows you to add middleware functions to pre/post hooks.
1. a producer-facing API, i.e. it allows you to create hooks, wrap methods with hooks, et cetera.

### Consumer-facing API

Allows you to add/remove [middleware][middleware] functions to hooks. There's 4 types of middleware possible:

#### synchronous middleware

i.e. the function is executed and the next middleware function in queue will be called immediately.

```js
function () { //no callbacks
	//synchronous execution
}
```

#### serially (a)synchronous middleware

i.e. the next middleware function in queue will be called once the current middleware function finishes its (asynchronous) execution.

```js
function (next) { //a single callback
	//asynchronous execution, i.e. further execution is halted until `next` is called.
	setTimeout(next, 1000);
}
```

#### parallel (a)synchronous middleware

i.e. the next middleware function in queue will be called once the current middleware function signals it, however the whole queue will only be finished once the current middleware function has completed its (a)synchronous execution.

```js
function (next, done) { //two callbacks
	//asynchronous execution, i.e. further execution is halted until `next` is called.
	setTimeout(next, 500);
	//full middleware queue handling is halted until `done` is called.
	setTimeout(done, 1000);
}
```

#### thenable middleware (promises)

i.e. the next middleware function in queue will be called once the [thenable][thenable] middleware function has resolved its promise.

```js
function () { //no callbacks
	//create promise, i.e. further execution is halted until the promise is resolved.
	return promise
}
```

(Sidenote: all consumer-facing methods exist out of a single word)

See:

* [GrapplingHook#pre][GrapplingHook#pre] on how to register [middleware][middleware] functions to `pre` hooks.
* [GrapplingHook#post][GrapplingHook#post] on how to register [middleware][middleware] functions to `post` hooks.
* [GrapplingHook#hook][GrapplingHook#hook] on how to register [middleware][middleware] functions to `pre` or `post` hooks.

All three allow you to register middleware functions by either passing them as parameters to the method:

```js
instance.pre('save', notifyUser, checkPermissions, doSomethingElseVeryImportant);
```

Or (if the grappling-hook instances are [setup for thenables][setup-thenables]) by chaining them with `then`:

```js
instance.pre('save')
	.then(notifyUser)
	.then(checkPermissions)
	.then(doSomethingElseVeryImportant)
```

Additionally see:

* [GrapplingHook#unhook][GrapplingHook#unhook] on how to deregister [middleware][middleware] functions from hooks.
* [GrapplingHook#hookable][GrapplingHook#hookable] on how to check whether a hook is available.

### Producer-facing API

`grappling-hook` provides you with methods to store, retrieve and reuse presets.

* [grappling-hook.set][grappling-hook.set] on how to store presets.
* [grappling-hook.get][grappling-hook.get] on how to view presets.

All `grappling-hook` factory functions allow you to reuse presets, see [presets example](#presets).

See:

* [grappling-hook.create][grappling-hook.create] on how to create vanilla `GrapplingHook` objects.
* [grappling-hook.mixin][grappling-hook.mixin] on how to add `GrapplingHook` functionality to existing objects.
* [grappling-hook.attach][grappling-hook.attach] on how to add `GrapplingHook` functionality to constructors.

By default `GrapplingHook` hooks need to be either explicitly declared with [GrapplingHook#allowHooks][GrapplingHook#allowHooks] if you want to call your hooks directly or by wrapping existing methods.

`GrapplingHook` objects can have 3 kinds of hooks:

#### Asynchronous hooks

Asynchronous hooks **require** a callback as the final parameter. It will be called once all pre _and_ post middleware has finished. When using a wrapped method, the original (unwrapped) method will be called in between the pre and post middleware.

Asynchronous hooks _always_ finish asynchronously, i.e. even if only synchronous middleware has been registered to a hook `callback` will always be called asynchronously (next tick at the earliest).

Middleware added to asynchronous hooks can be synchronous, serially asynchronous, parallel asynchronous or thenable. See [middleware][middleware] for more information.

See:

* [GrapplingHook#addHooks][GrapplingHook#addHooks] or its alias [GrapplingHook#addAsyncHooks][GrapplingHook#addAsyncHooks] on how to wrap asynchronous methods with pre/post hooks.
* [GrapplingHook#callHook][GrapplingHook#callHook] or its alias [GrapplingHook#callAsyncHook][GrapplingHook#callAsyncHook] on how to call an asynchronous pre or post hook directly.

#### Synchronous hooks

Synchronous hooks do not require a callback and allow the possibility to return values from wrapped methods.

They _always_ finish synchronously, which means consumers are not allowed to register any asynchronous middleware (including thenables) to synchronous hooks.

See:

* [GrapplingHook#addSyncHooks][GrapplingHook#addSyncHooks] on how to wrap synchronous methods with pre/post hooks.
* [GrapplingHook#callSyncHook][GrapplingHook#callSyncHook] on how to call a synchronous pre or post hook directly.

#### Thenable hooks

Thenable hooks **must** return a promise.

They _always_ finish asynchronously, i.e. even if only synchronous middleware has been registered to a thenable hook the promise will be resolved asynchronously.

Middleware added to thenable hooks can be synchronous, serially asynchronous, parallel asynchronous or thenable. See [middleware][middleware] for more information.

See:

* [GrapplingHook#addThenableHooks][GrapplingHook#addThenableHooks] on how to wrap thenable methods with pre/post hooks.
* [GrapplingHook#callThenableHook][GrapplingHook#callThenableHook] on how to call a thenable pre or post hook directly.

In order to create thenable hooks `grappling-hook` must be properly [setup for creating thenables][setup-thenables].

### Introspection

You can check if a hook has middleware registered with [GrapplingHook#hasMiddleware][GrapplingHook#hasMiddleware] or you can even access the raw middleware functions through [GrapplingHook#getMiddleware][GrapplingHook#getMiddleware].

## Examples

### mix middleware types

You can **mix sync/async serial/parallel and thenable middleware** any way you choose (for aynchronous and thenable hooks):

```js
instance.pre('save', function (next) {
	//async serial
	console.log('async serial: setup');
	setTimeout(function () {
		console.log('async serial: done');
		next();
	}, 100);
}, function () {
	//sync
	console.log('sync: done');
}, function (next, done) {
	//async parallel
	console.log('async parallel: setup');
	setTimeout(function () {
		console.log('async parallel: done');
		done();
	}, 200);
	next();
}, function () {
	//thenable
	console.log('thenable: setup');
	var done;
	var promise = new P(function (resolve, fail) {
		done = resolve;
	});
	setTimeout(function () {
		console.log('thenable: done');
		done();
	}, 30);
	return promise;
});
```
```sh
# output
async serial: setup
async serial: done
sync: done
async parallel: setup
thenable: setup
thenable: done
async parallel: done
```

### Creating a `GrapplingHook` object

You can easily add methods to a new `grappling-hook` instance which are automatically ready for hooking up middleware:

```js
var grappling = require('grappling-hook');

// create an instance
var instance = grappling.create();

// declare the hookable methods
instance.addHooks({
	save: function (done) {
		console.log('save!');
		done();
	}
});

//allow middleware to be registered for a hook
instance.pre('save', function () {
	console.log('saving!');
}).post('save', function () {
	console.log('saved!');
});

instance.save(function (err) {
	console.log('All done!!');
});
```
```sh
# output:
saving!
save!
saved!
All done!!
```

### Using an existing object

You can choose to enable hooking for an already existing object with methods:

```js
var grappling = require('grappling-hook');

var instance = {
	save: function (done) {
		console.log('save!');
		done();
	}
};

grappling.mixin(instance); // add grappling-hook functionality to an existing object

instance.addHooks('save'); // setup hooking for an existing method

instance.pre('save', function () {
	console.log('saving!');
}).post('save', function () {
	console.log('saved!');
});

instance.save(function (err) {
	console.log('All done!!');
});

```
```sh
# output:
saving!
save!
saved!
All done!!
```

### Using a 'class'

You can patch a `prototype` with `grappling-hook` methods:

```js
var grappling = require('grappling-hook');

var MyClass = function () {};

MyClass.prototype.save = function (done) {
	console.log('save!');
	done();
};

grappling.attach(MyClass); // attach grappling-hook functionality to a 'class'

var instance = new MyClass();
instance.addHooks('save'); // setup hooking for an existing method

instance.pre('save', function () {
	console.log('saving!');
}).post('save', function () {
	console.log('saved!');
});

instance.save(function (err) {
	console.log('All done!!');
});
```
```sh
# output:
saving!
save!
saved!
All done!!
```

### Adding hooks to synchronous methods

`addSyncHooks` allows you to register methods for enforced synchronized middleware execution:

```js
var grappling = require('grappling-hook');

var instance = {
	saveSync: function (filename) {
		filename = Date.now() + '-' + filename;
		console.log('save', filename);
		return filename;
	}
};

grappling.mixin(instance); // add grappling-hook functionality to an existing object

instance.addSyncHooks('saveSync'); // setup hooking for an existing (sync) method

instance.pre('saveSync', function () {
	console.log('saving!');
}).post('saveSync', function () {
	console.log('saved!');
});

var newName = instance.saveSync('example.txt');
console.log('new name:', newName);
```
```sh
# output:
saving!
save<PHONE_NUMBER>725-example.txt
saved!
new name:<PHONE_NUMBER>725-example.txt
```

### Passing parameters

You can pass any number of parameters to your middleware:

```js
instance.pre('save', function (foo, bar) {
	console.log('saving!', foo, bar);
});

instance.callHook('pre:save', 'foo', { bar: 'bar'}, function () {
	console.log('done!');
});
```
```sh
# output:
saving! foo { bar: 'bar' }
done!
```

```js
instance.save = function (filename, dir, done) {
	// do your magic
	done();
}

instance.pre('save', function (filename, dir) {
	console.log('saving!', filename, dir);
});

instance.save('README.md', 'docs');
```
```sh
# output:
saving! README.md docs
```

### Contexts

By default all middleware is called with the `GrapplingHook` instance as an execution context, e.g.:

```js
instance.pre('save', function () {
	console.log(this);
});

instance.toString = function () {
	return "That's me!!";
};
instance.callSyncHook('pre:save');
```
```sh
# output:
That's me!!
```

However, `callHook`, `callSyncHook` and `callThenableHook` accept a `context` parameter to change the scope:

```js
instance.pre('save', function () {
	console.log(this);
});

instance.toString = function () {
	return "That's me!!";
};

var context = {
	toString: function () {
		return 'Different context!';
	}
};
instance.callSyncHook(context, 'pre:save'); // the `context` goes first
```
```sh
# output:
Different context!
All done!!
```

### Lenient mode

By default `grappling-hook` throws errors if you try to add middleware to or call a non-existing hook. However if you want to allow more leeway (for instance for dynamic delegated hook registration) you can turn on lenient mode:

```js
var instance = grappling.create({
	strict: false
});
```

### Other qualifiers

By default `grappling-hook` registers `pre` and `post` methods, but you can configure other names if you want:

```js
var instance = grappling.create({
	qualifiers: {
		pre: 'before',
		post: 'after'
	}
});

//now use `before` and `after` instead of `pre` and `post`:

instance.addHooks('save');
instance.before('save', fn);
instance.after('save', fn);
instance.save();
```

There's one caveat: you _have_ to configure both or none.

### Setting up thenable hooks

If you want to use thenable hooks, you'll need to provide `grappling-hook` with a thenable factory function, since it's promise library agnostic (i.e. you can use it with any promise library you want).

Just to be clear: you do NOT need to provide a thenable factory function in order to allow thenable middleware, this works out of the box.

```js
var P = require('bluebird');

var instance = grappling.create({
	createThenable: function (fn) {
		return new P(fn);
	}
})

instance.addThenableHooks({
	save: function (filename) {
		var p = new P(function (resolve, reject) {
			// add code for saving
		});
		return p;
	}
});

instance.save('examples.txt').then(function () {
	console.log('Finished!');
});
```

### Error handling

- Errors thrown in middleware registered to synchronized hooks will bubble through

	```js
	instance.pre('save', function () {
		throw new Error('Oh noes!');
	});
	instance.callSyncHook('pre:save');
	```
	```sh
	# output:
	Error: Oh noes!
	```

- Errors thrown in middleware registered to asynchronous hooks are available as the `err` object in the `callback`.

	```js
	instance.pre('save', function () {
		throw new Error('Oh noes!');
	});
	instance.callHook('pre:save', function (err) {
		console.log('Error occurred:', err);
	});
	```
	```sh
	# output:
	Error occurred: Error: Oh noes!
	```

- Errors thrown in middleware registered to thenable hooks trigger the promise's rejectedHandler.

	```js
	instance.pre('save', function () {
		throw new Error('Oh noes!');
	});
	instance.callThenableHook('pre:save').then(null, function (err) {
		console.log('Error occurred:', err);
	});
	```
	```sh
	# output:
	Error occurred: Error: Oh noes!
	```

- Async middleware can pass errors to their `next` (serial or parallel) or `done` (parallel only) callbacks, which will be passed as the `err` object parameter for asynchronous hooks:

	```js
	//async serial
	instance.pre('save', function (next) {
		next(new Error('Oh noes!'));
	});
	```
	```js
	//async parallel
	instance.pre('save', function (next, done) {
		next();
		done(new Error('Oh noes!'));
	});
	```
	```js
	instance.callHook('pre:save', function (err) {
		if (err) {
			console.log('An error occurred:', err);
		}
	});
	```
	```sh
	# output for both:
	An error occurred: Oh noes!
	```
- Async middleware can pass errors to their `next` (serial or parallel) or `done` (parallel only) callbacks, which will trigger the rejectedHandler of thenable hooks:

	```js
	//async serial
	instance.pre('save', function (next) {
		next(new Error('Oh noes!'));
	});
	```
	```js
	//async parallel
	instance.pre('save', function (next, done) {
		next();
		done(new Error('Oh noes!'));
	});
	```
	```js
	instance.callThenableHook('pre:save').then(null, function (err) {
		if (err) {
			console.log('An error occurred:', err);
		}
	});
	```
	```sh
	# output for both:
	An error occurred: Oh noes!
	```

- Thenable middleware can reject their promises, which will be passed as the `err` object parameter for asynchronous hooks:

	```js
	instance.pre('save', function (next) {
		var p = new Promise(function (succeed, fail) {
			fail('Oh noes!');
		});
		return p;
	});
	```
	```js
	instance.callHook('pre:save', function (err) {
		if (err) {
			console.log('An error occurred:', err);
		}
	});
	```
	```sh
	# output:
	An error occurred: Oh noes!
	```
- Thenable middleware can reject their promises, which will trigger the rejectedHandler of thenable hooks:

	```js
	instance.pre('save', function (next) {
		var p = new Promise(function (succeed, fail) {
			fail('Oh noes!');
		});
		return p;
	});
	```
	```js
	instance.callThenableHook('pre:save').then(null, function (err) {
		if (err) {
			console.log('An error occurred:', err);
		}
	});
	```
	```sh
	# output for both:
	An error occurred: Oh noes!
	```

### Presets

You can [set][grappling-hook.set] and use preset configurations, in order to reuse them in your project.

```js
var presets = {
	strict: false,
	qualifiers: {
		pre: 'before',
		post: 'after'
	}
};
var grappling = require('grappling-hook');
grappling.set('grappling-hook:examples.presets', presets);

//all grappling-hook factory methods accept a presetname:
var instance = grappling.create('grappling-hook:examples.presets');

instance.addSyncHooks({
	save: function () {
		console.log('Saving!');
	}
});

instance.before('save', function () {
	console.log('Before save!');
}).after('save', function () {
	console.log('After save!');
}).save();
```
```sh
# output:
Before save!
Saving!
After save!
```

If you want to override preset configuration options, just pass them to the factory function, as always:

```js
var instance = grappling.create('grappling-hook:examples.presets', {
	strict: true
});

/*
instance has the following configuration:
{
	strict: true,
	qualifiers: {
		pre: 'before',
		post: 'after'
	}
}
*/
```

With [grappling-hook.get][grappling-hook.get] you can introspect the configuration options of a preset:

```js
console.log(grappling.get('grappling-hook:examples.presets'));
```
```sh
# output:
{
	strict: false,
	qualifiers: {
		pre: 'before',
		post: 'after'
	}
}
```

[middleware]: https://keystonejs.github.io/grappling-hook/global.html#middleware
[thenable]: https://keystonejs.github.io/grappling-hook/global.html#thenable
[grappling-hook.get]: https://keystonejs.github.io/grappling-hook/module-grappling-hook.html#.get
[grappling-hook.set]: https://keystonejs.github.io/grappling-hook/module-grappling-hook.html#.set
[grappling-hook.create]: https://keystonejs.github.io/grappling-hook/module-grappling-hook.html#.create
[grappling-hook.mixin]: https://keystonejs.github.io/grappling-hook/module-grappling-hook.html#.mixin
[grappling-hook.attach]: https://keystonejs.github.io/grappling-hook/module-grappling-hook.html#.attach
[GrapplingHook#pre]: https://keystonejs.github.io/grappling-hook/GrapplingHook.html#pre
[GrapplingHook#post]: https://keystonejs.github.io/grappling-hook/GrapplingHook.html#post
[GrapplingHook#hook]: https://keystonejs.github.io/grappling-hook/GrapplingHook.html#hook
[GrapplingHook#unhook]: https://keystonejs.github.io/grappling-hook/GrapplingHook.html#unhook
[GrapplingHook#hookable]: https://keystonejs.github.io/grappling-hook/GrapplingHook.html#hookable
[GrapplingHook#allowHooks]: https://keystonejs.github.io/grappling-hook/GrapplingHook.html#allowHooks
[GrapplingHook#addHooks]: https://keystonejs.github.io/grappling-hook/GrapplingHook.html#addHooks
[GrapplingHook#addAsyncHooks]: https://keystonejs.github.io/grappling-hook/GrapplingHook.html#addAsyncHooks
[GrapplingHook#addSyncHooks]: https://keystonejs.github.io/grappling-hook/GrapplingHook.html#addSyncHooks
[GrapplingHook#addThenableHooks]: https://keystonejs.github.io/grappling-hook/GrapplingHook.html#addThenableHooks
[GrapplingHook#callHook]: https://keystonejs.github.io/grappling-hook/GrapplingHook.html#callHook
[GrapplingHook#callAsyncHook]: https://keystonejs.github.io/grappling-hook/GrapplingHook.html#callAsyncHook
[GrapplingHook#callSyncHook]: https://keystonejs.github.io/grappling-hook/GrapplingHook.html#callSyncHook
[GrapplingHook#callThenableHook]: https://keystonejs.github.io/grappling-hook/GrapplingHook.html#callThenableHook
[GrapplingHook#hasMiddleware]: https://keystonejs.github.io/grappling-hook/GrapplingHook.html#hasMiddleware
[GrapplingHook#getMiddleware]: https://keystonejs.github.io/grappling-hook/GrapplingHook.html#getMiddleware

[other-qualifiers]: #other-qualifiers
[synchronous-hooks]: #synchronous-hooks
[setup-thenables]: #setting-up-thenable-hooks
[thenable-middleware]: #thenable-middleware-promises
[thenable-hooks]: #thenable-hooks

## Changelog

See [History.md](https://github.com/keystonejs/grappling-hook/blob/master/History.md)

## Contributing

Pull requests welcome. Make sure you use the .editorconfig in your IDE of choice and please adhere to the coding style as defined in .eslintrc.

* `npm test` for running the tests
* `npm run lint` for running eslint
* `npm run test-cov` for churning out test coverage. (We go for 100% here!)
* `npm run docs` for generating the API docs


text:
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [0.4.2] - 2018-02-20
### Changed

- javascript QR code generator is now a dev dependency

## [0.4.1] - 2018-02-20
### Added

- changelog.md

## [0.4.0] - 2018-02-20
### Added

- QR code generator for local dev URL
- clearfix class in base CSS
- default favicon paths

gha_language: PHP


text:
Pattern: Trailing code after class definition

Issue: -

## Description

This rule checks for trailing code after the class definition. Place the first line of class body on its own line.

## Examples

```ruby
# bad
class Foo; def foo; end
end

# good
class Foo
  def foo; end
end
```

## Further Reading

* [RuboCop - Style/TrailingBodyOnClass](https://docs.rubocop.org/rubocop/cops_style.html#styletrailingbodyonclass)

repository: Adroiti/docs-for-code-review-tools

repo_name: Adroiti/docs-for-code-review-tools


text:
# Bluepicker

A beautiful VanillaJS date or datetime picker that also supports local or UTC input.

## Why ?

It is nearly impossible to find a date(time) picker that simultaneously brings:

- Only has the awesome [momentjs](https://momentjs.com) as dependency
- Local CSS styles (avoids conflicts with the surrounding application)
- Can be either an efficient *Date* picker or a *Datetime* one
- Supports UTC or local time input
- Low complexity: less than 500 SLOC.
- Is beautiful and easy to use enough (not 5 dropdowns)

## Sample code

Simply require it and use it !

```html
<div id="picker_id">
  <input type="text"></input>
</div>
```

```javascript
import bluepicker from 'bluepicker'

import 'bluepicker/dist/bundle.css'  # hashed CSS classes for the picker

bluepicker.init('picker_id')
```

## Configuration

Almost everything is configurable.

```javascript
bluepicker.init('picker_id', {
  callback: null,   // callback upon changes
  locale: 'cn',     // momentJS locale
  format: 'lll',    // momentJS display format
  mode: 'hours',    // asks the day, then the hour, that's it.
  utcMode: true,    // displayed and sent values will be UTC
  padToBoundary: false,  // pad text to minutes, hours or day boundary depending on the mode.
  nowButtonText: 'Now'   // gives you the possibility to customize the "Now" button text.
}, initValue)

```

## Events

Upon changes (either by direct modification in the input field, or a click
in the picker buttons) a DOM event is fired and the callback is called,
if provided.

```javascript
bluepicker.init('picker_id', {callback: onPickerChange})

// or

document.addEventListener('bluepicker:update', (e) => onPickerChange(e.detail))

// fires

function onPickerChange ({id, format, value, utcMode}) {
  // id is the source's datepicker ID
  // format is the display format of the value
  // value is the momentJS instance of the moment that just changed
  // utcMode keeps track if the picker is currently in UTC mode or not.
}
```

## License

MIT

repository: Polyconseil/bluepicker

repo_name: Polyconseil/bluepicker


text:
# f2c - Convert a file into a C source/header char array(Simulate a text file).
(Based on IngwiePhoenix/file2c)

This is a very, very simple tool.

To compile it:

	g++ f2c.cpp -o f2c

Then use it like:

	f2c foo.txt foo.h

Now you can compile foo.h and access it like any regular text string array. You could serialize a zip archive in there, or things like that. Just keep in mind, that this is without a header! So to use it properly,you may want to create a header and declare these as "external". Therefore, the variable name appears at the top of the file after a // comment.

An example header may look like this:

	#ifndef HAVE_FILES_H
	#define HAVE_FILES_H

	// You can generate this. Each file starts with: // varName
	// where varName is the original variable name.

	extern char[] myFile;

	#endif

Then you can include that header into your code, so it is aware of the variables.

Have fun. ^.^


text:
---
title: When you accidentally start a thing
description: CSS 1k is a styling challenge using - you guessed it - less than 1k of CSS. Posting an old take on it, the users of CodePen took up the challenge.
date: 2013-08-22
source: https://codepen.io/plfstr/pen/izswy
tags: [ paulfosterdesign, web, codepen, css, twitter]
syndicated: ['https://paulfosterdesign.wordpress.com/2013/08/22/when-you-accidentally-start-a-thing-less-than-a/']
---
{% include codepen.html codepen="izswy" height="500" %}

Less than a week ago I posted a demo CSS1K theme I had parked on my hard drive and [posted it to CodePen](https://codepen.io/plfstr/pen/izswy) where it would be right at home.

_**CSS1K was a web styling challenge from several years ago where you creatively style the instructional example page using 1 kilobyte of CSS or less.**_

I didn’t expect anything would come of it, just another piece to demo my skills. Then it got selected to for the ‘Picks’ section of the site and got a modest amount of views, likes and comments. Then as hoped, it inspired someone else to give it a go. When finally a [CodePen blog post](http://blog.codepen.io/2013/08/21/css1k/) brought it to more peoples attention and encouraged others to take up the challenge. Some will probably groan ‘this again’, but css has progressed further and hopefully it inspires some really new solutions.

Maybe take a glance through those old demos and experiments you parked to one side. Never know what you might find.


text:
# Any

Any is a simple gem. When you compare it against anything, it's always true.

This is a play at Scala's Any type, mostly used for pattern matching type
techniques.

* https://docs.scala-lang.org/tour/unified-types.html
* https://www.scala-lang.org/api/2.12.3/scala/Any.html

## Credits

Thanks to [@soffes](https://github.com/soffes) for allowing me to repurpose the gem `Any`!

The original will be maintained at versions 0.0.1 and 0.0.2 from [this repo](https://github.com/soffes/any)

## Usage

Note that I'm using Qo here. If these two issues are
added in Ruby 2.6+ it'll enable us to do this without
the need for Qo:

* Hash#===  - https://bugs.ruby-lang.org/issues/14869
* Array#=== - https://bugs.ruby-lang.org/issues/14916

I've commented on each to note this.

For now, I will leave Qo in the specs so that we don't
have a hard dependency on 2.6+, especially considering
that at the time of writing this it's still in development.

```ruby
require 'qo' # gem install qo @ v0.3.0

case ['Foo', 25]
when Qo[/^F/, Any] then true
else false
end
# => true

case {id: 1, name: 'foo', age: 42}
when Qo[id: Any, name: /^f/, age: Any] then true
else false
end
# => true

case {id: 1, name: 'foo'}
when Qo[id: Any, name: /^f/, age: Any] then true
else false
end
# => false
```

Qo behaves much like the proposals, except in that it's permissive
for Arrays of mismatched lengths and works with Objects.

In 2.6+, assuming the two above are accepted, you could do this:

```ruby
case ['Foo', 25]
when [/^F/, Any] then true
else false
end
# => true

case {id: 1, name: 'foo', age: 42}
when {id: Any, name: /^f/, age: Any} then true
else false
end
# => true

case {id: 1, name: 'foo'}
when {id: Any, name: /^f/, age: Any} then true
else false
end
# => false
```

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'any'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install any

## Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/baweaver/any. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.

## License

The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).

## Code of Conduct

Everyone interacting in the Any project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/baweaver/any/blob/master/CODE_OF_CONDUCT.md).

repository: baweaver/any

repo_name: baweaver/any


text:
# cloud_scripts
Convenience functions to automate interactions with cloud. (Particularly for use with TensorFlow.)

## Utilities
### cssh (Cloud SSH)
Shell script for ssh-ing into cloud instaces.
`./cssh.sh`


text:
## Keras-DGL: Keras Deep Learning on Graphs

Keras extension for Deep Learning tasks on Graphs using the Sequential and Functional API of keras.

Currently Available:
* Graph Convolutional Neural Networks (GraphCNN).
* Graph Attention Convolutional Neural Networks (GraphAttentionCNN).
* Graph Convolutional Recurrent Neural Networks (GraphConvLSTM).

Docs: <http://vermaMachineLearning.github.io/keras-deep-graph-learning>

Forked from vermaMachineLearning/keras-deep-graph-learning for contributing the code of "Recurrent Graph Autoencoders. Peleg, Y. Feinberg, Y. ICCS 2018"

repository: ypeleg/keras-deep-graph-learning

repo_name: ypeleg/keras-deep-graph-learning


text:
# Introduction

This angular project was created in order to practice a niche of angular 2+ development and SOLID skills. It's a simple page where you can learn about SOLID principles and take a quiz of 15 questions about it. Next, you will be given a score which you can share and compare results with others.

You can do the quiz [now](https://kiril1512.github.io/AreYouSolid/#/Home)!

## Features/Build with

1. [Firebase Anonymous Authentication](https://firebase.google.com/docs/auth/web/anonymous-auth?hl=en-US). These temporary anonymous accounts can be used to: track if a user has done the quiz; get the results; and work with data protected by security rules.

2. [Firebase realtime Database](https://firebase.google.com/docs/database). Real time database allows a user to submit his score and see the other users' scores. You can't see other users' score if you did not submit your own results.

3. [Angular Material](https://material.angular.io/). This was used to style the tables, spinners, buttons, etc...

4. [ngx-highlightjs](https://github.com/MurhafSousli/ngx-highlightjs). This package allows the example codes to get highlight and not be displayed as simple text.

## Getting started

You can do the quiz now following [https://kiril1512.github.io/AreYouSolid/#/Home](https://kiril1512.github.io/AreYouSolid/#/Home) or run the project localy folowing the Installing instructions bellow.

### Prerequisites

1. [Angular CLI](https://cli.angular.io/)

2. [Nodejs](https://nodejs.org/en/)

3. [Fireabase](https://firebase.google.com/docs/web/setup?hl=pt)

### Installing

- First download or clone this repository.
- Then install the packages.

```node
npm install
```

- Create a firebase project in the [Firebase Console](https://console.firebase.google.com/).
- Activate the anonymous provider in the **Authentication configuration** ```(https://console.firebase.google.com/project/<yourProject>/authentication/providers)```.
- Create a **Realtime Database** ```(https://console.firebase.google.com/project/<yourProject>/database)``` in the test mode (*These rules give anyone, even people who are not users of your app, read and write access to your database so you may change it later*).
- Create an aplication in the **Project settings** ```(https://console.firebase.google.com/project/<yourProject>/settings/general/)```.
- Save your aplication **configuration** and replace it at ```./src/app/app.module.ts```.

```typescript
const firebaseConfig = {
  apiKey: "yourApiKey",
  authDomain: "yourAuthDomain",
  databaseURL: "yourDataBaseURL",
  projectId: "yourProjectID",
  storageBucket: "",
  messagingSenderId: "yourSenderID",
  appId: "yourAppId"
};
```

- Start the application.

```node
ng serve --aot --open
```

## Authors

 **Kyrylo Yavorenko** - *Full-Stack Developer* - [Linkedin](https://www.linkedin.com/in/kyryloyavorenko/)

See also the list of [contributors](https://github.com/Kiril1512/AreYouSolid/contributors) who participated in this project.

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details

## Application preview

Home page will give you the option to start the quiz or learn about SOLID. Learn SOLID will give you some useful links and a brief summary about SOLID principles.

![Home](https://i.ibb.co/TvHzcrQ/home2.png)

You can answer the multiple questions and then see the explanation for the correct answer.

![Quiz](https://i.ibb.co/6Jq2rRM/Questions.png)
![QuizWithAnswer](https://i.ibb.co/Zzkyh5z/questions-With-Result.png)

Also there are some code questions.

![Code Questions](https://i.ibb.co/xSnBhPB/questions-With-Code-And-Results.png)

At the end you will have your results which you can share.

![Results](https://i.ibb.co/9G8Hmxr/results.png)
![ResultsSubmited](https://i.ibb.co/h7H2F4f/results-Submited.png)

## Project Structure

```text
|-- app
	|-- Firebase
		|-- Auth
		|-- Data
	|-- Pages
		|-- About
		|-- Home
		|-- LearnSlid
		|-- Quiz
			|-- Questions
			|-- Register
			|-- Results
	|-- Shared
		|-- Points
```

## Acknowledgments

* Courses I have done to create this project: [Angular 8 - The Complete Guide](https://www.udemy.com/the-complete-guide-to-angular-2/), [SOLID Principles for C# Developers](https://www.pluralsight.com/courses/csharp-solid-principles) and [Defensive Coding in C#](https://www.pluralsight.com/courses/defensive-coding-csharp).
* Tools I used: [Visual Studio Code](https://code.visualstudio.com/), [Firebase Console](https://console.firebase.google.com/).
* You can add more code languages to highlight at ```app.module.ts``` in the ```hljsLanguages()``` function. See the [full list of supported languages](https://github.com/highlightjs/highlight.js/tree/master/src/styles).
* The example codes for the questions and for the correct answers can be found in ```./assets/code_example``` as simple txt files. Those files are imported by ```http.get```.

### Application/Code logic

* The authGuard was created to forbid the non authenticated user to see the results and also forbid the authenticated user (user which has completed the quiz) to start a new quiz. The problem of anonymous authentication is that the user can simply switch the browser, clear the local storage or use the incognito mode so that the app considers that this is a different user. In normal situations, the user can see his results again after the browser was closed, since the user's "iud" is associated with the points after the results are submitted.
* Each user can do the quiz only once (this is done to prevent, in normal circumstances, the user to do the quiz again after knowing the answers).
* Various questions have different scores from 0.25 to 1.5 points. The maximum score is 20 points.
* When the answer is clicked, the correct answer turns green and the others red and it shows a justification for the correct answer.
* The authentication occurs when the user answers the last question and clicks the "Done" button.
* You can only see the other users' results after you submit your own results.
* If the user did not submit the results and the application is closed, the points will be lost and you cannot do the quiz again (related to the first point).