text:
# Documentation

### Coupon

##### [https://github.com/krishnaansh/django-coupon-management/blob/master/docs/models/Coupon.md](https://github.com/krishnaansh/django-coupon-management/blob/master/docs/models/Coupon.md)

### Discount

##### [https://github.com/krishnaansh/django-coupon-management/blob/master/docs/models/Discount.md](https://github.com/krishnaansh/django-coupon-management/blob/master/docs/models/Discount.md)

### Coupon Validation

##### [https://github.com/krishnaansh/django-coupon-management/blob/master/docs/models/Ruleset.md](https://github.com/krishnaansh/django-coupon-management/blob/master/docs/models/Ruleset.md)

### Coupon User

##### [https://github.com/krishnaansh/django-coupon-management/blob/master/docs/models/Coupon_User.md](https://github.com/krishnaansh/django-coupon-management/blob/master/docs/models/Coupon_User.md)

### Validations Guide

##### [https://github.com/krishnaansh/django-coupon-management/blob/master/docs/validation/Validations.md](https://github.com/krishnaansh/django-coupon-management/blob/master/docs/validation/Validations.md)

### Usage Example

```python
# views.py - Example only
# /use-coupon/?coupon_code=COUPONTEST01

from django.contrib.auth.models import User
from django.http import HttpResponse

from coupon_management.validations import validate_coupon
from coupon_management.models import Coupon

class UseCouponView(View):
    def get(self, request, *args, **kwargs):
        coupon_code = request.GET.get("coupon_code")
        user = User.objects.get(username=request.user.username)

        status = validate_coupon(coupon_code=coupon_code, user=user)
        if status['valid']:
            coupon = Coupon.objects.get(code=coupon_code)
            coupon.use_coupon(user=user)

            return HttpResponse("OK")

        return HttpResponse(status['message'])
```

To use django-coupon-management accordingly, you'll need to validate the coupon first with the coupon code and the user that will use the coupon.

To validate the coupon, use the method ```validate_coupon()``` from ```coupon_management.validators```. This method returns a dict with one key (if valid) or two keys (if not valid):

```python
VALID = {
    "valid": True
}

INVALID = {
    "valid": False,
    "message": "Some message telling why it's not valid"
}
```

If it's valid, you can safely call the function ```use_coupon()``` from the Coupon instance.

Please note that I used the default User model from Django in this example. If you use a custom authentication system, you'll need to use the proper User model from your custom auth app!

repository: yacaeh/django-coupon-management

repo_name: yacaeh/django-coupon-management


text:
# wheatlessinv2

### Overview
 -  Wheatlessin is a RESTful API that provides back-end infrastructure and functionality to create, read and delete resources. The end product will be a web and mobile site that helps people discover gluten free food.
 - Restaurant owners can register an account and add details about their gluten-free offerings, including a picture of their menu.

### Current Version (2.0.0)
 - The current version of this program is designed to create, read, update, delete these resources:
 1. Users
 2. Businesses, which are owned by Users
 3. Menus for each Business
 4. Images of each menu

### Future Releases
 - Version 2.5.0 has a scheduled release on February 2017 which will include the following enhancements:
 - complete front end makeover
 - give user signIn
 - store user's gluten free status

### Ways to contribute
 - Report Bugs: Open up an issue through this git repository and select "bug" as the label
 - Recommending Enhancements: Open up an issue through this git repository and select "enhancement" as the label
 - Issues will be reviewed weekly

### Architecture
This API is structured on a Middleware (Authentication and Error catching), Model (Schema), and Router pattern. The base technologies are running on a node.js server, node.http module, express middleware, AWS and a mongo database. This architecture is currently deployed in a two tier environment (staging & production), leveraging the heroku platform.

  **Middleware**:
 - The express router middleware provides base routing capability.
 - A custom handle-errors module implements and extends the http-errors npm middleware package.
 - An auth middleware module leverages two npm modules (bcryptjs, jsonwebtoken) and node.crypto module to provide user sign-up and user sign-in functionality, this includes business authentication/authorization which allows business user's to post their menus.
 - The mongoose npm module is used for interaction with the mongo database.
 - AWS is used to store image data and mongoose stores only the reference object (image URI) for server efficiency.

**Model**:
 - Wheatlessin current resources (user, biz, pic, menu) are mongoose Schemas and have dedicated router files located in the route folder. In addition to providing an interface to the pubic user, these files provide modularity.
 - For details about the input and output of routes, see the Routes section below.

**Router**:
 - Our resources (user, biz, menu, pics) have dedicated router files. These files are the interface between the server, middleware, model files, and databases (mongo and AWS). When a request is made, router calls the necessary functions to interact with the model. This returns a response to the route once a request has been processed in the model also parsing the json content in the incoming request (where applicable) and create and populate a req.body property using the npm package parse-body.

# Routes
### POST:
Example:

 **User Signup**  POST http://wheatlessinv2.herokuapp.com/api/signup

Required Data: Provide username, password, email as JSON

This route will create a new user by providing a username, password, and email in the body of the request. Creating a new user is required to store and access data later. This route must be completed before attempting to use the api/signin route.

Example request:
```
http POST wheatlessinv2.herokuapp.com/api/signup username='test-user' password='test-pwd'<EMAIL_ADDRESS>```
Example response:
```
HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 205
Content-Type: text/html; charset=utf-8
Date: Wed, 11 Jan 2017 19:29:17 GMT
ETag: W/"cd-8A+12QvEbq7/QhA66gx6Yg"
X-Powered-By: Express

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbiI6IjczMzIyNGUwNjc4ZDE2MWE0YzhkNTU4ZjBmZGUwYTJhNGFkYzYxZDBlNGY3YmU0MGU1YTFhMTkzYmQ3MWM0ZjMiLCJpYXQiOjE0ODQxNjI5NTd9.YSbRREgNdCxpRYJDk6BTVEptu0OUXvIvCFDvbzqkx9w
```

A token will be returned that will only be used for the api/signin route. After sign-in, you will receive a new token that will be a reference for all future routes.
___
**Biz Post**
Example:https://wheatlessinv2.herokuapp.com/api/biz

Required Data:

Business Name and EIN number is the minimum required parameter for signup.
This route will authenticate the user and post a business that contains these required parameters.

Authorization Header
Bearer <response token from signin> will return in JSON format once a user's token is verified. The response will contain the business information that was originally provided by the business owner.

 Example request:
```
http POST wheatlessinv2.herokuapp.com/api/biz Authorization:'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbiI6ImFjM2RlYjNlODE1ZWNkY2NkZjBjMzU1NWRkNDQxNzI3NThkZWU1ZDFhZTRiNmQ0MDFiYzEyZWJmMTJlOTRiNzgiLCJpYXQiOjE0ODQxNjMzNzV9.dnkS7g3HutqyFVftrNoR_z2ks9lGD38voE-td8WgN5I' EIN='12-3456789' name='myBiz_name'
```
Example response:
```
HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 154
Content-Type: application/json; charset=utf-8
Date: Wed, 11 Jan 2017 19:55:09 GMT
ETag: W/"9a-6CbR3bRyyolYQV0B7+YlHw"
X-Powered-By: Express

{
    "EIN": "12-3456789",
    "__v": 0,
    "_id": "58768d9db3bd9616805d8d0e",
    "created": "2017-01-11T19:55:09.270Z",
    "name": "myBiz_name",
    "userId": "5876878db3bd9616805d8d0b"
}

```
Additional information a business will contain:
 loc: {
    lng: { type: Number, min: -180, max: 180 },
    lat: { type: Number, min: -90, max: 90 }
  },
  address: { Type: String },
  menu: { Type: Schema.Types.ObjectId },
  url: { Type: String },
  email: { Type: String },
  phone: { Type: String }

___
**Biz menu Post**

Example:https://wheatlessinv2.herokuapp.com/api/biz/58768d9db3bd9616805d8d0e/menu

Required Data:

There is no minimum required parameter for posting a menu. After generating a menu, the menu can be posted.
This route will authenticate the user and business and finally, post the menu.

Authorization Header
Bearer <response token from signin> will return in JSON format once a user's token is verified. The response will contain the menu information that was originally provided by the business owner.

Example request:
```
http GET wheatlessinv2.herokuapp.com/api/biz/58768d9db3bd9616805d8d0e/menu Authorization:'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbiI6IjE3MjQxMmM3Y2MyM2 U3Y2RjMGJhNTM3YzEzNWQ2MzJiYjA3MjAyZDUyY2VkMTBiZjE4ODY1NDNmZjlhYjIxYmIiLCJpYXQiOjE0ODQxNjk1Mjh9 .fjqVBiFznrbBMdCkwUDrGRlMIrl9TRI4Ike29a8xHVo' isCompletelyGlutenFree:=true
```
Example response:
```
HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 144
Content-Type: application/json; charset=utf-8
Date: Wed, 11 Jan 2017 21:24:45 GMT
ETag: W/"90-WGgdL9A1FDV728gv4ffIKQ"
X-Powered-By: Express

{
    "__v": 0,
    "_id": "5876a29db3d3061c3c93b88e",
    "bizId": "58768d9db3bd9616805d8d0e",
    "created": "2017-01-11T21:24:45.646Z",
    "isCompletelyGlutenFree": true
}
```
___
**Pic Post**
Example:https://wheatlessinv2.herokuapp.com/api/biz

Required Data:

An image file path.
This route will authenticate the user and post a business that contains the minimum required parameters.

Authorization Header
Bearer <response token from signin> will return in JSON format once a user's token is verified. The response will contain the business information that was originally provided by the business owner.

 Example request:
 ```
 http --form POST wheatlessinv2.herokuapp.com/api/menu/5876a29db3d3061c3c93b88e/pic Authorization:'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbiI6Ijg1M2ZhODFiNGU1ZjE3MGI0YmVhZGNjMDU3YmM1OTM2YzhhMzk2M2VhNmY1NGM1YTljYjAwNjUxNGZjYmJhNTQiLCJpYXQiOjE0ODQxN zA2ODB9.FSADbMng2-yI2bFSr2Cx2P__hpXiLFJPH033RuhRwAg'<EMAIL_ADDRESS> ```
 Example Response:
 ```
 HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 290
Content-Type: application/json; charset=utf-8
Date: Wed, 11 Jan 2017 21:47:03 GMT
ETag: W/"122-+EGOJoHVbl4tUhpVII/M6Q"
X-Powered-By: Express

{
    "__v": 0,
    "_id": "5876a7d7033be536d4fa5ffe",
    "created": "2017-01-11T21:47:03.541Z",
    "imageURI": "https://code-fellows.s3.amazonaws.com/70a463b6f5ac06078f1807581e5344e6.jpg",
    "menuId": "5876a29db3d3061c3c93b88e",
    "objectKey": "70a463b6f5ac06078f1807581e5344e6.jpg",
    "userId": "5876878db3bd9616805d8d0b"
    }
 ```
 ___
###GET

**User signin**
GET /api/signin

Example: https://wheatlessinv2.herokuapp.com/api/signin

Required Data:

Authorization header: username and password as JSON.

This route will require an authorization header that needs to include the a username and password of the specific user to be authenticated. Signing in will return a brand new token that will be used for future user ID reference.

Example request:
```
http GET wheatlessinv2.herokuapp.com/api/signin --auth='test-user:test-pwd'
```
Example response:
```
HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 205
Content-Type: text/html; charset=utf-8
Date: Wed, 11 Jan 2017 19:36:15 GMT
ETag: W/"cd-oSNWnur5CMaLvbweIhJNRw"
X-Powered-By: Express

eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbiI6ImFjM2RlYjNlODE1ZWNkY2NkZjBjMzU1NWRkNDQxNzI3NThkZWU1ZDFhZTRiNmQ0MDFiYzEyZWJmMTJlOTRiNzgiLCJpYXQiOjE0ODQxNjMzNzV9.dnkS7g3HutqyFVftrNoR_z2ks9lGD38voE-td8WgN5I

```
___
**biz get**
Example:https://wheatlessinv2.herokuapp.com/api/biz/58768d9db3bd9616805d8d0e

Required Data:

A Business ID.
This route will return all matches that have the provided id.

Authorization Header
No authentication required for fetching this data.

All property matching menu to that individual business will populate and display.

Example request:
```
http GET https://wheatlessinv2.herokuapp.com/api/biz/58768d9db3bd9616805d8d0e
```
Example response:
```
HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 154
Content-Type: application/json; charset=utf-8
Date: Wed, 11 Jan 2017 20:12:56 GMT
ETag: W/"9a-Vh346IY9p1S3p49AXlnjAQ"
X-Powered-By: Express

{
    "EIN": "12-3456789",
    "__v": 0,
    "_id": "58768d9db3bd9616805d8d0e",
    "created": "2017-01-11T19:55:09.270Z",
    "name": "myBiz_name",
    "userId": "5876878db3bd9616805d8d0b"
}

```
___
### PUT
**User Update**

GET /api/signin/update

Example: https://wheatlessinv2.herokuapp.com/api/signin/update

Required Data:

Authorization header: provide username and password as JSON

This route will require an authorization header that needs to include the token of the specific user to be authenticated. Update in will return a brand new token that will be used for future update user.

Authorization Header:
Bearer <response token from signin> will be returned in JSON format once a user's token is verified. The response will contain the business information that was originally provided.
Example request:
```
http PUT wheatlessinv2.herokuapp.com/api/signin/update Authorization:'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbiI6Ijd mNTJiZjU4OGQ5YjA4NTdkYWE5MmMzMDdhNTQxYmUxNGJmYjE3OGU2M2M2ZDQ2ODFkMWQ5ODk 0MGI3NDQxZjAiLCJpYXQiOjE0ODQyMDIzMTZ9.lxIQxUk3xjzW89ZgKei546nwbrVKmA8Zed BSXBNRo4g' password='new password'
```
Example response:
```
HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 200
Content-Type: application/json; charset=utf-8
Date: Thu, 12 Jan 2017 06:47:37 GMT
ETag: W/"c8-fhXvRYxPtfgYqnV3J7gPkw"
X-Powered-By: Express

{
    "__v": 0,
    "_id": "5877214c05b9ce21a84d9d3d",
    "email"<EMAIL_ADDRESS>    "findHash": "7f52bf588d9b0857daa92c307a541be14bfb178e63c6d4681d1d98940b7441f0",
    "password": "new password",
    "username": "test--user"
}
```
___
**Biz update**

Example:https://wheatlessinv2.herokuapp.com/api/biz/5877224205b9ce21a84d9d40

Required Data:
business id
This route will return all matches that have the provided id.

Authorization Header
Bearer <response token from signin>
it will be returned in JSON format once a user's token is verified. The response will contain a compleate business information as it was provided.

All business matching to biz.id will be update.

Example request:
```
http DELETE wheatlessinv2.herokuapp.com/api/biz/5877224205b9 ce21a84d9d40 Authorization:'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9. eyJ0b2tlbiI6IjdmNTJiZjU4OGQ5YjA4NTdkYWE5MmMzMDdhNTQxYmUxNGJmYjE3OGU2M2M2 ZDQ2ODFkMWQ5ODk0MGI3NDQxZjAiLCJpYXQiOjE0ODQyMDIzMTZ9.lxIQxUk3xjzW89ZgKei 546nwbrVKmA8ZedBSXBNRo4g' EIN='12-3456712' name='Biz_update'
```
Example Response:
```
HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 154
Content-Type: application/json; charset=utf-8
Date: Thu, 12 Jan 2017 06:30:29 GMT
ETag: W/"9a-PF5Bvij3/d1CWYCgGHEOIg"
X-Powered-By: Express

{
    "EIN": "12-3456712",
    "__v": 0,
    "_id": "5877224205b9ce21a84d9d40",
    "created": "2017-01-12T06:29:22.157Z",
    "name": "Biz_update",
    "userId": "5877214c05b9ce21a84d9d3d"
}
```
___
### DELETE
**Biz delete**

Example:https://wheatlessinv2.herokuapp.com/api/biz/58768d9db3bd9616805d8d0e

Required Data:
business id

Authorization Header:
Bearer <response token from signin> will be returned in JSON format once a user's token is verified. The response will contain the business information that was originally provided.

Example request:
```
http DELETE wheatlessinv2.herokuapp.com/api/biz/58768d9db3bd9616805d8d0e Authorization:'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ0b2tlbiI6IjE3MjQxMmM3Y2MyM2 U3Y2RjMGJhNTM3YzEzNWQ2MzJiYjA3MjAyZDUyY2VkMTBiZjE4ODY1NDNmZjlhYjIxYmIiLCJpYXQiOjE0ODQxNjk1Mjh9 .fjqVBiFznrbBMdCkwUDrGRlMIrl9TRI4Ike29a8xHVo'
```
Example response:
```
HTTP/1.1 204 OK
Connection: close
Content-Type: application/text; charset=utf-8
Date: Wed, 11 Jan 2017 20:12:56 GMT
ETag: W/"2-4KoCHiHd29bYzs7HHpz1ZA"
X-Powered-By: Express
```
___
**Pic Delete**

Example:https://wheatlessinv2.herokuapp.com/api/pic/:picId

Required Data:
picture id,
This route will authenticate the user before deletion.

Authorization Header:
Bearer <response token from signin> will be returned in JSON format once a user's token is verified. The response will contain the business information that was originally provided.

 Example request:
 ```
 http DELETE wheatlessinv2.herokuapp.com/api/pic/587735a19 d3cc020189ffd07 Authorization:'Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVC J9.eyJ0b2tlbiI6IjdmNTJiZjU4OGQ5YjA4NTdkYWE5MmMzMDdhNTQxYmUxNGJmYjE3OGU2M 2M2ZDQ2ODFkMWQ5ODk0MGI3NDQxZjAiLCJpYXQiOjE0ODQyMDIzMTZ9.lxIQxUk3xjzW89Zg Kei546nwbrVKmA8ZedBSXBNRo4g'
 ```
 Example response:
 ```
 HTTP/1.1 200 OK
Connection: keep-alive
Content-Length: 42
Content-Type: application/json; charset=utf-8
Date: Thu, 12 Jan 2017 08:30:53 GMT
ETag: W/"2a-8exXjIdMvPbXCgLPXwWQMQ"
X-Powered-By: Express

{
    "DeleteMarker": "true",
    "VersionId": "null"
}
 ```
****
# Testing

### Testing Framework

mocha test runner
chai (expect)
bluebird promise library

###Continuous Integration

travis-ci

###Coveralls

license: MIT

repository: bhavyaab/wheatlessIn

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: bhavyaab/wheatlessIn


text:
---
title: "TLC Meeting - October 13, 2022"
linkTitle: "TLC - October 13, 2022"
date: 2022-10-13
---

Meetings are happening on the `#selenium-tlc` channel on [Selenium Slack](https://selenium.dev/support).

The next meeting will be Thursday, October 27 at 0700 Pacific / 1000 Eastern / 1500 UK / 1930 India.

## Agenda
* Ticket Status
* CDP support
* Membership Updates
* Proposals
* CI Health
* Selenium 4.6
* Projects Underway
* Backlog

***

### Ticket Status

* 88 open Issues; last meeting: 79
* 25 outstanding PRs; last meeting: 19

### CDP support

* v105 & v106 added to Selenium v4.5
* v107 scheduled October 25

### Membership Updates

* Corina Pip added to PLC!

### Proposals

* [Disallow using SelectList class for disabled select lists](https://github.com/SeleniumHQ/selenium/issues/10812)
  * Decision: Reverting the part preventing people from using it to get info from options elements in disabled select
    lists and keeping the part about erroring when attempting to select an option that is disabled.

* [Deprecate FirefoxProfile except to zip existing profiles](https://github.com/SeleniumHQ/selenium/pull/11118)
  * Decision: Deprecate everything, including things that work and have FirefoxProfile *only be used for zipping
    existing profiles; all other tweaks must use capabilities.

* [Switch headless methods to new headless mode (or remove)](https://github.com/SeleniumHQ/selenium/pull/11099)
  * Decision: Deprecate and remove the convenience method, users would need to set it in the args. A blog post
    explaining the decision is needed.

* [BiDi proposal](https://docs.google.com/document/d/1dCd8Y2PYaR5mOGSmNTwllEHNmFqegfoGkP-TCKvPzSU/edit#)
  * Still on review.

### CI Health

No updates

### Selenium 4.6

* https://github.com/SeleniumHQ/selenium/issues?q=is%3Aopen+is%3Aissue+milestone%3A4.6

### Projects in Progress

* BiDi API work — [pujagani] proposal has been made needs feedback - https://docs.google.com/document/d/1dCd8Y2PYaR5mOGSmNTwllEHNmFqegfoGkP-TCKvPzSU/edit#
* Selenium Manager — [bonigarcia] about to provide Milestone 1
* Python Type Hints - [symonk] making progress on this
* Implement JS with TypeScript (#10942) - [harsha509] is working on this

### Backlog

List of items referenced:

* Add TouchActions API to Selenium (#10808)
* Add/fix Bazel support in .NET (#10465)
* Add .rbs files in Ruby (#10943)
* Comprehensive command logging across languages (#10944)
* Selenium + Appium consolidation
* Rewrite atoms in TypeScript
* Deprecate Java 8 - this was noted to be less of a "project"
* Python Async Rewrite
* .NET Async Rewrite

[boni_gg]: https://twitter.com/boni_gg/
[harsha509]: https://github.com/harsha509/
[pujagani]: https://github.com/pujagani/
[symonk]: http://github.com/symonk/
[titusfortner]: https://github.com/titusfortner/

branch_name: refs/heads/trunk

gha_language: HTML


text:
# WARNING: This repository is no longer maintained :warning:

> The generated content is now available in our [Go-lang static application](https://github.com/IBM/go-gin-app).

> This repository will not be updated. The repository will be kept available in read-only mode.

#  GoServer Generator

[![IBM Cloud powered][img-ibmcloud-powered]][url-cloud]
[![Travis][img-travis-master]][url-travis-master]
[![Coveralls][img-coveralls-master]][url-coveralls-master]
[![Version][img-version]][url-npm]
[![DownloadsMonthly][img-npm-downloads-monthly]][url-npm]
[![DownloadsTotal][img-npm-downloads-total]][url-npm]
[![License][img-license]][url-npm]

[img-ibmcloud-powered]: https://img.shields.io/badge/IBM%20Cloud-powered-blue.svg
[url-cloud]: http://bluemix.net
[url-npm]: https://www.npmjs.com/package/generator-goserver
[img-license]: https://img.shields.io/npm/l/generator-goserver.svg
[img-version]: https://img.shields.io/npm/v/generator-goserver.svg
[img-npm-downloads-monthly]: https://img.shields.io/npm/dm/generator-goserver.svg
[img-npm-downloads-total]: https://img.shields.io/npm/dt/generator-goserver.svg

[img-travis-master]: https://travis-ci.org/ibm-developer/generator-goserver.svg?branch=master
[url-travis-master]: https://travis-ci.org/ibm-developer/generator-goserver/branches

[img-coveralls-master]: https://coveralls.io/repos/github/ibm-developer/generator-goserver/badge.svg
[url-coveralls-master]: https://coveralls.io/github/ibm-developer/generator-goserver

## Overview

This generator produces a Go + Gin server project with all the ingredients you need for a good start at building a cloud native application. You can choose between either a simple web app, microservice pattern, or a simple blank app.

You can also bring your own optional [OpenAPI 2.0 document](https://swagger.io/docs/specification/2-0/basic-structure/) to direct code generation for top-down development.

### Monitoring and Health

The generated projects are pre-wired for monitoring and health checks. The app includes:

1. [Prometheus endpoint](https://github.com/prometheus/client_golang)

1. [Hystrix fault tolerance](https://github.com/afex/hystrix-go)

1. `/health` endpoint returning JSON payload for UP and DOWN

### Deployment Enablement

The generated projects include deployment configuration for the following environments:

1. Docker

    The projects include Dockerfiles to build images for both release and development.

1. Kubernetes

    The projects include a Helm chart for deployment to Kubernetes.

1. Cloud Foundry

    The projects include a manifest for deployment to Cloud Foundry.

1. Dev-ops Pipeline

    The projects include a toolchain and pipeline definition for CI/CD deployment to the IBM Cloud.

## Pre-requisites

- Install [Yeoman](http://yeoman.io)

```bash
npm install -g yo
```

## Installation

```bash
npm install -g generator-goserver
```
## Usage

```bash
yo goserver
```

### Prompting

When running the generator with prompts, make sure you set up a [GOPATH](https://github.com/golang/go/wiki/SettingGOPATH). Your application directory will be generated at `$GOPATH/src/<application-name>`.

When you run 'yo goserver', it will prompt you for the following:

1. Application name

    Specify the application name. It defaults to the current directory name.  This is a required value.

1. Application type

    Specify the type of application you want to create. The options are basic web app, microservice, or a simple blank app.

1. OpenAPI 2.0 doc file name (if blank application type selected)

    Specify the relative or absolute file name of a OpenAPI 2.0 document to direct the project's code generation. A route stub will be scaffolded and registered for each route defined in the OpenAPI 2.0 document. This is an optional value.

1. Docker registery

    Specify a docker registry. This is an optional value.

1. Deployment type

    Specifies the environment to which you would want to deploy you app to. Options are Cloud Foundry or Kubernetes.

1. IBM Cloud Service Enablement

    Specify Y|N whether or not you want to scaffold IBM Cloud service enablement into your project.  If you specify 'Y', you will be able to select one or more services from a checklist. For each service you select, configuration and access scaffolding code is generated.  IBM Cloud service enablement is optional.

### Bluemix mode (without prompting)
Use bluemix mode to create an app without having to use the UI. This is useful when you want to use this generator to build a project by only running a script instead of interactively.

#### Bluemix usage
To specify the name of the project use:

```bash
yo goserver --bluemix='{"name":"your-app-name"}'
```

To specify the type of your application:

```bash
yo goserver --bluemix='{"name":"your-app-name"}' --spec='{"applicationType":"your-app-type"}'
```

The three valid application types are: WEBAPP, MS, and BLANK

To specify which services to add use:

```bash
yo goserver --bluemix='{"services":["service1", "service2"]}'
```
For valid services see below.

Full usage:
```bash
yo goserver --bluemix='{"name":"your-app-name","swaggerFilePath":"path-to-your-file","services":["service1", "service2"]}' --spec='{"applicationType":"your-app-type"}'
```

Note: you can only provide a swagger path if it is a blank application.

#### Valid Services

* 'watson assistant'
* 'watson discovery'
* 'watson language translator'
* 'watson natural language classifier'
* 'watson language understanding'
* 'watson personality insights'
* 'watson speech to text'
* 'watson text to speech'
* 'watson tone analyzer'
* 'watson visual recognition'

## Project Build/Run

Build your generated project one of two ways:

1. If you want to run the project locally, first make sure you have [dep](https://github.com/golang/dep) for dependency management. Then run the following:

    ```
    dep ensure
    go run server.go
    ```

1. Containerized, using IBM Cloud Developer Tools.

    - Install [IBM Cloud Developer Tools](https://console.bluemix.net/docs/cli/idt/setting_up_idt.html#add-cli) on your machine
    - Install the dev plugin: `ibmcloud plugin install dev`

    Note that a containerized approach is supported through the tooling in special consideration of Kubernetes as a deployment environment, following the dev/prod parity principle of [12 Factor Apps](https://12factor.net/).

    There are `ibmcloud dev` commands to simplify this for you:

    1. `ibmcloud dev build`

        Builds Docker image for dev mode and does dep ensure to install dependencies.

    1. `ibmcloud dev test`

        Runs project unit tests in dev mode Docker container.

    1. `ibmcloud dev debug`

        Runs the project in debug mode in the dev mode Docker container. The app will start and listen on port 8181 by default for a debug client to attach and take control.

    1. `ibmcloud dev run`

        Runs the project in the release mode Docker container.  The release mode Docker container is built with GIN_MODE set to release.

## Project Deployment

### Docker

Build a Docker image and run project in a Docker container using Docker commands in the project root directory:

1. `docker build -t my-image .`
1. `docker run -p 8080:8080 --name my-container my-image`

Stop and optionally remove the container and image with the following commands:

1. `docker stop my-container`
1. `docker rm my-container`
1. `docker rmi my-image`

### Kubernetes Deployment

Deploy to Kubernetes using Helm or the IBM Cloud Developer Tools.

1. Helm

    1. Push your image to a Docker image accessible to your Kubernetes environment, such as [Docker Hub](https://hub.docker.com) or your company's private image registry.

    1. Install your project from the project's root directory, using the included Helm chart:

        helm install chart/`<application name>` --name=`<release name>` --set image.repository=`<image name>` --set image.tag=`<tag value>` --set image.pullPolicy=`<pull policy>`

        Where:

        - `<application name>`

            The name you gave to your application when you generated it.

        - `<release name>`

            An arbitrary name you give to this install instance.

        - `<image name>`

            The registry/image name of your release Docker image - e.g.
            'registry.ng.bluemix.net/myspace/myimage'

        - `<tag value>`

            The image tag value of your release Dockerimage - e.g. 'latest' or '1.0.0'

        - `<pull policy>`

            'Always' or 'IfNotPresent'.  See [Kubernetes image documentation](https://kubernetes.io/docs/concepts/containers/images/) for further explanation.

    Notes:
    1. If the `helm install` command above gives you an error about not finding 'tiller', execute `helm init --upgrade`.

    1. The helm command installs to the Kubernetes environment pointed to by the KUBECONFIG environment variable. Make sure you are in configuration mode for your Kubernetes cluster.

    1. The Helm command is installed when you install the IBM Cloud Developer Tools.

    1. To delete the helm deployment, execute `helm del --purge <release name>`.

1. IBM Cloud Developer Tools

    `ibmcloud dev deploy --target container`

    Notes:

    1. The tool will prompt for registry/image name, then push your image and install your Helm chart to the Kubernetes environment pointed to by your KUBECONFIG environment variable.

    1. For IBM Cloud, set KUBECONFIG using `ibmcloud cs cluster-config <cluster name>`.  Note this command is installed as part of IBM Cloud Developer Tools.

### Clound Foundry Deployment

1. Add a host entry to the "manifest.yml" file (Ex. `host: my-app-name`).

1. If you want to connect to a service that is already provisioned in the Cloud, add the instance name in manifest.yml under `services` or replace the placeholder if you indicated a service on project creation

1. cf push

   Note: if you installed IBM Cloud Developer Tools, you can run the `ibmcloud cf push` command. Otherwise, install the cf command from [Pivotal](https://docs.run.pivotal.io/cf-cli/install-go-cli.html).

1. IBM Cloud Developer Tools

    `ibmcloud dev deploy`

## Development

Clone this repository and link it via npm

```bash
git clone https://github.com/ibm-developer/generator-goserver
cd generator-goserver
npm link
```

In a separate directory invoke the generator via

```bash
yo goserver
```

## Publishing Changes

In order to publish changes, you will need to make a pull request against `master` by either fork the repository or creating a new branch against `master`.

Make sure to follow the [conventional commit specification](https://conventionalcommits.org/) before contributing. To help you with commit a commit template is provide.  Do a pull request against `master`, make sure the build passes. A team member will review and merge your pull request.
Once merged to `master` an auto generated pull request will be created against master to update the changelog. Make sure that the CHANGELOG.md and the package.json is correct before merging the pull request. After the auto generated pull request has been merged to `master` the version will be bumped and published to npm.

repository: ibm-developer/generator-goserver

branch_name: refs/heads/develop

gha_language: JavaScript

repo_name: ibm-developer/generator-goserver


text:
---
layout: post
title: "Link Dump: OpenStack"
description: ""
category:
tags: ["openstack"]
---
{% include JB/setup %}

Awwww, I had to nuke most of my poor old OpenStack bookmarks because they were mostly from the Diablo/Essex/Folsom era and were pretty outdated.

* [Mirantis OpenStack Reference Architectures](http://docs.mirantis.com/fuel/fuel-3.2.1/reference-architecture.html)
* [IRC](https://wiki.openstack.org/wiki/IRC)
* [Planet OpenStack](http://planet.openstack.org/)
* [Red Hat OpenStack](https://openstack.redhat.com/Main_Page)
* [Ask OpenStack](https://ask.openstack.org/en/questions/)
* [OpenStack Official Blog](http://www.openstack.org/blog/)
* [OpenStack Mailing Lists](http://lists.openstack.org/cgi-bin/mailman/listinfo)
* [Puppet Labs Reference and Testing Deployment Module for OpenStack](https://github.com/puppetlabs/puppetlabs-openstack)
* [StackForge](https://github.com/stackforge)
* [MirantisLabs](https://github.com/MirantisLabs)
* [OpenStack Security Group (OSSG) Hardening Guide](https://github.com/noslzzp/OSSG_Hardening_Guide)


text:
# Objectives
An expense tracker that can:
1) Filter expenses by year
2) Add new expense (Chart will be updated, expense will be logged)

## Output

# Getting Started

Concept learned
- React
- JSX
- Components in react
- React state
- Working with events
- Rendering List & Conditional Content

## Language used
React, CSS, Javascript

## Author
Abrial Wong

## Acknowledgments
Special thanks to:-

1.  Udemy React - The Complete Guide (incl Hooks, React Router, Redux by [Academind by Maximilian Schwarzmüller](https://www.udemy.com/user/academind/)

repository: AbrialWong/ExpenseTracker

repo_name: AbrialWong/ExpenseTracker


text:
![Exercise 1](imgs/01-change-colors.png)
![Exercise 2](imgs/02-column.png)
![Exercise 3](imgs/03-row.png)
![Exercise 4](imgs/04-make-equidistant.png)
![Exercise 5](imgs/05-squares.png)
![Exercise 6](imgs/06-footer.png)
![Exercise 7](imgs/07-header.png)
![Exercise 8](imgs/08-sidebar.png)
![Exercise 9](imgs/09-creative.png)

**How can you use Chrome's DevTools inspector to help you format or position elements?**

I think the nice part about the Chrome DevTools inspector is that it allows the user to easily diagnose potential positioning issues visually, which of course is a lot better than doing so in just lines of code.

I think in particular, seeing the box model, with margins, padding, etc. makes the job way easier. Great tool.

**How can you resize elements on the DOM using CSS?**

A few ways that I think we used:
	-Using actual height / width properties
	-Manipulating parts of the box model -- padding and borders both affect element size

**What are the differences between absolute, fixed, static, and relative positioning? Which did you find easiest to use? Which was most difficult?**

Static:  Default / not positioned - so it renders where it was supposed to
Relative:  Same as static, but with adjustments like top/bottom/left/right that modify its position "relative" to where it otherwise would be
Fixed:  Stays on the page no matter what scrolling happens, positioned relative to the browser window
Absolute:  Positioned relative to its first positioned (not static) ancestor -- I believe this can be to a sibling or to a parent

I think relative and absolute are the most difficult, especially as they could depend on each other so much. I struggled with the absolute a lot, not realizing that it was so dependent on other ancestors.

**What are the differences between margin, border, and padding?**

The way I see it is:
	Margin:  Space around the object, kind of like a moat around the element
	Border: The actual edge, which can be as thick as it wants and adds to the size
	Padding:  The space inside the element from the border, which can also add to size

**What was your impression of this challenge overall? (love, hate, and why?)**

I like this one. I think it forces us to:
1) Learn how to use ChromeDevTools, which looks like it will be useful for working with positioning
2) Think about how to use the various positioning / sizing elements, which will be important as we start building out our own layouts.

gha_language: Ruby


text:
# Hydnum stereosarcinon (Wehm.) K.A. Harrison, 1961 SPECIES

#### Status
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Publs Dep. Agric. Can. 1099: 30 (1961)

#### Original name
Sarcodon stereosarcinon Wehm., 1940

### Remarks
null

repository: mdoering/backbone

path: /life/Fungi/Basidiomycota/Agaricomycetes/Thelephorales/Bankeraceae/Sarcodon/Sarcodon stereosarcinon/ Syn. Hydnum stereosarcinon/README.md

repo_name: mdoering/backbone


text:
elixir-infobip
============
[![Build Status](https://secure.travis-ci.org/craigp/elixir-infobip.png?branch=master "Build Status")](http://travis-ci.org/craigp/elixir-infobip)
[![Coverage Status](https://coveralls.io/repos/craigp/elixir-infobip/badge.svg?branch=master&service=github)](https://coveralls.io/github/craigp/elixir-infobip?branch=master)
[![hex.pm version](https://img.shields.io/hexpm/v/infobip.svg)](https://hex.pm/packages/infobip)
[![hex.pm downloads](https://img.shields.io/hexpm/dt/infobip.svg)](https://hex.pm/packages/infobip)
[![Inline docs](http://inch-ci.org/github/craigp/elixir-infobip.svg?branch=master&style=flat)](http://inch-ci.org/github/craigp/elixir-infobip)

A simple Infobip REST API client for Elixir.

You can find the hex package [here](https://hex.pm/packages/infobip), and the docs [here](http://hexdocs.pm/infobip).

## Usage

```elixir
def deps do
  [{:infobip, "~> 0.2"}]
end
```

Then run `$ mix do deps.get, compile` to download and compile your dependencies.

You'll need to set a few config parameters, take a look in the `dev.exs` file for
an example of what is required.

Then sending a text message is as easy as:

```elixir
:ok = Infobip.send("27820001111", "Test message")
```

You can optionally specify a message ID if you want to fetch delivery reports:

```elixir
:ok = Infobip.send("27820001111", "Test message", "123")
```

You need to pass a valid international mobile number to the `send` method.

To fetch a delivery report, just use the message ID you assigned in `send/3`:

```elixir
Infobip.delivery_report("123")
```

## TODO

* [x] Send text messages
* [x] Documentation
* [x] Fetch delivery reports
* [ ] SMPP interface

repository: craigp/elixir-infobip

gha_language: Elixir

gha_license_id: MIT

repo_name: craigp/elixir-infobip


text:
# Contributing Guidelines

## Protobuf API

### Style Conventions

This folder contains all protobuf files that we have defined. We follow the Google Cloud's [API design
guide](https://cloud.google.com/apis/design/), including the following conventions:

* Ordering:
  1. _syntax, package, import, option_ statements
  2. overview documentation
  3. _service_ definition(s)
  4. request and response messages (ordered as respective methods)
  5. resource messages while parents are defined before child resources
* File names:
  * <lower_case_underscore_separated_names>.proto
  * File name corresponding to (single) service
* proto file only containing resources, consider naming this file simply as resources.proto
* ENUM (Scale): The first value should be named ENUM_TYPE_UNSPECIFIED
* Commenting: Comment services, RPCs and messages
* Request and response messages
  * A **custom method** should have a response message even if it is empty (see [Cloud APIs Common design patterns](https://cloud.google.com/apis/design/design_patterns#empty_responses)).

  * **Standard methods** use request and response messages according to the following table (see [Cloud APIs Naming conventions](https://cloud.google.com/apis/design/naming_convention#method_names)).

| Method name | Request Body      | Response Body         |
| ----------- | ----------------- | --------------------- |
| ListBooks   | ListBooksRequest  | List*Response         |
| GetBook     | GetBookRequest    | Book                  |
| CreateBook  | CreateBookRequest | Book                  |
| UpdateBook  | UpdateBookRequest | Book                  |
| RenameBook  | RenameBookRequest | RenameBookResponse    |
| DeleteBook  | DeleteBookRequest | google.brotobuf.Empty |

* Even if we *transfer* a single resource (e.g. in the case of `StoreEvidence`) we create a corresponding `XxxRequest` message (`StoreEvidenceRequest`). `XxxRequest` allows adding new fields to the request (e.g. metadata) while not breaking the code.
* In case of an error we return nil instead of the `XxxResponse`.

### Generate Go files

In order to generate all necessary Go files, the command `go generate ./...` can be used.

repository: clouditor/clouditor

branch_name: refs/heads/main

gha_language: Go

repo_name: clouditor/clouditor


text:
# Alan

## Company blurb

Our mission is to improve the health of millions of people and become the number one healthcare partner in Europe.

## Company size

500+

## Remote status

We are a remote-first company.

You can discover more about our remote-first policy [here](https://medium.com/alan/working-at-alan-from-anywhere-9a6fe381dc0a).

## Region

We are currently hiring from 8 countries accross Europe:
- France 🇫🇷
- Spain 🇪🇸
- Belgium 🇧🇪
- Sweden 🇸🇪
- Germany 🇩🇪
- Luxembourg 🇱🇺
- Ireland 🇮🇪

## Company technologies

Our front-ends are in Typescript, React for web, React-Native for our mobile applications. We switched from Javascript a few months back. Our back-end is in Python/Flask. We use SQLAlchemy as our ORM. Our database is PostgreSQL. We also use Redis as a messaging system. We are deployed on AWS. All of our code is in two mono-repositories from which we deploy several applications, so no microservices here.

We have a CI/CD built with CirceCI. The CI runs the myriad of tests we have, both for backend and frontend. We don’t have full integration tests, where we test both the front and back at the same time.

We like to be straightforward and simple. That doesn’t mean we aren’t opened to new solutions/technologies. When engineers want to introduce a new technology, they open a written discussion about it; it’s like any decision making we do.

You can learn more about our technologies in our [product and technical blog](https://medium.com/alan).

## Office locations

As said earlier we are a remote-frst company but this does not mean we don't have offices/coworking spaces.

Our main office is located in Paris, France 🇫🇷 and we do have coworking spaces in other european cities:
- Annecy 🇫🇷
- Bordeaux 🇫🇷
- Lille 🇫🇷
- Lyon 🇫🇷
- Marseille 🇫🇷
- Montpellier 🇫🇷
- Nantes 🇫🇷
- Strasbourg 🇫🇷
- Toulouse 🇫🇷
- Tours 🇫🇷
- Barcelona 🇪🇸
- Madrid 🇪🇸
- Brussels 🇧🇪
- Gent 🇧🇪

## How to apply

You'll find all of our current open positions [here](https://jobs.lever.co/alan).

repository: remoteintech/remote-jobs

repo_name: remoteintech/remote-jobs


text:
# Path-based strong component algorithm

Find all strongly-connected components in a graph structure. These can be used to identify cycles (= components with more than one node).

## Usage

```javascript
const scc = require('scc').scc // or: import {scc} from 'scc'
const nodes = [{ id: 'A' }, { id: 'B' }]
const links = [{ source: 'A', target: 'B' }, { source: 'B', target: 'A' }]
const components = scc(nodes, links)
components == [{ id: 'A' }, { id: 'B' }]
```

TypeScript type declarations are included.

## Description

Source: [WikiPedia](https://en.wikipedia.org/wiki/Path-based_strong_component_algorithm)

The algorithm performs a depth-first search of the given graph G, maintaining as it does two stacks S and P (in addition to the normal call stack for a recursive function). Stack S contains all the vertices that have not yet been assigned to a strongly connected component, in the order in which the depth-first search reaches the vertices. Stack P contains vertices that have not yet been determined to belong to different strongly connected components from each other. It also uses a counter C of the number of vertices reached so far, which it uses to compute the preorder numbers of the vertices.

When the depth-first search reaches a vertex v, the algorithm performs the following steps:

1. Set the preorder number of v to C, and increment C.
2. Push v onto S and also onto P.
3. For each edge from v to a neighboring vertex w:
    * If the preorder number of w has not yet been assigned, recursively search w;
    * Otherwise, if w has not yet been assigned to a strongly connected component:
        * Repeatedly pop vertices from P until the top element of P has a preorder number less than or equal to the preorder number of w.
4. If v is the top element of P:
    * Pop vertices from S until v has been popped, and assign the popped vertices to a new component.
    * Pop v from P.

The overall algorithm consists of a loop through the vertices of the graph, calling this recursive search on each vertex that does not yet have a preorder number assigned to it.

repository: jdiehl/path-scc

repo_name: jdiehl/path-scc


text:
# `package.ksqldb_tocloud` - ModEco

The ModEco Confluent ksqlDB package, with SASL authentication.
See `conteco.docs.overview` for more information on the ModEco ecosystem.

This package a KSQL server instance to be used with Kafka.

## Contents

The module consists of the following service stack:

 * `ksqldb_server` - ksqlDB Server instance to be used with Kafka.

## Configuration

It exposes configuration variables that allow interactive mode and a SQL query file.


text:
# WfmVersionedEntityMetadata

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**version** | **int** | The version of the associated entity.  Used to prevent conflicts on concurrent edits |
**modifiedBy** | [**\PureCloudPlatform\Client\V2\Model\UserReference**](UserReference.md) | The user who last modified the associated entity | [optional]
**dateModified** | [**\DateTime**](\DateTime.md) | The date the associated entity was last modified. Date time is represented as an ISO-8601 string. For example: yyyy-MM-ddTHH:mm:ss.SSSZ | [optional]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

repository: jameBruno/platform-client-sdk-php

repo_name: jameBruno/platform-client-sdk-php


text:
---
metaTitle: "Android - FileProvider"
description: "Sharing a file"
---

# FileProvider

## Sharing a file

In this example you'll learn how to share a file with other apps. We'll use a pdf file in this example although the code works with every other format as well.

The roadmap:

### Specify the directories in which the files you want to share are placed

To share files we'll use a FileProvider, a class allowing secure file sharing between apps. A FileProvider can only share files in predefined directories, so let's define these.

Create a new XML file that will contain the paths, e.g. **res/xml/filepaths.xml**

Add the paths

```java
<paths xmlns:android="http://schemas.android.com/apk/res/android">
    <files-path name="pdf_folder" path="documents/"/>
</paths>

```

###  Define a FileProvider and link it with the file paths

```java
<manifest>
    ...
    <application>
        ...
        <provider
            android:name="android.support.v4.context.FileProvider"
            android:authorities="com.mydomain.fileprovider"
            android:exported="false"
            android:grantUriPermissions="true">
            <meta-data
                android:name="android.support.FILE_PROVIDER_PATHS"
                android:resource="@xml/filepaths" />
        </provider>
        ...
    </application>
    ...
</manifest>

```

###  Generate the URI for the file

```java
// We assume the file we want to load is in the documents/ subdirectory
// of the internal storage
File documentsPath = new File(Context.getFilesDir(), "documents");
File file = new File(documentsPath, "sample.pdf");
// This can also in one line of course:
// File file = new File(Context.getFilesDir(), "documents/sample.pdf");

Uri uri = FileProvider.getUriForFile(getContext(), "com.mydomain.fileprovider", file);

```

As you can see in the code we first make a new File class representing the file. To get a URI we ask FileProvider to get us one. The second argument is important: it passes the authority of a FileProvider. It must be equal to the authority of the FileProvider defined in the manifest.

###  Share the file with other apps

```java
Intent intent = ShareCompat.IntentBuilder.from(getContext())
    .setType("application/pdf")
    .setStream(uri)
    .setChooserTitle("Choose bar")
    .createChooserIntent()
    .addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);

Context.startActivity(intent);

```

A chooser is a menu from which the user can choose with which app he/she wants to share the file. The flag Intent.FLAG_GRANT_READ_URI_PERMISSION is needed to grant temporary read access permission to the URI.

repository: haifenghuang/generate

repo_name: haifenghuang/generate


text:
# Managed WimgApi Wrapper

[![Microsoft.Wim](https://img.shields.io/nuget/v/Microsoft.Wim.svg?maxAge=2592000)](https://www.nuget.org/packages/Microsoft.Wim) [![Visual Studio Team services](https://img.shields.io/vso/build/jeffkl/487e5200-8ecd-445c-9bc6-fa9864a67fc0/9.svg?maxAge=120)]()

A managed wrapper for the native Windows Imaging API (WIMGAPI). The classes and methods are as close to the original API as possible.

See the [wiki](https://github.com/josemesona/ManagedWimgApi/wiki) for more information.

# Contributing
Please read the [Contributing doc](CONTRIBUTING.md) for information on building the code and contributing to the project.

repository: pos-x/ManagedWimgApi

repo_name: pos-x/ManagedWimgApi


text:
# AOA's Seolhyun playfully brags about snagging a female idol's phone number

Published at: **2019-11-03T23:31:00+00:00**

Author: **KayRosa**

Original: [allkpop](https://www.allkpop.com/article/2019/11/aoas-seolhyun-playfully-brags-about-snagging-a-female-idols-phone-number)

Looks like AOA's Seolhyun made some fans "jealous" with her recent feat.
Recently, amid AOA's celebrated appearance on Mnet's 'Queendom', Seolhyun took to Instagram Live and interacted with her fans in the car. During the live stream, fans asked Seolhyun if she ever became close with Oh My Girl members, to which she answered with a knowing smile.

license: Unlicense

repository: dsadlollioygjmzvcxv/tdc-exported

repo_name: dsadlollioygjmzvcxv/tdc-exported


text:
[![Build Status](https://travis-ci.org/networktocode/ntc-templates.svg?branch=master)](https://travis-ci.org/networktocode/ntc-templates)

REPOSITORY OF TEXTFSM TEMPLATES FOR NETWORK DEVICES

NTC-Templates contains a set of multi-vendor templates based around TEXTFSM parsing engine.

These templates take the raw string input from the CLI of network infrastructure devices, such as Cisco IOS, Juniper JUNOS
or HPE Comware devices, run them through a TEXTFSM template and return structured text in the form of a Python dictionary.

# Contributing

Pull request are welcomed and automatically built and tested through TravisCI.

To contribute new templates, each new pull request must include the folowing

- TextFSM template
- raw version of text to be parsed
- YAML file containing the expected parsed dictionary
- Modified version of the **index** file

Some notes on contributing that should help you ensure that your TravisCI builds comes back as successful:

## TextFSM Templates

TextFSM templates should be placed in the `./templates` folder and should adhere to the NTC-Templates style.
The TextFSM template name should be in the following format

```
{{ vendor_name }}_{{show_command}}
```

Note: The vendor name must be valid from the [Netmiko](https://github.com/ktbyers/netmiko/tree/master/netmiko) library.

The **Value** variable should be in UPPERCASE.

An example of the proper format is shown below.

```
Value TIME (\d+:\d+:\d+)
Value TIMEZONE (\S+)
Value DAYWEEK (\w+)
Value MONTH (\d+)
Value DAY (\d+)
Value YEAR (\d+)

Start
  ^${TIME}\s+${TIMEZONE}\s+${DAYWEEK}\s+${DAY}/${MONTH}/${YEAR} -> Record
```

## Raw version of Input Text

The raw text file should contain **only** the output of the CLI command to be parsed. It should **not** contain the CLI command itself
The raw text file should be placed in a folder in the `./tests` directory with the same name as the template file minus the .template extension

An example of the proper format is shown below

```
19:35:31 UTC Sat 01/08/2011
```

## YAML file containing expected parsed dictionary

The parsed dictionary must be in a dictionary format. All keys in the dictionary should be in all lowercase

The parsed text file should be placed in a folder in the ./tests directory with the same name as the template file minus the
`.template` extension. The raw text file and the parsed text file should be in the same folder.

An example of the proper format is shown below

```yaml
---

parsed_sample:

- {day: '01', dayweek: Sat, month: 08, time: '19:35:31', timezone: UTC, year: '2011'}
```

Multiple RAW and Parsed files are supported per folder, and are encouraged, as there are differences depending on version, length, etc... that additional testing and more real life data helps identify.

## Index File

The Index file binds the templates to the commands being run. Special care has been taken on ordering, as there is potential for issues. e.g. `show ip route` picking up for `show ip router vrf <vrf-name>`. We have used a combination of ordering, as defined:

 - OS in alphabetical order
 - Command in length other
 - When Length is the same, use alphabetical order
 - Keep space between OS's

Example:

```
Template, Hostname, Platform, Command

arista_eos_show_mlag.template, .*, arista_eos, sh[[ow]] ml[[ag]]
arista_eos_show_vlan.template, .*, arista_eos, sh[[ow]] vl[[an]]

cisco_asa_dir.template,  .*, cisco_asa, dir

cisco_ios_show_capability_feature_routing.template,  .*, cisco_ios, sh[[ow]] cap[[ability]] f[[eature]] r[[outing]]
cisco_ios_show_interface_transceiver.template, .*, cisco_ios, sh[[ow]] int[[erface]] trans[[ceiver]]
cisco_ios_show_cdp_neighbors_detail.template, .*, cisco_ios, sh[[ow]] c[[dp]] neig[[hbors]] det[[ail]]
```

# Questions

For any questions or comments, please feel free to swing by the [networktocode slack channel](https://networktocode.slack.com).

Sign up [here](http://slack.networktocode.com/)

repository: ArmisSecurity/ntc-templates

gha_language: Python

gha_license_id: NOASSERTION

repo_name: ArmisSecurity/ntc-templates


text:
[![Build Status](https://github.com/dart-lang/pub/workflows/Dart%20CI/badge.svg)](https://github.com/dart-lang/pub/actions/workflows/test.yaml?query=workflow%3A%22Dart+CI%22+branch%3Amaster)

Pub is the package manager for Dart.

# Contributing to pub

Thanks for being interested in contributing to pub! Contributing to a new
project can be hard: there's a lot of new code and practices to learn. This
document is intended to get you up and running as quickly as possible. For
more information, see the
[pub tool documentation](https://dart.dev/tools/pub/cmd).

The first step towards contributing is to contact the pub dev team and let us
know what you're working on, so we can be sure not to start working on the same
thing at the same time. Open an [issue](http://github.com/dart-lang/pub/issues/new)
letting us know that you're interested in contributing and what you plan on working on.
This will also let us give you specific advice about where to start.

## Organization

Pub isn't a package, but it's organized like one. It has four top-level
directories:

* `lib/` contains the implementation of pub. Currently, it's all in `lib/src/`,
  since there are no libraries intended for public consumption.

* `test/` contains the tests for pub.

* `bin/` contains `pub.dart`, the entrypoint script that's run whenever a user
  types "pub" on the command line or runs it in the Dart editor. This is usually
  run through shell scripts in `sdk/bin` at the root of the Dart repository.

It's probably easiest to start diving into the codebase by looking at a
particular pub command. Each command is encapsulated in files in
`lib/src/command/`.

## Running pub

To run pub from the Git repository, run:

    dart bin/pub.dart

## Testing pub

Before any change is made to pub, all tests should pass. To run a pub test, run:

    dart tool/test.dart test/path/to_test.dart

To run all tests at once, run:

    dart tool/test.dart

Changes to pub should be accompanied by one or more tests that exercise the new
functionality. When adding a test, the best strategy is to find a similar test
in `test/` and follow the same patterns.

Pub tests come in two basic forms. The first, which is usually used to unit test
classes and libraries internal to pub, has many tests in a single file. This is
used when each test will take a short time to run. For example,
`test/version_test.dart` contains unit tests for pub's Version class.

The other form, used by most pub tests, is usually used for integration tests of
user-visible pub commands. Each test has a file to itself, which is named after
the test description. This is used when tests can take a long time to run to
avoid having the tests time out when running on the build bots. For example,
`tests/get/hosted/get_transitive_test.dart` tests the resolution of transitive
hosted dependencies when using `dart pub get`/`flutter pub get`.

## Landing your patch

All patches to official Dart packages, including to pub, need to undergo code
review before they're submitted. The full process for putting up your patch for
review is [documented elsewhere][contributing].

[contributing]: https://github.com/dart-lang/sdk/blob/main/CONTRIBUTING.md

repository: dart-lang/pub

gha_language: Dart

repo_name: dart-lang/pub


text:
Zeroconf
==========

Bonjour/mDNS support for .NET 4.5, Windows Phone 8, Windows Store apps and Portable Class Libraries
-
The core logic is implemented as a PCL, but due to networking APIs being
platform-specific, a platform-specific helper library is required. Just make
sure that you also install the NuGet to your main app and you'll be all set.

Installation
-
The easiest way to get started is to use the NuGet package.

> Install-Package [Zeroconf](http://www.nuget.org/packages/Zeroconf)

Current Build Status:
[![Build status](https://ci.appveyor.com/api/projects/status/52nr1dgg9ftrxeh9/branch/master?svg=true)](https://ci.appveyor.com/project/onovotny/zeroconf/branch/master)

Usage
-
There's are two methods with a few optional parameters:

    using Zeroconf;
    public async Task ProbeForNetworkPrinters()
    {
        IReadOnlyList<IZeroconfHost> results = await
            ZeroconfResolver.ResolveAsync("_printer._tcp.local.");
    }

    public async Task EnumerateAllServicesFromAllHosts()
    {
        ILookup<string, string> domains = await ZeroconfResolver.BrowseDomainsAsync();
        var responses = await ZeroconfResolver.ResolveAsync(domains.Select(g => g.Key));
        foreach (var resp in responses)
            Console.WriteLine(resp);
    }

The `ResolveAsync` method has one required and several optional parameters.
The method signature is as follows:

    Task<IReadOnlyList<IZeroconfHost>> ResolveAsync(string protocol, TimeSpan scanTime = default(TimeSpan), int retries = 2, int retryDelayMilliseconds = 2000, Action<IZeroconfHost> callback = null, CancellationToken cancellationToken = default(CancellationToken));

The `BrowseDomainsAsync` method has the same set of optional parameters.
The method signature is:

    Task<ILookup<string, string>> BrowseDomainsAsync(TimeSpan scanTime = default (TimeSpan), int retryDelayMilliseconds = 2000, Action<string, string> callback = null, CancellationToken cancellationToken = default (CancellationToken))

What you get back from the Browse is a lookup, by service name, of a group that contains every host
offering that service. Thst most common use would be in the example above, passing in
all keys (services) to the Resolve method. Otherwise, you can also see what hosts are
offering which services as well.

### Parameters

		Parameter Name
		Default Value
		Notes

		protocol

		Service to query. Almost always must end with .local.

		scanTime
		2 seconds
		Amount of time to listen for responses

		retries
		2
		Number of times to attempt to bind to the socket. Binding may fail if
		another app is currently using it.

		retryDelayMilliseconds
		2000
		Delay between retries

		callback
		null
		If provided, called per IZeroconfigHost as they are processed. This can be used to stream
			data back prior to call completion.

		cancellationToken
		CancellationToken.None
		Optional use of task cancellation

### Notes

The `ResolveAsync` method is thread-safe, however all calls to it are serialized as only
one can be in-progress at a time.

#### Xamarin.Android 4.x Linker bug
There is currently a [bug](https://bugzilla.xamarin.com/show_bug.cgi?id=21578) on Xamarin.Android 4.x that incorrectly strips out internal Socket methods. This has been [fixed](http://developer.xamarin.com/releases/android/xamarin.android_5/xamarin.android_5.0/) for the Xamarin.Android 5.0 series but that is still in preview and unsupported. As a workaround, entering `System;` in to the `Ignore Assemblies` field in the `Project Options->Build->Android Build` page will fix the problem.

### Credits

This library was made possible through the efforts of the following projects:

* [ZeroconfRT](https://github.com/saldoukhov/ZeroconfRT) by Sergey Aldoukhov
* [DNS.NET Resolver](http://www.codeproject.com/Articles/23673/DNS-NET-Resolver-C) by Alphons van der Heijden

license: MS-PL

repository: Sparksteam/Zeroconf

repo_name: Sparksteam/Zeroconf


text:
# GitHub Action - Labeler
Makes sure the repository has a predefined set of labels

Define your action as this `.github/workflows/labeler.yml`:
```yaml
name: labeler

on:
  workflow_dispatch:
  schedule:
    - cron:  '0 0 * * 1'

jobs:
  labeler:
    runs-on: ubuntu-latest
    steps:
      -
        name: 'Apply labels'
        uses<EMAIL_ADDRESS>        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          labels: |
            [
              { "name": "bugfix", "color": "d73a4a", "description": "For fixing a bug" },
              { "name": "feature", "color": "0E8A16", "description": "A new feature" },
              { "name": "READY FOR REVIEW", "color": "000000", "description": "The PR is ready for Peer Review" },
              { "name": "documentation", "color": "0075ca", "description": "Improve documentation" }
            ]
```

The action will be executed once a week on mondays.


text:
---
title: Jacoco test coverage gradle setup for junit, connected test, etc...
layout: post
date: 2016-02-15
categories: Android, Gradle
---

1. Just need to copy the next file on your `app/` or the module that you want to have the coverage:

{% gist /danielgomezrico/36609a2204cc2f4e1201 %}

1. Apply the plugin:

{% highlight groovy %}

apply from: "jacoco.gradle"

{% endhighlight %}

1. Run the tests you want (check reporting group on gradle tasks for available ones), in my case I have `release` buildType
   and `mocked` so I have:

{% highlight bash %}

$ ./gradlew testMockedReleaseUnitTestCoverage

{% endhighlight %}

1. Then find the results on `build/reports/jacoco/`

# Thanks to

Again thanks to  [Quality matters](https://github.com/artem-zinnatullin/qualitymatters) project for that dedication.

repository: MakinGiants/blog

branch_name: refs/heads/gh-pages

extension: markdown

repo_name: MakinGiants/blog


text:
## Event

The Event class allows custom events to be registered and subsequently triggered, with the ability to pass data into each event.

### on(eventName: string, callback: Function)
Registers a callback function to run whenever an event is dispatched with the name provided.
```javascript
Event.on('myCustomEvent', function(data) {
  console.log(data); // { exampleData: "Example data value" }
});
```

### dispatch(eventName: string, data: any = null)

Dispatches an event with the given event name and data. Any callbacks registered for this event name with be called.

```javascript

var eventData = {
  exampleData: "Example data value"
};

Event.dispatch('myCustomEvent', eventData);
```

repository: ieatstickers/phusion

gha_language: TypeScript

repo_name: ieatstickers/phusion


text:
<!--
---
linkTitle: "ClusterInterceptor"
weight: 9
---
-->
# ClusterInterceptor

A `ClusterInterceptor` is cluster scoped resource that registers a new Interceptor that
can be invoked during the processing of a trigger to modify the behavior or payload of Triggers. The
custom resource describes how an EventListener can connect to a workload that
is running the interceptor business logic (and in the future what extra
paramters the interceptor accepts).

**NOTE**: This doc is a WIP. Please also see the [Interceptors section](./eventlisteners.md#interceptors) in the EventListener doc.

- [Interceptors](#interceptors)
  - [Syntax](#syntax)
    - [clientConfig](#clientConfig)

## Syntax

To define a configuration file for a `ClusterInterceptor` resource, you can specify
the following fields:

- Required:
  - [`apiVersion`][kubernetes-overview] - Specifies the API version, for example
    `triggers.tekton.dev/v1alpha1`.
  - [`kind`][kubernetes-overview] - Specifies the `ClusterInterceptor` resource
    object.
  - [`metadata`][kubernetes-overview] - Specifies data to uniquely identify the
    `ClusterInterceptor` resource object, for example a `name`.
  - [`spec`][kubernetes-overview] - Specifies the configuration information for
    your ClusterInterceptor resource object. The spec include:
    - [`clientConfig`] -  Specifies how a client (e.g. an EventListener) can communicate with the ClusterInterceptor.

### clientConfig

The `clientConfig` field describes how a client can communicate with an
interceptor. It can contain either the `url` field whose value is
a resolvable URL or it can contain a reference to a Kubernetes service where the ClusterInterceptor is running.
EventListeners will send forward requests to this service or URL.

```yaml
spec:
  clientConfig:
    url: "http://interceptor-svc.default.svc/"
---
spec:
  clientConfig:
    service:
      name: "my-interceptor-svc"
      namespace: "default"
      path: "/optional-path" # optional
      port: 8081 # defaults to 80
```

repository: rjackowens/triggers

repo_name: rjackowens/triggers


text:
# puppet-sftp
A Puppet module that configures an sftp server using OpenSSH.  Places accounts in a chroot jail.  Schedules a cron job to clear user content once a week.  User accounts can be created using a hiera hash.  Examples/sftp.pp creates some users and shows you how to use the module.

Clone this repository into your modules directory, then run using 'puppet apply modules/sftp/example/sftp.pp'


text:
This is the Zenika intranet back-end project which will be used by the students of the academy as well as the student body and the administration.

The current project allows you to log in as a student to see his promotion and his program.
It also allows you to log in as administrator to create users, programs and promotions. The administrator can also view and edit them

You can find the documentation of the API here https://app.swaggerhub.com/apis-docs/messaoy/ZenikaAcademy/1.0.0#/

The front-server project is here : https://gitlab.com/zacademy-paris-2019/zintranet_groupe2

We use Node.JS 12.11, Express 4.17, MySQL and Sequelize

The project is linted using Eslint with Airbnb Config : https://github.com/airbnb/javascript/tree/master/packages/eslint-config-airbnb

This project is tested with Jest

To install the project you need to :

### `Install NodeJS V.12 on your computer`

### `Install MYSQL and create a database "zenika_academy"`

After that you will need to

### `download/clone/fork the project`

then you run

### `npm install` to install dependencies

When you are done with downloading internet, make sure you
### `Change your database credentials in config.json`

Once your MySQL is running, run

### `npm run migrate` to create all table using migration

Grab a coffee then run

### `npm run start` to start your server in daemon thanks to (pm2)

Your server is available at
### `http://localhost:4001`

and Voila !

## Available script

In the project directory, you can run:

### `npm run start`

Runs the server in the development mode in daemon.

Open [http://localhost:4001](http://localhost:4001) to view it in the browser.

### `npm run kill`

Kill the process and shut down the server.

### `npm run migrate`

Do all the migration in the 'migrations' file.

### `npm run log`

Show the server log in the interactive watch mode (in the console).

### `npm run test`

Launches the test runner in the interactive watch mode.

### `npm run lint`

This will launch esLint to check all js/jsx file in controller.

repository: Zenika/zintranet-back

repo_name: Zenika/zintranet-back


text:
# node-terminator

Handle NodeJS termination (SIGTERM/SIGINT) gracefully.

[![NPM Version][npm-image]][npm-url]
[![Build Status][travis-image]][travis-url]
[![Coverage Status][coveralls-image]][coveralls-url]

## Installation

```shell
npm install --save @redneckz/node-terminator
```

## How-to

Create *NodeTerminator* instance and attach it to *NodeJS* process (several instances can be created and attached).

```javascript
const { NodeTerminator } = require('@redneckz/node-terminator');

const nodeTerminator = new NodeTerminator();
nodeTerminator.attach(() => {
  // Some additional steps before exit
  process.exit();
});
```

Decorate async jobs to control gracefull shutdown.

```javascript
const {
  graceful, // HOF bound to NodeTerminator instance
} = nodeTerminator;

const someJob = graceful(async () => {
  // Do something asynchronously
  console.log('Working hard...');
});
```

# License

[MIT](http://vjpr.mit-license.org)

[npm-image]: https://badge.fury.io/js/%40redneckz%2Fnode-terminator.svg
[npm-url]: https://www.npmjs.com/package/%40redneckz%2Fnode-terminator
[travis-image]: https://travis-ci.org/redneckz/node-terminator.svg?branch=master
[travis-url]: https://travis-ci.org/redneckz/node-terminator
[coveralls-image]: https://coveralls.io/repos/github/redneckz/node-terminator/badge.svg?branch=master
[coveralls-url]: https://coveralls.io/github/redneckz/node-terminator?branch=master

repository: redneckz/node-terminator

repo_name: redneckz/node-terminator


text:
# BetterDiscord Stuff by Eight_P

#### [BetterDiscord](https://betterdiscord.app/) allows the installation of user-created [Themes](Themes) and Plugins injected into Discord.


text:
# RockLib.Logging.AspNetCore.Analyzers Changelog

All notable changes to this project will be documented in this file.

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

## 1.0.1 - 2021-07-22

#### Fixed

For RockLib0004 - Add InfoLog attribute:

- Improves the search for controllers & action methods, reducing false positives.
- Don't report when InfoLog is added to controller filters.

## 1.0.0 - 2021-07-13

#### Added

- Adds analyzer for RockLib0004: Add InfoLog attribute


text:
# Paper: Data and Code

This folder contains the data and code used to generate each of the figures in the following paper:

> Ryan Shaffer, Hang Ren, Emiliia Dyrenkova, Christopher G. Yale, Daniel S. Lobser, Ashlyn D. Burch, Matthew N. H. Chow, Melissa C. Revelle, Susan M. Clark, Hartmut Häffner. _Sample-efficient verification of continuously-parameterized quantum gates for small quantum processors._ [Quantum 7, 997](https://doi.org/10.22331/q-2023-05-04-997) (2023).

repository: rmshaffer/stoq-compiler

repo_name: rmshaffer/stoq-compiler


text:
## Testing react

1. **Test `Book` component**: Create a new folder `/tests` under the root of the project. This folder will contain all the unit tests related to the components written. The following code shows how test can be written for `Book` component. Create a new file `Book.test.js`, and add the following code.
```javascript
import React from 'react';
import thunk from "redux-thunk";
import '@testing-library/jest-dom/extend-expect'
import { createMemoryHistory } from 'history'
import { Route, Router } from "react-router-dom";
import { createStore, applyMiddleware, compose } from "redux";
import { Provider as ReduxProvider } from "react-redux";
import { cleanup, render, fireEvent } from '@testing-library/react';
import { rootReducer } from '../redux/reducers';
import { Book } from '../components/Books/Book';

afterEach(cleanup);

const renderBook = (component,
  {
    initialState,
    store = createStore(rootReducer, initialState, compose(applyMiddleware(thunk))),
    route = '/',
    history = createMemoryHistory({initialEntries: [route]}),
  } = {}) => {
  return render(
    <ReduxProvider store={store}>
      <Router history={history}>
        {component}
      </Router>
    </ReduxProvider>
  );
}

it('should render Book', () => {
  const { getByText } = renderBook(
    <Route path="/book/:slug">
      {props => <Book {...props} />}
    </Route>,
    {
      initialState: {
        genres: [{id:1, name:'suspense'}],
        books: [{id:1, title:'title', author:'collins', genreId:1, slug:'title'}]
      },
      route: '/book/title',
    },
  );
  getByText("Author: collins")
  getByText("Genre: suspense")
});
```

The testing involves the following steps:

- Create the necessary `state` and `routes` that are required by the component. For the `Book` page, an `initialState` of `books` is required. This can be supplied by the test. `createMemoryHistory` can be used for creating a history object and updating it during the test. A route can be updated by calling `createMemoryHistory` with the `route` path.

- The `renderBook` method is taking a component and the relavant store and route data that is required to render the `Book` page. Note that the component is wrapped within the `<Route>`, `<Router>` and `<ReduxProvider>` in the same order. This is necessary for the test as the component will be actually rendered along with the redux and routes.

- Each test must be written within `it()` block. This is just a convention to be followed when writing tests with `jest`. Any initializations can be done using `beforeEach` and any cleanup can be done using `afterEach`. The above test checks whether the book title and author name was successfully rendered by using `getByText` method given by the `react-testing-library`

2. **Test `Action`**: To provide mock APIs and mock redux store, install two packages. Run `yarn add fetch-mock` and `yarn add redux-mock-store`. `fetch-mock` is dependant on `node-fetch`. So install the `node-fetch` package too.

```javascript
import * as bookActions from "../redux/actions/bookActions";
import * as types from "../redux/actions/actionTypes";
import { books } from "../../../server/mockData";
import thunk from "redux-thunk";
import fetchMock from "fetch-mock";
import configureMockStore from "redux-mock-store";

// Test an async action
const middleware = [thunk];
const mockStore = configureMockStore(middleware);

describe("Async Actions", () => {
  afterEach(() => {
    fetchMock.restore();
  });

describe("Load Books Thunk", () => {
    it("should create BEGIN_API_CALL and LOAD_BOOKS_SUCCESS when loading books", () => {
      fetchMock.mock("*", {
        body: books,
        headers: { "content-type": "application/json" }
      });

      const expectedActions = [
        { type: types.BEGIN_API_CALL },
        { type: types.LOAD_BOOKS_SUCCESS, books },
        { type: types.API_CALL_SUCCESS }
      ];

      const store = mockStore({ books: [] });
      return store.dispatch(bookActions.loadBooks()).then(() => {
        expect(store.getActions()).toEqual(expectedActions);
      });
    });
  });
});
```

Testing an actions involves the following steps:

- `fetchMock` is setup to respond to any API route by returning the `books` array. A mock store is also configured using `const middleware = [thunk]; const mockStore = configureMockStore(middleware);`. The next step is to dispatch an action from the `mockStore` and check whether the right action creators were dispatched.

- `store.dispatch(bookActions.loadBooks())` will make an API call to the mockApi. The mockApi returns back the expected books array. Once the array is recieved, the `loadBooks` function will go on to dispatch `LOAD_BOOKS_SUCCESS` and `API_CALL_SUCCESS`. The redux action dispatch can be verified by creating an array of expected actions and checking whether the store recieved those actions.

3. **Test `Reducer`**:
```javascript
import { bookReducer } from "../redux/reducers/bookReducer";
import * as actions from "../redux/actions/bookActions";

it("should add course when passed CREATE_COURSE_SUCCESS", () => {
  // arrange
  const initialState = [
    {
      title: "A"
    },
    {
      title: "B"
    }
  ];

  const newBook = {
    title: "C"
  };

  const action = actions.createBookSuccess(newBook);

  // act
  const newState = bookReducer(initialState, action);

  // assert
  expect(newState.length).toEqual(3);
  expect(newState[0].title).toEqual("A");
  expect(newState[1].title).toEqual("B");
  expect(newState[2].title).toEqual("C");
});
```

Testing reducer can be done as follows:

- Import the actions that must be called. Dispatch these actions with the updated data that will be sent to the reducer.

- Obtain the newState from the reducer by providing `initialState` and `action` parameters. Reducers are nothing but funcitons that take two params and update the value and return it.

- Tests can be now written to check if the `updatedState` reflects the data sent from the  `action`.

## Further enhancements

Congratulations!!! You have successfully completed the **Advanced React course with Redux**. There are some enhancements that can be done on top of the book management software, that could also provide more knowledge and practice into developing applications with React.

- Create a valid list of authors and provide a dropdown select
- Provide a way for users to login and admin capabilities. Only admin should be able to add or edit the books.
- Provide login for common users. Users with login can favorite or archive books.

If you have any questions regarding the development or got stuck at any point, please connect with me on twitter. My twitter handle: @aparna_joshi_ (https://twitter.com/aparna_joshi_)


text:
# Linting and testing for developers

Paragraph contains scripts to help assessing code quality and
to run our integration tests. All testing and linting can be
carried out inside a [Docker image](Dockerfile). A build of this image is
available at [Docker Hub](
https://cloud.docker.com/swarm/ilmncgrpmi/repository/docker/ilmncgrpmi/paragraph-testing-dev/general) as
`ilmncgrpmi/paragraph-testing-dev:master` and
can be obtained as follows:

```bash
# (run with sudo if necessary)
docker pull ilmncgrpmi/paragraph-testing-dev:master
```

Using this image we automate the following test and
code analysis tasks:

* [Python Linting](#PythonLinting)
* [C++ Static analysis using Cppcheck](#CStaticanalysisusingCppcheck)
* [C++ Builds](#CBuilds)
* [Unit, Blackbox, Python tests](#UnitBlackboxPythontests)
* [Valgrind Dynamic Code Analysis](#ValgrindDynamicCodeAnalysis)
* [Clang Formatting and Static Analysis](#ClangFormattingandStaticAnalysis)

## Python Linting

We use [pylint](https://www.pylint.org/) and [pep8](https://pypi.python.org/pypi/pep8).

Assuming we are in a paragraph checkout directory,
we can run these checks as follows:

```bash
./src/docker-testing/python-linting.sh `pwd`
```
```
master: Pulling from ilmncgrpmi/paragraph-testing-dev
Digest: ...
Status: Image is up to date for ilmncgrpmi/paragraph-testing-dev:master

------------------------------------
Your code has been rated at 10.00/10

...
```

The return code is zero when no errors or warnings were found.

## C++ Static analysis using Cppcheck

We can run static code analysis with [cppcheck](http://cppcheck.sourceforge.net/)
using the [cppcheck.sh](../src/docker-testing/cppcheck.sh) script.

**Warning**: this command will overwrite / erase the file `cppcheck.xml` and the
directory `cppcheck-result` in the current working directory.

```bash
src/docker-testing/cppcheck.sh `pwd`
master: Pulling from ilmncgrpmi/paragraph-testing-dev
Digest: ...
Status: Image is up to date for ilmncgrpmi/paragraph-testing-dev:master
Checking /opt/paragraph-source/src/c++/lib/common/Alignment.cpp ...
Checking /opt/paragraph-source/src/c++/lib/common/Alignment.cpp: CYGWIN...
Checking /opt/paragraph-source/src/c++/lib/common/Alignment.cpp: CYGWIN;_DEBUG...
Checking /opt/paragraph-source/src/c++/lib/common/Alignment.cpp: HTS_ENDIAN_NEUTRAL...
Checking /opt/paragraph-source/src/c++/lib/common/Alignment.cpp: _DEBUG...
Checking /opt/paragraph-source/src/c++/lib/common/Alignment.cpp: _DEBUG;__GNUC__...
Checking /opt/paragraph-source/src/c++/lib/common/Alignment.cpp: _MIPSEB;__AAARCHEB__;__ARMEB__;__BIG_ENDIAN__;__BYTE_ORDER__;__MIPSEB;__MIPSEB__;__THU
MBEB__...
Checking /opt/paragraph-source/src/c++/lib/common/Alignment.cpp: _MIPSEL;__AARCH64EL__;__ARMEL__;__BYTE_ORDER__;__LITTLE_ENDIAN__;__MIPSEL;__MIPSEL__;_
_THUMBEL__...
Checking /opt/paragraph-source/src/c++/lib/common/Alignment.cpp: __GNUC__...
...
```

The results can be viewed by opening index.html in the cppcheck-result directory. If no
issues were found, no such file will be created.

## C++ Builds

We can create a build of paragraph which can be run inside our Docker image
(or compatible systems running Ubuntu) using the [make_gcc_build.sh](../src/docker-testing/make_gcc_build.sh) and [make_clang_build.sh](../src/docker-testing/make_clang_build.sh) scripts. These scripts produce
build folders and release tarballs which enable further code analysis
and integration testing.

The two scripts can be used in the same way, here is an example using gcc:

```bash
src/docker-testing/make_gcc_build.sh `pwd` test
```
This should produce two files: `test-gcc-buildfolder.tar.gz` and `test-gcc-release.tar.gz`.

Note that our builds are run with `-Werror`, so code changes that introduce
warnings will make the build fail.

## Unit, Blackbox, Python tests

When we have a paragraph build, we can run tests. We have
the following sets of tests available:

* C++ Unit tests (test_grm executable) - these test the basic functionality
  of our C++ APIs. All test data is included in with the Paragraph installation,
  and no large / external reference files are required.
* C++ Blackbox tests (test_blackbox executable) - these are C++-level integration
  tests. Some test data is included in with the Paragraph installation,
  but some reference FASTA files are required which are discovered using
  the `HG19` and `HG38` environment variables inside the Docker container.
* Python integration tests -- these are workflow-level integration tests.
  Some reference FASTA files are required which are discovered using
  the `HG19` and `HG38` environment variables inside the Docker container.

All tests are run using the [testing.sh](../src/docker-testing/testing.sh) script.

```bash
src/docker-testing/testing.sh `pwd` test-gcc-release.tar.gz
```
```
master: Pulling from ilmncgrpmi/paragraph-testing-dev
Digest: sha256:8853fdcb6b6d4dc5bd215bc60df1a2c9b528a1ebf5ab496c58e4a2334d6d8b97
Status: Image is up to date for ilmncgrpmi/paragraph-testing-dev:master
[==========] Running 121 tests from 35 test cases.
[----------] Global test environment set-up.
[----------] 1 test from Alignment
[ RUN      ] Alignment.KlibBasic
Testing klib alignment.
...
```

Any test that fails will cause a non-zero return code.

## Valgrind Dynamic Code Analysis

We run a subset of our unit and black box tests through valgrind. We exclude some
of the more time-consuming tests for older code which has not been updated for a
while.

All tests are run using the [valgrind-testing.sh](../src/docker-testing/valgrind-testing.sh)
script, which has a non-zero return code when one of the tests fails. To work out which
errors occurred, you may inspect the files `valgrind*.xml` which will be written into the
current working directory (**Warning** these files will be overwritten if they already exist).

```bash
src/docker-testing/valgrind-testing.sh `pwd` test-gcc-release.tar.gz
```
```
master: Pulling from ilmncgrpmi/paragraph-testing-dev
Digest: sha256:8853fdcb6b6d4dc5bd215bc60df1a2c9b528a1ebf5ab496c58e4a2334d6d8b97
Status: Image is up to date for ilmncgrpmi/paragraph-testing-dev:master
...
```

## Clang Formatting and Static Analysis

We can use clang-format to achieve consistent formatting of our code,
and clang-tidy for warnings.

To check for formatting issues, you may run the [clang-formatting.sh](../src/docker-testing/clang-formatting.sh) shell script:

```bash
src/docker-testing/clang-formatting.sh `pwd`
clang-master: Pulling from ilmncgrpmi/paragraph-testing-dev
Digest: sha256:3d9416a7d8f535effda0dfa3a4887039e2b7a9cbef0df11c31aec1aa594b853b
Status: Image is up to date for ilmncgrpmi/paragraph-testing-dev:clang-master
No formatting issues found.
```

Passing all clang-tidy warnings is not yet a requirement for our code, but
will be in the near future. In order to use clang-tidy we require a clang
build folder that matches the current source tree.

```bash
src/docker-testing/make_clang_build.sh `pwd` build
src/docker-testing/clang-linting.sh `pwd` build-clang-buildfolder.tar.gz
```
```
clang-master: Pulling from ilmncgrpmi/paragraph-testing-dev
Digest: sha256:3d9416a7d8f535effda0dfa3a4887039e2b7a9cbef0df11c31aec1aa594b853b
Status: Image is up to date for ilmncgrpmi/paragraph-testing-dev:clang-master
...
```

repository: Yanglv-rookie/paragraph

repo_name: Yanglv-rookie/paragraph


text:
Thanks for taking the time to contribute! :smiley:

## Styleguides

### Git Commit Messages

- Use the present tense ("Fix bug" not "Fixed bug")
- Use the imperative mood ("Move component to..." not "Moves component to...")
- Limit the first line to 72 characters or less
- Reference issues and pull requests liberally
- When only changing documentation, include [ci skip] in the commit description

### JavaScript
All JavaScript should adhere to [AirBnb JavaScript Style](https://github.com/airbnb/javascript).

repository: nus-mtp/sashimi-note

repo_name: nus-mtp/sashimi-note


text:
[//]: # (title: Messaging Infrastructure)

<!-- Copyright 2000-2020 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->

## Purpose

The purpose of this document is to introduce the messaging infrastructure available in the IntelliJ Platform to developers and plugin writers.
It is intended to answer why, when and how to use it.

## Rationale

So, what is messaging in the IntelliJ Platform and why do we need it? Basically, its implementation of [Publisher Subscriber Pattern](https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern) that provides additional features like _broadcasting on hierarchy_ and special _nested events_ processing (_nested event_ here is a situation when new event is fired (directly or indirectly) from the callback of another event).

## Design

Here are the main components of the messaging API.

### Topic

This class serves as an endpoint at the messaging infrastructure.
I.e., clients are allowed to subscribe to a specific topic within a bus and send messages to that topic within that particular bus.

![Topic](topic.svg)

* *display name* just a human-readable name used for logging/monitoring purposes;
* *broadcast direction* will be explained in details at Broadcasting. Default value is *TO\_CHILDREN*;
* *listener class* that is a business interface for particular topic.
  Subscribers register an implementation of this interface at the messaging infrastructure.
  Publishers later retrieve objects that conform to the interface (IS-A) and call any methods defined on those implementations.
  The messaging infrastructure takes care of dispatching the message to all subscribers of the topic by calling the same method with the same arguments on the registered implementation callbacks;

### Message Bus

Is the core of the messaging system.
Is used at the following scenarios:

![Bus](bus.png)

### Connection

Manages all subscriptions for particular client within particular bus.

![Connection](connection.svg)

* keeps number of *topic handler* mappings (callbacks to invoke when message for the target topic is received)
  *Note*: not more than one handler per-topic within the same connection is allowed;
* it's possible to specify *default handler* and subscribe to the target topic without explicitly provided callback.
  Connection will use that *default handler* when storing *(topic-handler)* mapping;
* it's possible to explicitly release acquired resources (*disconnect()* method).
  Also it can be plugged to standard semi-automatic disposing ([`Disposable`](upsource:///platform/util/src/com/intellij/openapi/Disposable.java));

### Putting Altogether

*Defining business interface and topic*

```java
public interface ChangeActionNotifier {

    Topic<ChangeActionNotifier> CHANGE_ACTION_TOPIC = Topic.create("custom name", ChangeActionNotifier.class)

    void beforeAction(Context context);
    void afterAction(Context context);
}
```

*Subscribing*

![Subscribing](subscribe.svg)

 >  If targeting 2019.3 or later, use [declarative registration](plugin_listeners.md) if possible.
 >
 {type="note"}

```java
public void init(MessageBus bus) {
    bus.connect().subscribe(ActionTopics.CHANGE_ACTION_TOPIC, new ChangeActionNotifier() {
        @Override
        public void beforeAction(Context context) {
            // Process 'before action' event.
        }
        @Override
        public void afterAction(Context context) {
            // Process 'after action' event.
        }
    });
}
```

*Publishing*

![Publishing](publish.svg)

```java
public void doChange(Context context) {
    ChangeActionNotifier publisher = myBus.syncPublisher(ActionTopics.CHANGE_ACTION_TOPIC);
    publisher.beforeAction(context);
    try {
        // Do action
        // ...
    } finally {
        publisher.afterAction(context)
    }
}
```

*Existing resources*

* *MessageBus* instances are available via [`ComponentManager.getMessageBus()`](upsource:///platform/extensions/src/com/intellij/openapi/components/ComponentManager.java)
  Many standard interfaces implement a message bus, e.g., [`Application`](upsource:///platform/core-api/src/com/intellij/openapi/application/Application.java) and [`Project`](upsource:///platform/core-api/src/com/intellij/openapi/project/Project.java).
* A number of public topics are used by the IntelliJ Platform, e.g., [`AppTopics`](upsource:///platform/platform-api/src/com/intellij/AppTopics.java), [`ProjectTopics`](upsource:///platform/projectModel-api/src/com/intellij/ProjectTopics.java), etc.
  So, it's possible to subscribe to them in order to receive information about the processing;

## Broadcasting

Message buses can be organised into hierarchies.
Moreover, the IntelliJ Platform has them already:

![Standard hierarchy](standard_hierarchy.svg)

That allows to notify subscribers registered in one message bus on messages sent to another message bus.

*Example:*

![Parent-child broadcast](parent_child_broadcast.svg)

Here we have a simple hierarchy (*application bus* is a parent of *project bus*) with three subscribers for the same topic.

We get the following if *topic1* defines broadcast direction as *TO\_CHILDREN*:
1. A message is sent to *topic1* via *application bus*;
2. *handler1* is notified about the message;
3. The message is delivered to the subscribers of the same topic within *project bus* (*handler2* and *handler3*);

*Benefits*

We don't need to bother with memory management of subscribers that are bound to child buses but interested in parent bus-level events.

Consider the example above we may want to have project-specific functionality that reacts to the application-level events.
All we need to do is to subscribe to the target topic within the *project bus*.
No hard reference to the project-level subscriber will be stored at application-level then, i.e., we just avoided memory leak on project re-opening.

*Options*

Broadcast configuration is defined per-topic.
The following options are available:

* TO\_CHILDREN_ (default);
* _NONE_;
* _TO\_PARENT_;

## Nested Messages

_Nested message_ is a message sent (directly or indirectly) during another message processing.
The IntelliJ Platform's Messaging infrastructure guarantees that all messages sent to particular topic will be delivered at the sending order.

*Example:*

Suppose we have the following configuration:

![Nested messages](nested_config.svg)

Let's see what happens if someone sends a message to the target topic:

* _message1_ is sent;
* _handler1_ receives _message1_ and sends _message2_ to the same topic;
* _handler2_ receives _message1_;
* _handler2_ receives _message2_;
* _handler1_ receives _message2_;

## Tips'n'tricks

### Relief Listeners Management

Messaging infrastructure is very light-weight, so, it's possible to reuse it at local sub-systems in order to relieve [Subscribers](https://en.wikipedia.org/wiki/Publish%E2%80%93subscribe_pattern) construction.
Let's see what is necessary to do then:

1. Define business interface to work with;
2. Create shared message bus and topic that uses the interface above (_shared_ here means that either _subject_ or _subscribers_ know about them);

Let's compare that with a manual implementation:

1. Define listener interface (business interface);
2. Provide reference to the _subject_ to all interested listeners;
3. Add listeners storage and listeners management methods (add/remove) to the _subject_;
4. Manually iterate all listeners and call target callback in all places where new event is fired;

### Avoid Shared Data Modification from Subscribers

We had a problem in a situation when two subscribers tried to modify the same document
([IDEA-71701](https://youtrack.jetbrains.com/issue/IDEA-71701)).

The thing is that every document change is performed by the following scenario:

1. _before change_ event is sent to all document listeners and some of them publish new messages during that;
2. actual change is performed;
3. _after change_ event is sent to all document listeners;

We had the following then:

1. _message1_ is sent to the topic with two subscribers;
2. _message1_ is queued for both subscribers;
3. _message1_ delivery starts;
4. _subscriber1_ receives _message1_;
5. _subscriber1_ issues document modification request at particular range (e.g. _document.delete(startOffset, endOffset)_);
6. _before change_ notification is sent to the document listeners;
7. _message2_ is sent by one of the standard document listeners to another topic within the same message bus during _before change_ processing;
8. the bus tries to deliver all pending messages before queuing _message2_;
9. _subscriber2_ receives _message1_ and also modifies a document;
10. the call stack is unwinded and _actual change_ phase of document modification operation requested by _subscriber1_ begins;

**The problem**  is that document range used by _subscriber1_ for initial modification request is invalid if _subscriber2_ has changed document's range before it.

repository: renuacpro/intellij-sdk-docs

repo_name: renuacpro/intellij-sdk-docs


text:
# Badges, Badges, Badges, Badges ...
[![Built with Grunt](https://cdn.gruntjs.com/builtwith.png)](http://gruntjs.com/)
[![Build Status](https://travis-ci.org/OmerHerera/badges.svg?branch=master)](https://travis-ci.org/OmerHerera/badges)
[![Code Climate](https://codeclimate.com/github/OmerHerera/badges/badges/gpa.svg)](https://codeclimate.com/github/OmerHerera/badges)
[![Coverage Status](https://coveralls.io/repos/OmerHerera/badges/badge.svg?branch=master)](https://coveralls.io/r/OmerHerera/badges?branch=master)
[![Dependency Status](https://david-dm.org/OmerHerera/badges.svg?theme=shields.io)](https://david-dm.org/OmerHerera/badges)
[![devDependency Status](https://david-dm.org/OmerHerera/badges/dev-status.svg?theme=shields.io)](https://david-dm.org/OmerHerera/badges#info=devDependencies)
[![npm version](https://badge.fury.io/js/badgess.svg)](http://badge.fury.io/js/badgess)
[![npm downloads](https://img.shields.io/npm/dm/badgess.svg)](https://img.shields.io/npm/dm/badgess.svg)
[![NPM](https://nodei.co/npm/badgess.png)](https://nodei.co/npm/badgess/)

Tutorial when creating a new repo and want to use badges ;-)

* * *

#Build Process
![Meet Travis CI](/images/travis-mascot-200px.png)

I choosed Travis CI, its free for open/public repos.
What is Travis:
In software development, Travis CI is an open-source hosted, distributed continuous integration service used to build and test projects hosted at GitHub. Travis CI is configured by adding a file named .travis.yml, which is a YAML format text file, to the root directory of the GitHub repository.

More in [Travis CI](https://travis-ci.org)

##Adding the npm task for travis-ci
Travis CI runs ```npm test``` after it fetched your project and installed the dependencies, so we need to add this task to the package.json file.

```
"scripts": {
  "test": "grunt default --verbose"
}
```

*I’ve added the --verbose option, so we’ll see more output of what is going on.*

##Adding the .travis.yml
Every Travis CI project needs to have a .travis.yml file in the root of the project folder, so it know what platform and version it should use to build/test your project. Here’s the one I used:

```
language: node_js
node_js:
   - "0.10"
```

After these changes your project is ready to be continuously builded with Travis CI.

*But don’t forget to setup the Service Hook on Github!*

Now You can use the build status badge:
Read more in [here](http://docs.travis-ci.com/user/status-images/)

* * *

#Code Analysis
![Code Climate](/images/code-climate-stickers.png)

I'm using [Code Climate](https://codeclimate.com/)

What is Code Climate:
Code Climate hosted software metrics help you ship quality Ruby, PHP and JavaScript code faster. Get control of your technical debt with real time static ...

They use GPA fro their metrics:
Learn more about their [GPA (grade point average)](http://docs.codeclimate.com/article/150-glossary-gpa)

* * *

#Coverage
![Coveralls](/images/coveralls_logo.png)

I'm using [coveralls](https://coveralls.io/), coveralls can work soomtly with Travis-ci, in order to submit yor coverage to coveralls, I'm integrating in my GruntFile the following:
1. [mocha-lcov-reporter](https://github.com/StevenLooman/mocha-lcov-reporter) - This will report from mocha to the target file
2. [grunt-coveralls](https://github.com/pimterry/grunt-coveralls) - This will submit the coverage result to coveralls

* * *

#Badges Dependencies
![David](/images/logo-david.png)

I recommend [david-dm.org](https://david-dm.org).

David is free for public projects on Github.

David gets you an overview of your project dependencies, the version you use and the latest available, so you can quickly see what's drifting. Then it's all boiled down into a badge showing the current status, which you can embed on your site

Declare your dependencies in a package.json file and you're good.

* * *

# Version badge

[Versions](https://badge.fury.io/)

[npm downloads](https://img.shields.io)

[NPM](https://nodei.co/)

repository: OmerHerera/badges

repo_name: OmerHerera/badges