text:
# Quora-Clone
A quora type application where you can ask questions and add answers, upvote and downvote them.

# Setup
```
pip install -r requirements.txt
```

# Database
```
python manage.py makemigrations
python manage.py migrate
```
If want to run admin
```
python manage.py createsuperuser
```

## Run django
```
python manage.py runserver
```

# Adding initial data
After setting up database, you might wanna add some initial data like creating users, asking questions, adding answers, etc..

# How to Use
Goto <IP_ADDRESS>:8000. Now login or signup.
If you are already logged in, it will ask you to view feed.
Feed is designed in such a way that you only see answers from the people who you are following.
So first time login will ask you to follow people.
You can visit their profiles , view whom they are following and who are following them.
In feed you can check full question, where you can see all answers to that particular question and their upvoters and downvoters.
You can also see all users present in quora-clone

# Future Scope
I will be adding forms to ask questions and add answers.
And also the functionality to add comments.
And finally improving the UI.

gha_language: HTML


text:
# mymoney
My Money Sample SPA Application using AngularJS, OrigoDB, EF and many key software development concepts

Hello everyone!
It's Andre speaking.
This sample project is all about learning...
It was created during one of my classes, by me and my students.
I tried to use several eky software concepts on it. Many of them I was able to do the right way... Many of them I did it wrong or
are incomplete.
All kind of contribution is welcome.
Use this sample to learn, teach, change, criticize, whatever you want.
Just keep in mind that it was an experiment created during a course...
Of course it would be great if you contribute with ideas and more code.
There is a lot to do. So many concepts to apply, to improve.
Maybe you can find the ones I could do better, the ones I did wrong.
I think the following are the most important things to do:

- Improve/Change the specflow scenarios by implementing the tests the wring way, mocking the objetcs that are not under test.
The way it is implemented is wrong and the tests will fail due to wrong reasons. Let's MOCK IT!
If you are an student, it may be a very interesting challenge for you.
- Create more tests, more scenarios, more features.
- Implement security with OAuth Authentication and Authorization.
- Evolve the Domain... The current domain is too simple. What if we evolve it to a complex one?
- Improve the layout and styles. Apply themes, etc.
- Improve/create more features for the administration area

These are the ones I figured out by now. Please contribute with more ideas...

Best regards,
André Pires

license: MIT

repository: gabrielcs/mymoney

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: gabrielcs/mymoney


text:
# Intro
React-form-composer is a lightweight, simple, and efficient solution for creating forms in react. As you would expect it makes it easy to get and set field values, to validate and format fields, to create custom inputs and to access an error count.

It works well for web, react-native and server-rendered applications.

Redux-form-composer has been written with hooks. Check out the [Github repo](https://github.com/chrisfield/react-form-composer).
[![NPM Version](https://img.shields.io/npm/v/react-form-composer.svg?style=flat)](https://www.npmjs.com/package/react-form-composer)
![npm bundle size](https://img.shields.io/bundlephobia/minzip/react-form-composer.svg)

# A Simple Form
##### Install with npm or yarn
`npm install --save react-form-composer` or `yarn add react-form-composer`

## Try out this simple form
The following components make it easy to get started:
* Text
* TextArea
* RadioGroup
* Radio
* Checkbox
* Select
* ValidationMessage

<!-- STORY -->

---
#### Code
```jsx
import React from 'react';
import {
  FormStateProvider,
  Form,
  FormSpy,
  useForm,
  useFormReducer,
  Text,
  TextArea,
  RadioGroup,
  Radio,
  Checkbox,
  Select,
  ValidationMessage
} from '../../packages/react-form-composer/src';

const TheFormState = () => {
  const [state] = useFormReducer(useForm().name);
  return (
    <pre>
      <code>{JSON.stringify(state.fieldValues, null, 2)}</code>
    </pre>
  );
};

const isValidSelector = state => state.formStatus.isValid;
const Button = (props) => (
  <FormSpy selector={isValidSelector}>
    {(isValid) => (
        <button {...props} style={{backgroundColor: isValid? 'green': 'cyan'}} >Submit</button>
    )}
  </FormSpy>
);

const lengthAtLeast5 = value => {
  return !value || value.length < 5 ? 'Field must be at least five characters' : undefined;
}

const flexColumn = {
  display: 'flex',
  flexDirection: 'column',
  marginTop: '10px',
  maxWidth: '200px'
}

const MyForm = () => {
  return (
    <FormStateProvider>
      <Form name="myForm" onSubmit={submitValues} onSubmitSuccess={clearValues}>
        <div style={{ display: 'flex', flexWrap: 'wrap', justifyContent: 'space-evenly'}}>
          <div style={flexColumn}>
            <label style={flexColumn}>
              Field One (5+ chars):
              <Text name="fieldOne" required validate={lengthAtLeast5}/>
            </label>
            <ValidationMessage name="fieldOne" render={error => <p>{error}</p>}/>
            <label style={flexColumn}>Text Area: <TextArea name="fieldTwo"/></label>
            <label style={flexColumn}>Age: <Text name="age" type="number"/></label>
            <RadioGroup name="pet">
              <div><label>Dog: <Radio value="dog" selected/></label></div>
              <div><label>Cat: <Radio value="cat"/></label></div>
            </RadioGroup>
            <label>Authorize? <Checkbox name="authorize"/></label>
            <label style={flexColumn}>
              Frequency
              <Select name="frequency" required>
                <option value="" disabled>
                  Select One...
                </option>
                <option value="daily">Daily</option>
                <option value="weekly">Weekly</option>
                <option value="monthly">Monthly</option>
              </Select>
            </label>
            <label style={flexColumn}>
              Exercise
              <Select name="exercice" multiple>
                <option value="Walk">walk</option>
                <option value="Run">run</option>
                <option value="Cycle">cycle</option>
                <option value="Swim">swim</option>
              </Select>
            </label>
            <br/>
            <Button/>
          </div>
          <div style={{
            display: 'flex',
            maxWidth: '300px'
          }}>
            <TheFormState/>
          </div>
        </div>
      </Form>
    </FormStateProvider>
  );
};

function submitValues(values) {
  window.alert(`You submitted:${JSON.stringify(values, null, 2)}`)
}

function clearValues(form) {
  form.updateFields({});
}

export default MyForm;
```
---

#### Explanation
The `Form` components default behaviour is to render it's children in a form. The `onSubmit` and `onSubmitSuccess` props do what their names suggest.

The example shows how easy it is to use the built-in components to create controlled html form inputs.

It also shows two alternative ways to 'manually' access parts of the form-state:
* `TheFormState` custom component has been written with `useForm`
* `Button` has been written with `FormSpy`.

`FormSpy` is an optimized component that takes a selector prop - in this case a function that returns the isValid status of the form which is then used to toggle the green background-color.

#### Next Steps
The next section shows how to write your own ui-components.

repository: chrisfield/react-form-composer

gha_language: JavaScript

gha_license_id: MIT

repo_name: chrisfield/react-form-composer


text:
---
layout: post
title:      "Zillow Real Estate Price - time series modelling"
date:       2019-10-14 11:40:28 -0400
permalink:  zillow_real_estate_price_-_time_series_modelling
---

Hi!
This post was written as part of a project to time series modelling on Zillow real estate prices dataset.

The initial task set for us was to get an answer to the question, which 5 regions among those represented may be the best for investment. And before we move on to the main part of the blog, let me briefly describe the structure of the data. The data for work was a collection of more than 14,700 time-series corresponding to the regions and built on a single time scale. The time scale covered 265 months, or 22 years and 1 month. It is easy to calculate that the total amount of numerical data is about 3.9 million digits.

To assess the investment efficiency, I chose the IRR parameter, the variation of which also calculated the risk measure. By the way, the IRR estimation is available as a built-in function in Numpy : `np.irr(array)`. All IRR estimates were based on forecast data, i.e., after the selected and adjusted predictive models, and I have already ranked the regions to answer the question about the top 5 regions.

In this post, I would like to show you the part of my work in which I had to find ways to optimize the volume of calculations to achieve a balance of calculation time and relative accuracy and quality of forecasts.

The easiest but inefficient way to do it in terms of calculations is to build 14,700 completely autonomous and unrelated models. Each model has its SARIMA parameters, which, depending on the range of parameters to be searched, can also be a capacious task. By the way, running one such model with the range `p = d = q = range(0.6)`, `s=12` could take several hours. Thus, I have been asked 2 conceptual questions:
*   Timeline: per month (as in original dataset) or per annum (resized);
*   Unified SARIMA parameters or individual for each region.

Next, I will show you the results of the analysis on the first question: Month vs Year.

Figure 1 below shows the regionally averaged price based on monthly data. The chart looks quite smooth without visible seasonality and fluctuations inside the year. However, this may be a consequence of the average price by region, so such conclusions are conditional. On the other hand, it is unproductive to study and draw separate conclusions on each of the 14,700 regions.

fig.1

![Imgur](https://i.imgur.com/mQOUkk8.png?3)

Next, I created rolling-prices with 12-month window and compared it with original monthly prices (in Figure 2).

fig.2

![Imgur](https://i.imgur.com/0xm4do5.png?1)

As you can see, based on the visual representation, the graphs are similar to each other in form, and the standard deviation is close to 0 and has no serious fluctuations. This allowed me to choose an annual basis for further modelling, which reduced the amount of data by a factor of 12.

I conducted the simulation itself according to the following scheme:
1. In the first step, I selected the optimal SARIMA parameters based on the regionally averaged time series (on an annual basis). In particular, I had parameters (0, 1, 1, 1) (0, 1, 1, 1)
2. In the second step of the loop by region, I am taking into account the parameters set to create and fit a separate model for each region.
3. In the third step, I left in the sample only the models of the regions with the AIC estimation lower than AIC according to the averaged price model and calculated IRR indicators for them.
4. The final step was the ranking procedure.

After receiving the results of modelling and ranking, I decided to ask myself the question that maybe annual resizing was quite an extreme step and decided to test it additionally. In Fig.3 and Fig.4 you can see the histograms of residuals for annual and monthly models respectively. As you can see, the distribution of residuals of the annual model is closer to N(0.1) than that of the monthly model. Perhaps the reason for this is not the best selection of parameters for the monthly model (I used the found optimums (1,2,2,2)(2,2,2,12)).

fig.3

![Imgur](https://i.imgur.com/3rVZEDg.png?1)

fig.4

![Imgur](https://i.imgur.com/nCTOa0z.png?1)

However, let's take a look at and compare the 3-year forecast charts for the first model (Fig. 5) and the 36-month forecast for the second model (Fig. 6)

fig.5

![Imgur](https://i.imgur.com/wrnXBGL.png?1)

fig.6

![Imgur](https://i.imgur.com/F8EGTOP.png?1)

As a result, the use of monthly forecasts seems to be more accurate, which is noticeable in the dynamics of the confidence intervals change.
Thus, the use of resizing makes sense only when the calculation task (in case of a project - ranking) is not so fundamental to the forecast period. In other words, if the primary task was not so much to rank, as to obtain a forecast model directly for its further use in industrial purposes, I would have left the monthly calculation despite the increase in the volume of calculations.

extension: markdown


text:
.

 -- {1tg26 1}

  OPENING PRAYER THOUGHT
----------------------

 I shall read from “The Mount of Blessing,” beginning on page 183, the last paragraph.

M.B., pg. 183 – “If Christ is in you ‘the hope of glory,’ you will have no disposition to watch others, to expose their errors. Instead of seeking to accuse and condemn, it will be your object to help, to bless, and to save. In dealing with those who are in error, you will heed the injunction, Consider ‘thyself, lest thou also be tempted.’ You will call to mind the many times you have erred, and how hard it was to find the right way when you had once left it. You will not push your brother into greater darkness, but with a heart full of pity will tell him of his danger.

 “He who looks often upon the cross of Calvary, remembering that his sins placed the Saviour there, will never try to estimate the degree of his guilt in comparison with that of others. He will not climb upon the judgment seat to bring accusation against another. There can be no spirit of criticism or self-exaltation on the part of those who walk in the shadow of Calvary’s cross.”

 From this we see that our need is to pray for Christ to abide in us, so that instead of watching for opportunities to accuse or to condemn others, and to expose their errors, we shall seek every occasion to help them, to bless them, to save them. We should pray for a deep realization of our own sins; pray that the spirit of criticism and self-exaltation be forever banished from us. Then we shall not feel free to mount the judgment seat and accuse anyone.

 -- {1tg26 14}

  A WORLD WIDE STIR, AND ITS RESULTS
----------------------------------

### TEXT OF ADDRESS BY V.T. HOUTEFF,

### MINISTER OF DAVIDIAN 7TH-DAY ADVENTISTS

### SABBATH, FEBRUARY 1, 1947

### MT. CARMEL CHAPEL

### WACO, TEXAS

 This afternoon we shall continue our study of the book of Micah. Let us turn to the fifth chapter, and begin with the first verse.

**Micah 5:1 – “Now gather thyself in troops, O daughter of troops: He hath laid siege against us: they shall smite the Judge of Israel with a rod upon the cheek.”**

 You will notice that besides introducing a number of pronouns – he, us, they, this verse also introduces several different topics: first a “daughter of troops,” then “the judge of Israel” and a “rod.” Other subjects are introduced further along in the chapter.

 Now to gain the vision and the lesson that Inspiration is anxious that we should from this scripture, it is necessary that we study one subject at a time. And in order to do this, we must group the verses according to subjects.   And I will execute vengeance in anger and fury upon the heathen, such as they have not heard.”

 These verses present a group of people – good and bad commingled – whom God is to cleanse. Then the scripture closes with God’s promise to execute vengeance upon the heathen. The mixed group of people, “wheat” and “tares,” very obviously constitute the church that is approaching “the time of the harvest” (Matt. 13:30), the time in which all idolators are to perish. “So shall it be at the end of the world: the angels shall come forth, and sever the wicked from among the just…. Then shall the righteous shine forth as the sun in the Kingdom of their Father. Who hath ears to hear, let him hear.” Matt. 13:49, 43.

 We now come to the last part of Micah 5:1. The antecedent of the pronoun “He” is found in the preceding verse – chapter 4, verse 13. There quickly we see that it is the Lord Himself. Plainly, then, by the pronoun “us” Micah means himself and his people – Judah and Israel, the church.

 Clear it is that while the Lord with His message of warning and reproofs makes a siege against His people the adversaries gather together in groups to oppose. Such has been the case at the introduction of each newly-revealed Truth.

 The church is logically called “daughter of troops,” because her mother the Jewish church at the time of

 -- {1tg26 16}

  the introduction of the gospel of Christ, gathered together in troops, to oppose the Lord.

 Moreover being smitten in the face rather than in the back, the Judge of Israel (Christ) must have been squarely facing them – speaking to them, – the reason for which the Jews’ crucified Him. The verses that follow verse one again confirm the fact that “the Judge” is Christ. They that smite Him are, of course, His adversaries, His enemies. Concerning them Inspiration says:

**Verse 9 – “Thine hand shall be lifted up upon Thine adversaries, and all Thine enemies shall be cut off.”**

 According to Christ’s parables, the time His “adversaries,” His enemies of progressive Truth, are cut off is at the commencement of the purification of the church, at the harvest time. Then, according to Ezekiel’s prophecy, the Lord commissions the men with slaughtering weapons in their hands, saying, “Go ye after him through the city, and smite: let not your eye spare, neither have ye pity: slay utterly old and young, both maids, and little children, and women: but come not near any man upon whom is the mark; and begin at My sanctuary. Then they began at the ancient men which were before the house.” Ezek. 9:5, 6. The Spirit of Prophecy confirms this by saying:

 “Here we see that the church – the Lord’s sanctuary – was the first to feel the stroke of the wrath of God. The ancient men, those to whom God had given great light, and who had stood as guardians of the spiritual interests of the people, had betrayed their trust. They had taken the position that we need not look for miracles and the marked manifestation of God’s power as in former days. Times have changed. These words strengthen their unbelief, and they say, The

 -- {1tg26 17}

  Lord will not do good neither will he do evil. He is too merciful to visit his people in judgment. Thus peace and safety is the cry from men who will never again lift up their voice like a trumpet to show God’s people their transgressions and the house of Jacob their sins.  Men, maidens, and little children, all perish together.” – “Testimonies,” Vol. 5, pg. 211. And through the apostle Peter, Inspiration declares:

 “For the time is come that judgment must begin at the house of God: and if it first begin at us, what shall the end be of them that obey not the gospel of God?” 1 Pet. 4:17.

**Verse 2 – “But thou, Bethlehem Ephratah, though thou be little among the thousands of Judah, yet out of thee shall He come forth unto Me that is to be ruler in Israel; Whose goings forth have been from of old, from everlasting.”**

 There is no doubt that this verse predicts the birth of Christ, “the Judge of Israel,” “Whose goings forth” have been from everlasting.

**Verse 3 – “Therefore will He give them up, until the time that she which travaileth hath brought forth: then the remnant of His brethren shall return unto the children of Israel.”**

 Crucifying Christ and their refusing to return to the Lord, there was nothing that could have been done for the Jews at that time but to give them up “until the time that she which travaileth hath brought forth.”

 The pronoun “she” points to the daughter of Zion

 -- {1tg26 18}

  **(Mic. 4:10). She is to bring forth her children while in the field; while in the Gentile lands. Then the time of her sojourning is to end and she is to be delivered. “In that day, saith the Lord, will I assemble her that halteth,…and I will make her that halted a remnant…and the Lord shall reign over them in Mount Zion from henceforth, even for ever.” Mic. 4:6, 7.**

**Verses 4, 5 – “And he shall stand and feed in the strength of the Lord, in the majesty of the name of the Lord his God; and they shall abide: for now shall He be great unto the ends of the earth. And this man shall be the peace, when the Assyrian shall come into our land: and when he shall tread in our palaces, then shall we raise against him seven shepherds, and eight principal men.”**

 When the children of the daughter of Zion return to Mount Zion, they are to abide forever. Never again are they to be cast out among the Gentile nations.  The Lord is thus to make Himself “great unto the ends of the earth.” When she that travaileth shall have brought forth, then the saints are to raise against the Assyrian “seven shepherds, and eight principal men”; that is, all God’s shepherds and all His principal men, including Christ, the eighth.

**Verse 6 – “And they shall waste the land of Assyria with the sword, and the land of Nimrod in the entrances thereof: thus shall he deliver us from the Assyrian, when he cometh into our land, and when he treadeth within our borders.”**

 The kingdom of Israel that was destroyed by Assyria, and also the kingdom of Judah that was destroyed by Babylon, even all the twelve tribes of

 -- {1tg26 19}

  Israel are to be delivered.

 “And I will,” declares the Lord, “make them one nation in the land upon the mountains of Israel; and one king shall be king to them all: and they shall be no more two nations, neither shall they be divided into two kingdoms any more at all: neither shall they defile themselves any more with their idols, nor with their detestable things, nor with any of their transgressions: but I will save them out of all their dwelling places, wherein they have sinned, and will cleanse them: so shall they be My people, and I will be their God. And David My servant shall be king over them; and they all shall have one shepherd: they shall also walk in My judgments, and observe My statutes, and do them.” Ezek. 37:22-24.

**Verse 7 – “And the remnant of Jacob shall be in the midst of many people as a dew from the Lord, as the showers upon the grass, that tarrieth not for man, nor waiteth for the sons of men.”**

 After the Judgment in the house of God takes place, then it is that “the remnant,” those that are left, are to finish the work of the gospel.

 “Those who have trusted to intellect, genius, or talent, will not then stand at the head of rank and file. They did not keep pace with the light. Those who have proved themselves unfaithful will not then be entrusted with the flock. In the last solemn work few great men will be engaged. They are self-sufficient, independent of God, and he cannot use them. The Lord has faithful servants, who in the shaking, testing time will be disclosed to view.” – “Testimonies,” Vol. 5, pg. 80.

 -- {1tg26 20}

   Then it is that they, the remnant of Jacob, are to be gathered into their homeland, after which they are sent as missionaries to the Gentiles that have not heard of God’s name and of His fame. Thus it is that those who escape alive from the Judgment of the Lord, the remnant, shall be as dew from the Lord, as showers upon the grass. They shall wait for none in their missionary work. They shall bring all their brethren out of all nations “for an offering unto the Lord.” Isa. 66:15, 16, 20.

**Verse 8 – “And the remnant of Jacob shall be among the Gentiles in the midst of many people as a lion among the beasts of the forest, as a young lion among the flocks of sheep: who, if he go through, both treadeth down, and teareth in pieces, and none can deliver.”**

 While God’s people are as dew and as showers to the righteous (Mic. 5:7), they are to the wicked as lions among beasts and flocks of sheep. In other words, their gospel will save the penitent, but destroy the impenitent.

 These verses can mean only one thing, and that is, that God will thoroughly purge His floor. He will take the fan in His hand and blow out the chaff, He

 -- {1tg26 21}

  will destroy the sinners that are among His people. In thus purifying His church, He will create a clean people, a united and zeal-filled ministry. “Thy watchmen shall lift up the voice;” He declares, “with the voice together shall they sing: for they shall see eye to eye, when the Lord shall bring again Zion.” Isa. 52:8.

**Verse 15 – “And I will execute vengeance in anger and fury upon the heathen, such as they have not heard.”**

 “For the time is come that judgment must begin at the house of God: and if it first begin at us, what shall the end be of them that obey not the gospel of God? And if the righteous scarcely be saved, where shall the ungodly and the sinner appear?” 1 Peter 4:17, 18.

 That we miss no part of the lesson in this study, let us recapitulate the main points.

 To begin with, a group of people – good and bad commingled – are brought to view. They, as we have seen, constitute the church that is approaching the time of harvest in which the wicked are to be severed from among the just. (Matt. 13:49).

 While the Lord with a message of warnings and reproofs makes a siege against His people, the adversaries gather together in groups (“troops”) to oppose.  The horses (leaders) shall be cut off (discharged) and the chariots (gathering places) destroyed. God’s people are to be thoroughly purged of sin and sinners and only the penitent are to be left. They are the remnant of Jacob who “shall not do iniquity, nor speak lies; neither shall a deceitful tongue be found in their mouth: for

 -- {1tg26 22}

  they shall feed and lie down, and none shall make them afraid.” Zeph. 3:13. They are to be gathered into their homeland, from thence to go as missionaries to the Gentiles. To the penitent they are to be as dew and as showers, but to the impenitent, as lions among beasts and flocks.

 So the stir caused by Truth’s siege of the church and It’s adversaries warring against It, that is already beginning to arrest the attention of the world, is to result in the cleansing of the church, “temple.” Mal. 3:1-3.

 Thus is the Lord to finish His work on earth, gather His people, destroy the sinners and the heathen alike. Necessarily, “…the days of purification of the church are hastening on apace. God will have a people pure and true.” – “Testimonies,” Vol. 5, pg. 80.

 -- {1tg26 23}

  Depth Of Mercy
--------------

Depth of mercy! can there be

 Mercy still reserved for me?

Can my God His wrath forbear,

 Me, the chief of sinners spare?

I have long withstood His grace,

 Long provoked Him to His face,

Would not hearken to His calls,

 Grieved Him by a thousand falls.

There for me the Saviour stands,

 Shows His wounds and spreads His hands,

God is love! I know, I feel;

 Jesus weeps and loves me still.

 -- {1tg26 24}

  Universal Publishing Association

P.O. BOX 7613

WACO, TEXAS 76714

1-800-729-7494

Volume 1, Nos. 23, 24, 25, 26

Printed in the United Stated of America

 -- {1tg26 25}

  .

 -- {1tg26 26}

repository: GADSDA/shepherd-rod-english

repo_name: GADSDA/shepherd-rod-english


text:
<div itemscope itemtype="http://developers.google.com/ReferenceObject">
<meta itemprop="name" content="tfr.data.build_ranking_serving_input_receiver_fn_with_parsing_fn" />
<meta itemprop="path" content="Stable" />
</div>

# tfr.data.build_ranking_serving_input_receiver_fn_with_parsing_fn

Returns a receiver function with the provided `parsing_fn`.

```python
tfr.data.build_ranking_serving_input_receiver_fn_with_parsing_fn(
    parsing_fn,
    receiver_name,
    default_batch_size=None
)
```

Defined in
[`python/data.py`](https://github.com/tensorflow/ranking/tree/master/tensorflow_ranking/python/data.py).

<!-- Placeholder for "Used in" -->

#### Args:

*   <b>`parsing_fn`</b>: (function) It has a single argument
    parsing_fn(serialized). Users can customize this for their own data formats.
*   <b>`receiver_name`</b>: (string) The name for the reveiver Tensor that
    contains the serialized data.
*   <b>`default_batch_size`</b>: (int) Number of instances expected per batch.
    Leave unset for variable batch size (recommended).

#### Returns:

A `tf.estimator.export.ServingInputReceiver` object, which packages the
placeholders and the resulting feature Tensors together.


text:
# PostfixAdmin Docker image

Production ready Docker container for [PostfixAdmin](http://postfixadmin.sourceforge.net/) with MySQL usage.

This is a fork from [konstantinj/docker-postfixadmin](https://github.com/konstantinj/docker-postfixadmin) with a tiny security addition.

## Features - why using this image instead of several others?

- Uses [alpine](https://registry.hub.docker.com/_/alpine/) base image
- This image is as small as possible - uses PHP built-in webserver
- Uses linked MySQL DB
- Waits for MySQL container to be ready before initializing postfixadmin DB
- It's possible to completely change postfixadmin's configuration
- Installs latest stable postfixadmin release

## Usage

```bash
sudo docker run \
  -p 80:80 \
  -v ./folder-with-php-config-files:/config \
  -e MYSQL_HOST=db \
  -e MYSQL_USER=postfix \
  -e MYSQL_PASSWORD=password \
  -e MYSQL_DATABASE=postfix \
  -e<EMAIL_ADDRESS>- username is actually an email address to login to postfixadmin - THE admin account \
  -e ADMIN_PASSWORD=password - password for the admin account - must contain AT LEAST two digits \
  -e PA_DOMAIN_PATH=YES \
  konjak/postfixadmin
```

All provided env vars starting with PA\_ will be converted to config values for postfixadmin.

It's also possible to mount a folder with php config files to `/config`. All \*.php files in this folder will be executed after the base config.

## Status

Production stable.

repository: DrMurx/docker-postfixadmin

repo_name: DrMurx/docker-postfixadmin


text:
# BlueFruit
My experimentation with the Adafruit Bluefruit Microcontroller.

The product used is the [Circuit Playground Bluefruit - Bluetooth Low Energy (Adafruit Item No. 4333)](https://www.adafruit.com/product/4333)

These are some minor test scripts that utilzed using [CircuitPython](https://circuitpython.readthedocs.io/en/6.0.x/README.html)

Please feel free to copy and use as you wish.

## meeting-mute.py
This program is a keyboard shortcut program that I written to utilize in Zoom and Google Meets.  These programs have a audio and video mute button related to their buttons on the Bluefruit.

These keystrokes given are for a Mac.  You will need to modify your code to match for Windows or Linux.  __Note__: _Zoom & Google Meet can change the keystrokes at anytime.  You have been warned!_

## color-direction.py
This is an expiramental program that I was testing a theory for future code.

Depending on the orientation of the Bluefruit, it would display red or blue neopixels on Bluefruit.

Idea is for task management.  Going to be ordering some new stuff to display status of something and then flip/change orientation of the device to change the printed message on screen.

repository: trbarrettjr/BlueFruit

branch_name: refs/heads/main

repo_name: trbarrettjr/BlueFruit


text:
# Use-Fluentd
This is a Powershell Module for downloading, installing, and configuring [Fluentd](https://www.fluentd.org) via the .msi packages provided by [Treasure Data Inc.](https://treasuredata.com)

This repo consists of 8 modules to download, install, configure, and manage Fluentd:
1. [Disable-Fluentd](https://github.com/azusapacificuniversity/Use-Fluentd/blob/main/Disable-Fluentd.psm1)
2. [Enable-Fluentd](https://github.com/azusapacificuniversity/Use-Fluentd/blob/main/Enable-Fluentd.psm1)
3. [Get-FluentdStatus](https://github.com/azusapacificuniversity/Use-Fluentd/blob/main/Get-FluentdStatus.psm1)
4. [Install-Fluentd](https://github.com/azusapacificuniversity/Use-Fluentd/blob/main/Install-Fluentd.psm1)
5. [Restart-Fluentd](https://github.com/azusapacificuniversity/Use-Fluentd/blob/main/Restart-Fluentd.psm1)
6. [Set-FluentdConfig](https://github.com/azusapacificuniversity/Use-Fluentd/blob/main/Set-FluentdConfig.psm1)
7. [Uninstall-Fluentd](https://github.com/azusapacificuniversity/Use-Fluentd/blob/main/Uninstall-Fluentd.psm1)
8. [Use-Fluentd](https://github.com/azusapacificuniversity/Use-Fluentd/blob/main/Use-Fluentd.psd1)

## Installing Fluentd
In order to properly run the Install-Fluentd module, Powershell 5.1 must be [installed](https://docs.microsoft.com/en-us/powershell/scripting/windows-powershell/wmf/setup/install-configure?view=powershell-7).
Now we can start can install the module through Powershell Gallery.
1. In Powershell run this command to install the necessary modules
> `Install-Module -Name Use-Fluentd`
2. Import the module into your session
> `Import-Module Use-Fluentd`
3. Download the .msi from Treasure Data Inc. and configure with your server information. `Install-Fluentd` will take a variety of arguments that allow you to configure the service at install:
```
-Server     The FQDN or IP of the fluentd server to forward the packets to.
-Port       The port number of the server to specify (Defaults to 443)
-Tag        The tag to forward the logs with. (defaults to winevt.raw)
-Version    The version of td-agent to install. (Defaults to 4.0.1)
```

*This is just an example*
> `Install-Fluentd -Server <IP_ADDRESS> -Servername fluentd-02 -Tag "it.winevt.raw" -Port 7777`

After installing using `Install-Fluentd`, the function will automatically enable and start the fluentd service.

### Configure Fluentd
When `Install-Fluentd` runs, it uses a gem install to update to the latest version of [fluent-plugin-windows-eventlog](https://github.com/fluent/fluent-plugin-windows-eventlog). This allows us to default the [widows_eventlog2 plugin](https://github.com/fluent/fluent-plugin-windows-eventlog#in_windows_eventlog2) to check the logs, which we've found to be more stable and efficient. If you wish to change your config, you can use `Set-FluentdConfig`, uses the same `-Server -Port -Tag` arguments as `Install-Fluentd`, to update your configuration. You'll need to restart the service for changes to take affect.

Or you can write your own td-agent.conf in place to use other plugins or filters. The config can be found here:
> `C:\opt\td-agent\etc\td-agent\td-agent.conf`

*Please note that using `Set-FluentdConfig` overwrites the config file.*

### Uninstall Fluentd
If you no longer wish Fluentd to be on your machine simple use `Uninstall-Fluentd` and it will be completley removed from your computer. It removes the installed .msi file and cleans up any lingering configs from the default install location.

## Running Fluentd
You can start or stop the Fluentd service at any time using the following functions:
> `Enable-Fluentd`or `Disable-Fluentd`

To see information about Fluentd's status and configuration, you can use:
> `Get-FluentdStatus`

Here is a sample output from that command:
```
Fluentd Details:
Version: 4.0.1
Server:  <IP_ADDRESS>
Port:  7777
Tags:  it.winevt.raw
State: Running
```
## Contributing
If you're interested in contributing to this project, we would be honored and happy to have your help. If this is your first project, and you're a little confused on how to get started, be sure to check out [How to Contribute to Open Source](https://opensource.guide/how-to-contribute/) for an overview of good habits, and the Github documentation on [How to create a Pull Request](https://help.github.com/articles/creating-a-pull-request/) for the technical bits.

It can be scary at first, but don't worry - you'll do fine.

#### Please submit all pull requests to the azusapacificuniversity/Use-Fluentd repository in the develop branch!

As you're working on bug-fixes or features, please break them out into their own feature branches and open the pull request against your feature branch. It makes it much easier to decipher down the road, as you open multiple pull requests over time, and makes it much easier for us to approve pull requests quickly.

Another request is that you do not change the current requirements to running this program. An example, is that you might create a new function to get data that is useful to your organization. Our request is that that function isn't required to run natively or is enabled by default, but rather is available to users if they configure their version for it.

#### Pull Request Guidelines:

A good commit message should describe what changed and why. Use-Fluentd hopes to use semantic commit messages to streamline the release process and easily generate changelogs between versions.

Before a pull request can be merged, it must have a pull request title with a semantic prefix.

Examples of commit messages with semantic prefixes:

    Fixed #<issue number>: Fixes Get-FluentdStatus for newest version.
    Added #<issue number>: Add Get-Config to view the current config.

Please reference the issue or feature request your PR is addressing. Github will automatically link your PR to the issue, which makes it easier to follow the bugfix/feature path in the future.

Whenever possible, please provide a clear summary of what your PR does, both from a technical perspective and from a functionality perspective.

When Contributing, please understand that after a change is submitted, the modules must be resubmitted to Powershell to change the official module, but please feel free to use it in your own builds once you feel confident it works

#### Thank you and we look forward to your contributions

repository: timothylancia/Use-Fluentd

repo_name: timothylancia/Use-Fluentd


text:
Disclamer
=========

I made this stuff in 2009, it was my first project in OCaml,
first project in any functional language and a first compiler.

I wrote all this stuff before I've read a book about compiler
construction, garbage collection, memory management, etc.

Hopefully, it explains all weird things you may meet inside.

The good news is that this stuff works.

Build
-----

  1.  Install OCaml and OCaml build tools
  1.  Install ExtLib
  1.  make

Examples
--------

    ./beepc.native ./helloworld.beep
	ls -1
	helloworld.bin
	helloworld_stubs.c
	helloworld_stubs.h

The output:

  - helloworld.bin --- bytecodes file
  - helloworld\_stubs.c --- stubs
  - helloworld\_stubs.h --- stubs

repository: voidlizard/beepc

repo_name: voidlizard/beepc


text:
# Splash Damage 'Live' Coding Standards

The company applies a novel model whereby the C++ coding standard consists of 'live' source code files that are 1st class citizens in the main development tree. Find them in this repository for reference.

For more information watch [this presentation](https://skillsmatter.com/skillscasts/13577-valentin-galea-live-coding-standards).

https://www.splashdamage.com/contact

repository: Hazeti/coding-standards

repo_name: Hazeti/coding-standards


text:
animation-fade-in-module
=========

The animation-fade-in-module can be used to provide smooth transitions of elements on the page as the user scrolls. This allows elements to subtlely fade-in and ultimate provides a better user experience. This uses the filter opacity CSS 3 element.
## There are a few things to know before using this in your project:

1. For starters, I built this with my boilerplate but you *DON'T* need my boilerplate to make the module work in your project

2. The module requires the HTML to build it, the CSS to style it and the JS/JQuery to give it the functionality

5. Questions?
    *<EMAIL_ADDRESS>
## Using the boilerplate & getting started:

mySpaceBase
=========

### mySpaceBase is a Sass-based responsive CSS framework built on spaceBase.

## Getting Started
```sh
1. $ git clone https://github.com/AdamAndSubtractThem/animation-fade-in-module
2. $ npm i
3. $ gulp launch
```
4. Open scss/_vars.scss to make changes to your global variables.
4. Start building out your HTML. I've included index.html as a starting point.
6. scss/base/ is the core of mySpaceBase. Build your UI layer in scss/ui/
7. Do a find and replace on the entire project directory for '.mySpaceBaseWrap' and replace the name with your project specfic name (e.g. '.gameCrusher3' )

Many CSS frameworks are meant to be included and left alone. But mySpaceBase is a boilerplate layer that can be built upon and tailored for your needs. It combines best practices for today’s responsive web with the core components we use on every project. Consider it the launch pad for your adventures into cyberspace.

mySpaceBase is the front-end starter files for any new web project. It sets up your Sass architecture and normalizes your CSS and native HTML elements. It provides the structural groundwork for your application.

Built on spaceBase:
[![Build Status](https://img.shields.io/travis/space150/spaceBase.svg?style=flat-square)](https://travis-ci.org/space150/spaceBase)

### Highlights

* Object-oriented CSS
* Optimized for light speed
* Common UI components (buttons, lists, media object)
* Helper classes and mixins
* Cross-browser form controls
* Built on REMs, with px fallback
* Supports modern browsers including IE8+

### Customizable Features

* Compatible with any Sass 3.3 compiler
* Start with Normalize (default) or CSS Reset
* Scalable, mobile-first grid - choose how robust you want it
* Base font size for mobile vs desktop
* Global variables for breakpoints, colors, fonts and more

Your editor can be setup with EditorConfig so that code style standards are enforced automatically. See http://editorconfig.org/#download and install the plugin for your editor of choice.

## IMPORTANT

* If you're building a static content page for DSG, GGXY, or FnS, import the code base from 'app/scss/sites-base/' . This way your local build will have the same starting files as the site.

## The mySpaceBase structure

Read the [CSS Architecture Overview](app/scss/README.md) for documentation of the SCSS files.

```
Build in the app directory.

app/
  assets/
    fonts/
    images/
    media/
scss/
  base/
    ...
  ui/
    ...
  vendor/
    ...
  sites-base/
    ...
  _manifest.scss
  _vars.scss
  application-ie.scss
  application.scss
  styleguide.scss
css/
  application-ie.css
  application.css
  styleguide.css
js/
  scripts.js
```

You can remove:
- `bower.json`
- `Gemfile`
- `Gemfile.lock`
- `Rakefile`
- `test/`
(If you download the original)

## Credits

* [Harry Robert’s Inuit.css](https://github.com/csswizardry/inuit.css)
* [Sass MQ](https://github.com/sass-mq/sass-mq)
* [Bootstrap](http://getbootstrap.com)
* [HTML5 Boilerplate](http://html5boilerplate.com)
* [Normalize.css](http://necolas.github.io/normalize.css)
* [Eric Meyer’s CSS Reset](http://meyerweb.com/eric/tools/css/reset)

## License

mySpaceBase is free to use under the [MIT License](LICENSE.md).

Copyright 2017 [Adam Knee](http://www.adamknee.net)

## Original Boilerplate License:

spaceBase is free to use under the [MIT License](LICENSE.md).

Copyright 2016 [space150](http://www.space150.com)


text:
---
layout: creature
name: "Gnoll Fang of Yeenoghu"
tags: [medium, humanoid, cr4, monster-manual]
cha: 13 (+1)
wis: 11 (0)
int: 10 (0)
con: 15 (+2)
dex: 15 (+2)
str: 17 (+3)
size: Medium humanoid (gnoll)
alignment: chaotic evil
challenge: "4 (1,100 XP)"
languages: "Abyssal, Gnoll"
senses: "darkvision 60 ft."
saving_throws: "Con +4, Wis +2, Cha +3"
speed: "30 ft."
hit_points: "65 (10d8+20)"
armor_class: "14 (hide armor)"
---

***Rampage.*** When the gnoll reduces a creature to 0 hit points with a melee attack on its turn, the gnoll can take a bonus action to move up to half its speed and make a bite attack.

### Actions

***Multiattack.*** The gnoll makes three attacks: one with its bite and two with its claws.

***Bite.*** Melee Weapon Attack: +5 to hit, reach 5 ft., one creature. Hit: 6 (1d6 + 3) piercing damage, and the target must succeed on a DC 12 Constitution saving throw or take 7 (2d6) poison damage.

***Claw.*** Melee Weapon Attack: +5 to hit, reach 5 ft., one target. Hit: 7 (1d8 + 3) slashing damage.

gha_language: CSS

gha_license_id: NOASSERTION


text:
# ECC
Implementation of Elliptic Curve on integer field with python3

## Environment
```console
$ python3 --version
Python 3.7.5
```

## Usage(Test)
```console
$ python3 test.py
```

- Expected output
  ```
    [Error]: An error occured:  Given A, B do not satisfy elliptic curve condition(discriminant is not 0)
    (35,11)
    (11,10)
    (12,23)
    (12,14)
    (11,27)
    (11,27)
    (22,36)
    (22,36)
    (31,28)
    IDENTITY
    (6,3)
    (6,3)
    IDENTITY
    IDENTITY
    IDENTITY
    [Error]: An error occured:  Can not add two different curve's point
<PHONE_NUMBER>6547004231252920425935692360644145829622209833684329913297188986597,12158399299693830322967808612713398636155367887041628176798871954788371653930)
    IDENTITY
  ```

## TODO
- [ ] Implement prime checker (This may not be necessary).
- [ ] Build a p2p key exchange model of [Diffie Hellman key exchange](https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange) based on ECC.
- [ ] Add a description about structure of `Point` and `EllipticCurve`.

## Reference
- [ECC](https://www.math.brown.edu/~jhs/Presentations/WyomingEllipticCurve.pdf)
- [Montgomery ladder](https://en.wikipedia.org/wiki/Elliptic_curve_point_multiplication)
- [Secp256k1](https://en.bitcoin.it/wiki/Secp256k1)

repository: sklationd/ECC

repo_name: sklationd/ECC


text:
create-fullstack-app

  Create Fullstack TypeScript application with ease.

## 📜 About

**create-fullstack-app** is a CLI tool to easily generate boilerplate code for your projects with TypeScript/JavaScript. You don't need to learn and configure many tools and create the basics folders/files so you can **focus on development**. There are many templates available so you can generate any projects (front-end, back-end or both) with any frameworks.

## 🚀 Features

- 💯 Maximize Lighthouse Google Chrome score
- ✨ Follow [JavaScript Standard Style](https://standardjs.com/) (for TypeScript)
- ⚡ Easy to use

## 📦 Templates availables :

### Website (front-end) :

- [React.js](https://reactjs.org/) with [Next.js](https://nextjs.org/) (server-side rendering)
- [Vue.js](https://vuejs.org/) with [Nuxt.js](https://nuxtjs.org/) (server-side rendering)

### API (back-end) :

_Note : The projects templates use [MySQL](https://www.mysql.com/) as database._

- [Express.js](https://expressjs.com/) with [Sequelize](https://sequelize.org/) (ORM)
- [Strapi](https://strapi.io/) (Headless CMS)
- [Nest.js](https://nestjs.com/) (framework for building efficient, scalable server-side applications)

## ⚙ Usage

```sh
npx create-fullstack-app <directory-name>
```

It will ask you some questions (template(s), name, description, etc.), when answered, it will copy and install all the dependencies needed for your project.

### Options :

```
-V, --version   output the version number
-h, --help      display help for command
--only-website  generate only a website project
--only-api      generate only an API project
```

### Tips :

By default, when you generate a website (front-end) project, there are the icons of the TypeScript logo in various sizes located in the static/public folder.

You can easily generate you own icons of various sizes thanks to [Web App Manifest Generator](https://app-manifest.firebaseapp.com/).

[![JavaScript Style Guide](https://cdn.rawgit.com/standard/standard/master/badge.svg)](https://github.com/standard/standard)

## 📄 License

[MIT](./LICENSE)

repository: Aslemammad/create-fullstack-app

repo_name: Aslemammad/create-fullstack-app


text:
# Clean Architecture

```
Reuse/Release Equivalence Principle (REP)
REP is a component level principle. Reuse refers to a group of reusable classes or modules. Release refers to publishing it with a version number. This principle says that whatever you release should be reusable as a cohesive unit. It shouldn't be a random collection of unrelated classes.

Common Closure Principle (CCP)
CCP is a component level principle. It says that components should be a collection of classes that change for same reason at the same time. If there are different reasons to change or the classes change at different rates, then the component should be split up. This is basically the same thing as the Single Responsibility Principle above.

Common Reuse Principle (CRP)
CRP is a component level principle. It says that you shouldn't depend on a component that has classes that you don't need. Those components should be split up so that the users don't have to depend on classes that they don't use. This is basically the same thing as Interface Segregation Principle above.

Acyclic Dependency Principle (ADP)
ADP means that you shouldn't have any dependency cycles in your project. For example, if component A depends on component B, and component B depends on component C, and component C depends on component A, then you have a dependency cycle.

Stable Dependency Principle (SDP)
This principle says that dependencies should be in the direction of stability. That is, less stable components should depend on more stable components. This minimizes the effect of change. Some components are intended to be volatile. That's OK, but you shouldn't make stable components depend on them.

Stable Abstraction Principle (SAP)
SAP says that the more stable a component is, the more abstract it should be, that is, the more abstract classes it should contain. Abstract classes are easier to extend so this keeps stable components from becoming too rigid.
```

## 용어 및 기술
- [Inject](https://github.com/ivankorobkov/python-inject)
- [dependency-injector](https://github.com/ets-labs/python-dependency-injector)
- [Term](https://pusher.com/tutorials/clean-architecture-introduction)

## Terminology
- Adapter: The adapters, also called interface adapters, are the translators between the domain and the infrastructure.
- Port: In application Layer, Port is an interface of Adapter.
- Boundary: In application Layer, Boundary is an interface of Presenter.
- Use Case: The use cases are the business rules for a specific application.
- Infrastructure: This layer is where all the I/O components go: the UI, database, frameworks, devices, etc.
- Entity: An entity is a set of related business rules that are critical to the function of the application.

## Reference
- [The Clean Architecture in Python. How to write testable and flexible code](https://breadcrumbscollector.tech/the-clean-architecture-in-python-how-to-write-testable-and-flexible-code/)
- [Python으로 클린 아키텍처 적용하기](https://velog.io/@jahoy/Python%EC%9C%BC%EB%A1%9C-Clean-Architecture-%EC%A0%81%EC%9A%A9%ED%95%98%EA%B8%B0)
- [[Python] Django, Clean Architecture 연구하기](https://medium.com/@erish/python-django-clean-architecture-%EC%97%B0%EA%B5%AC%ED%95%98%EA%B8%B0-591d7a555059)
- [Clean architectures in Python: a step-by-step example](https://www.thedigitalcatonline.com/blog/2016/11/14/clean-architectures-in-python-a-step-by-step-example/)

repository: hyunsung-kim/py-clean-architecture

repo_name: hyunsung-kim/py-clean-architecture


text:
# varsity-next-matches

<!-- Auto Generated Below -->

## Properties

| Property | Attribute | Description | Type  | Default     |
| -------- | --------- | ----------- | ----- | ----------- |
| `data`   | `data`    |             | `any` | `undefined` |

## Dependencies

### Used by

 - [varsity-upcoming](../varsity-landing/varsity-upcoming)

### Depends on

- [label-card](../../../cards/label-card)

### Graph
```mermaid
graph TD;
  varsity-next-matches --> label-card
  label-card --> kclsu-button
  label-card --> lazy-image
  kclsu-button --> flex-container
  lazy-image --> scroll-observer
  varsity-upcoming --> varsity-next-matches
  style varsity-next-matches fill:#f9f,stroke:#333,stroke-width:4px
```

----------------------------------------------

*Built with [StencilJS](https://stenciljs.com/)*

gha_language: TypeScript


text:
# cypress-select-typescript-tests

> User space solution for picking Cypress tests to run

## Install

Assuming [Cypress](https://www.cypress.io) has been installed:

```shell
npm install --save-dev cypress-select-typescript-tests
```

### Warning ⚠ (changes in this fork)

- this package assumes JavaScript or Typescript specs and as such, includes typescript as a dependency. If you just
  use javascript, use the original package
- this package might conflict and/or overwrite other Cypress Browserify preprocessor settings
- this package prevents "pending" steps by replacing the with ";" instead of skipping.

If you wish to filter out spec files that will have no matches in them so they won't pollute your reports, you
can run the `precypress` and it will read your cypress.json along with any command line --env and write out a new
file called `cypress-grep.json`. If you use `--config-file=./cypress-grep.json` then this will give Cypress a list
of tests to run and pass your environment settings through.

You have another option if you use `precypress` in that you can use another environment flag called `grep-filter`
which if included will do an `filename.includes(filter)` on each file in cypress/integration. If for example you only
wish to include `_spec.ts` files, then use `--env grep-filter=_spec.ts`

## Mocha-like selection

[Mocha](https://mochajs.org/) has `--fgrep`, `--grep` and `--invert` CLI arguments to select spec files and tests to run. This package provides imitation using strings. In your `cypress/plugins/index.js` use:

```js
const selectTestsWithGrep = require('cypress-select-typescript-tests/grep')
module.exports = (on, config) => {
  on('file:preprocessor', selectTestsWithGrep(config))
}
```

Then open or run Cypress and use environment variables to pass strings to find. There are various ways to [pass environment variables](https://on.cypress.io/environment-variables), here is via CLI arguments:

```shell
 ## run tests with "works" in their full titles
 $ npx cypress open --env grep=works
 ## runs only specs with "foo" in their filename
 $ npx cypress run --env fgrep=foo
 ## runs only tests with "works" from specs with "foo"
 $ npx cypress run --env fgrep=foo,grep=works
 ## runs tests with "feature A" in the title
 $ npx cypress run --env grep='feature A'
 ## runs only specs NOT with "foo" in their filename
 $ npx cypress run --env fgrep=foo,invert=true
 ## runs tests NOT with "feature A" in the title
 $ npx cypress run --env grep='feature A',invert=true
 ```

The test picking function is available by itself in [src/grep-pick-tests.js](src/grep-pick-tests.js) file.

## Write your own selection logic

In your `cypress/plugins/index.js` use this module as a file preprocessor and write your own `pickTests` function.

```js
const selectTests = require('cypress-select-typescript-tests')

// return test names you want to run
const pickTests = (filename, foundTests, cypressConfig) => {
  // found tests will be names of the tests found in "filename" spec
  // it is a list of names, each name an Array of strings
  // ['suite 1', 'suite 2', ..., 'test name']

  // return [] to skip ALL tests
  // OR
  // let's only run tests with "does" in the title
  return foundTests.filter(fullTestName => fullTestName.join(' ').includes('does'))
}

module.exports = (on, config) => {
  on('file:preprocessor', selectTests(config, pickTests))
}
```

Using `pickTests` allows you to implement your own test selection logic. All tests filtered out will be shown / counted as pending.

## Combine custom browserify with grep picker

If you are adjusting Browserify options, and would like to use the above Mocha-like grep test picker, see [test/plugin-browserify-with-grep.js](test/plugin-browserify-with-grep.js) file. In essence, you want add the grep transform to the list of Browserify plugins. Something like

```js
const browserify = require('@cypress/browserify-preprocessor')
// utility function to process source in browserify
const itify = require('cypress-select-typescript-tests/src/itify')
// actual picking tests based on environment variables in the config file
const { grepPickTests } = require('cypress-select-typescript-tests/src/grep-pick-tests')

module.exports = (on, config) => {
  let customBrowserify

  // get the browserify options, then push another transform
  options.browserifyOptions.transform.push(itify(config, grepPickTests))
  customBrowserify = browserify(options)

  on('file:preprocessor', file => customBrowserify(file))
}
```

## Debugging

To see additional debugging output run

```
DEBUG=cypress-select-tests npx cypress open
```

### Small print

Author: Gleb Bahmutov<EMAIL_ADDRESS>© 2019

- [@bahmutov](https://twitter.com/bahmutov)
- [glebbahmutov.com](https://glebbahmutov.com)
- [blog](https://glebbahmutov.com/blog)

License: MIT - do anything with the code, but don't blame me if it does not work.

Support: if you find any problems with this module, email / tweet /
[open issue](https://github.com/rvowles/cypress-select-typescript-tests/issues) on Github

## MIT License

Copyright (c) 2019 Gleb Bahmutov<EMAIL_ADDRESS>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

 IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

repository: fernyb/cypress-select-typescript-tests

repo_name: fernyb/cypress-select-typescript-tests


text:
# Ansible Container Linux Bootstrapper

CoreOS Container Linux (formerly known as CoreOS Linux) ships with no Python
interpreter.So, people who work with this OS can't run Ansible playbooks neither
remotely or locally.

To Automate Container Linux machines or applying configurations on, this project
can do this easily without any pain and blood ! This set of Ansible playbooks
installs "pypy" as a lightweight Python interpreter on top of Container Linux.

## Install
To prepare Container Linux machines and bootstrap them follow bellow steps:

* Install Ansible 2.5.x or above on the local machine. There is no guaranty for
older versions of Ansible.

* Add public ssh keys into the machines. This step probably has been done during
Container Linux installation process. So it's not neccessary do anything.

* Open `inventory.cfg` and add destination machine(s) IP instead of `w.x.y.z` in
line `ansible_host=` as well as local user on Container Linux. in most of public
cloud providers like AWS, GCP or Azure, default user is `core`.

* And then run playbooks with this command:
```
ansible-playbook -i inventory playbook.yml
```

You can use this playbook independently or merge it into your own playbooks to
automate Container Linux machines easily.


text:
# BlynkMqttBridge

This C# application works as a two-way bridge between MQTT and Blynk App.
By changing configured VPIN value on Blynk, it will be reposted to MQTT server and vice versa.

![alt text](img/demo2.jpg ".. in action")

![alt text](img/demo1.png ".. in action")

## Usage example

Linux (using mono):

```sh
mono BlynkMqttBridge.exe -dump
```

Windows:

```sh
BlynkMqttBridge.exe -dump
```
Valid .ini configuration file should be provided in executable directory.
Command line arguments -verbose or -dump might be used to determine debug level.

## Configuration

Example configuration file is provided in bin/Release directory. Application will look for blynkmqttbridge.ini file every run.
Once ran, it loads topics mapping and types. There is a simple mechanism which allows to convert values, for example Blynk LED value is parsed as 0 to 255, but MQTT bool value is almost always defined as 0 or 1. Simply, when MQTT topic has value "1", then "255" will be published on Blynk side and when "255" value is published on that pin, it will repost value "1" to MQTT. This behaviour is defined in TypeEncoder.cs in Application directory.

## Development setup

Simply use Visual Studio 2017 and build provided solution.

## Libraries used by application

[M2Mqtt][m2mqtt] persist here as binary blob. Code can be found at linked repository.

[Ini Library][ini_library] by Larry57

[Blynk Library][blynk_library] by Sverre Frøystein

<!-- Markdown link & img dfn's -->
[m2mqtt]: https://github.com/eclipse/paho.mqtt.m2mqtt
[blynk_library]: https://github.com/sverrefroy/BlynkLibrary
[ini_library]:https://gist.github.com/Larry57/5725301

gha_language: C#


text:
## IMPORTANT: NEW IN 2.8.1 !!!!
Please create the "log" folder /var/log/macromilter/log or LOG_DIR/log !!

```bash
  mkdir /var/log/macromilter/log
  chown postfix:postfix -R /var/log/macromilter
```

## Contributing
I need some code review and help to make this milter better! If you find some bugs or the code is "creepy" -> feel free to contribute :)

To contribute, please fork this repository and make pull requests to the develop branch.
## Abstract
This python based milter (mail-filter) checks an incoming mail for MS 200x Office attachments (doc, xls, ppt, xlsm, docm, rtf). If a MS Office file is attached to the mail it will be scanned for suspicious VBA macro code. After the milter parsed the attachment a kind of risk level will be defined for that document. If the risk level reaches a defined value – the mail will be rejected to the sender.

*The repo is optimized for Visual Studio*
## Features
* Parsing VBA macros for suspicious code and function calls
* Uses the milter interface at postfix and sendmail
* Easy to implement
* Not based on virus heuristics (high detection rate)
* Only reject if a threshold is reached
* Whitelisting
* Creates a hashtable for allready scanned files (prevents rescans)
* Runns at the pre-queue at postfix

## Dependencies
This milter use the functionality from the oletools (https://bitbucket.org/decalage/oletools) and pymilter (https://pythonhosted.org/milter/) projects.

## Installation (Ubuntu with upstart)
1. download the oletools (https://bitbucket.org/decalage/oletools) and pymilter (https://pythonhosted.org/milter/) packages
2. step through the following bash. In some cases, you need to edit paths or install some missing dependencies!
```bash
# create files and folders
mkdir /etc/macromilter
mkdir -p /var/log/macromilter/
mkdir /var/log/macromilter/log
# only needed for a chroot env
# mkdir /var/spool/postfix/etc/milter

# install macromilter dependencies
apt-get update
apt-get install python2.7 python2.7-dev libmilter-dev libmilter1.0.1 python-pip

# install oletools
pip install oletools

# install pymilter --> maybe you need some addtional dependencies - see doc
pip install pymilter

# copy the python script
cp macromilter.py /etc/macromilter/
# setup upstart config
cp MacroMilter.conf /etc/init/
initctl reload-configuration
# create the whitelist
touch /etc/macromilter/whitelist.list

# set chown for postfix
chown postfix:postfix -R /etc/macromilter
chown postfix:postfix -R /var/log/macromilter
# only needed if you run the milter at chroot an with a linux-socket
# chown postfix:postfix -R /var/spool/postfix/etc/milter

# start and check
service MacroMilter start
tail /var/log/syslog
```
## Installation script OpenSuse
```bash
zypper in python-devel sendmail-devel gcc python-pip git
pip install pymilter
pip install oletools
git clone https://github.com/sbidy/MacroMilter
#git clone https://github.com/Gulaschcowboy/MacroMilter
mkdir -p /etc/macromilter/
mkdir -p /var/log/macromilter/
mkdir /var/log/macromilter/log
cp MacroMilter/MacroMilter/macromilter.py /etc/macromilter/
cp MacroMilter/MacroMilter/macromilter.service /etc/systemd/system/
cp MacroMilter/MacroMilter/macromilter.logrotate /etc/logrotate.d/

touch /etc/macromilter/whitelist.list
chown postfix:postfix /var/log/macromilter/

systemctl daemon-reload
systemctl start macromilter.service
systemctl status macromilter.service
systemctl enable macromilter.service

postconf -e smtpd_milters=inet:<IP_ADDRESS>:3690
postconf -e milter_default_action=accept

rcpostfix reload
```
## User whitelist
To allow a user or domain to send VAB-Macro-Mails enter only the user mail address<EMAIL_ADDRESS>or the whole domain (@domain.com) in the whitelist.list file. Only one entry per line.

Be careful with whitelisting! In some cases the better way is to block all Office_Macro_files with for example ClamAV.

##VBA_OLE_Malware_MD5.txt
This file contains more than 500 MD5 Hashes of suspicious Office documents.

## TBD
* Calculate a better reject level
* Use the full features ot the olevba
* Add some advanced logic to the whitelist
* Code need some love :-)

## Authors
Stephan Traub - Sbidy -> https://github.com/sbidy

## License
The MIT License (MIT)

repository: heinrichheine/MacroMilter

gha_language: Python

repo_name: heinrichheine/MacroMilter


text:
# Monitoring Cross Namespace Applications

Prometheus can monitor applications in any namespace, and show its corresponding metrics, but for that, you need to have proper RBAC for prometheus to get endpoints of another namespace. So when monitoring applications in any other namespace, create and RBAC,

```yaml
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: RoleBinding
metadata:
  name: prometheus-rolebinding
  namespace: monitoring         # Namespace to which monitor apps in
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: prometheus-role
subjects:
- kind: ServiceAccount
  name: monitoring-k8s          # The service account of your promethues which is used for prometheus
  namespace: default
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: Role
metadata:
  name: prometheus-role
  namespace: monitoring         # Namespace to which monitor apps in
rules:
- apiGroups: [""]
  resources:
  - nodes
  - services
  - endpoints
  - pods
  verbs: ["get", "list", "watch"]
- apiGroups: [""]
  resources:
  - configmaps
  verbs: ["get"]
```

After this, check the endpoint your service exposes for Prometheus and add that endpoint in your Service Monitor.

repository: stakater/til

repo_name: stakater/til


text:
---
layout: research
title: Speech Language and Audiology Clinic
date: 2016-01-16
excerpt: "Design Lead"
project: true
tags: [SLAC, audiometer]
comments: true
---

## Research Member

As a member of the SLAC team we researched audiology and its associated technologies to create the first online hearing test simulator. This is a tool made to assist the audiology department in order to provide them a method to practice administering hearing tests to virtual patients.

[SLAC Web App](https://epics.ecn.purdue.edu/wise/SLAC/){: .btn}


text:
# History

## 0.9.0

* Completely new git-like UI based on Click
* Behaviour change to symlink files at any depth
   - backwards incompatible, see README.md
* Lots of refactoring and cleanups
* Several new tests to improve coverage

## 0.6.4

* Add no_dot_prefix option
* Fix error in syntax for missing repo message
* Expands ~'s in config file path

## 0.6.3

* Prevent adding toplevel package directories (bugfix)
* Only replace existing dotfiles on remove operation (bugfix)

## 0.6.2

* Fix single-sync in python 3.x (map is lazy)
* Fix sync --force regression
* Fix unit tests to exit with the correct return code

## 0.6.1

* Add ability to sync only specified files
* Create non-existent package directories
* Mention using Dropbox to synchronize a dotfiles repository

## 0.6.0

* Add "packages" feature
* Add --dry-run option
* Much needed code cleanup

## 0.5.6

* Restore python 3 compatibility

## 0.5.5

* Add support for Windows symlinks with Python 2

## 0.5.4

* More Python 3 fixes

## 0.5.3

* Update remaining references to 'unmanaged'
* Allow ~ in configuration file external targets
* Make source compatible with Python 3
* Add specific Python version trove classifiers

## 0.5.2

* Improve wording of "unmanaged" with "unsynced"
* Fix adding a directory with a trailing slash
* Mention support for directories in documentation

## 0.5.1

* Fix license formatting

## 0.5.0

* Add support for in-repo configuration files

## 0.4.4

* Restore python 2.5 compatibility

## 0.4.3

* Add glob style pattern support for the ignore option

## 0.4.2

* Fix bug when syncing an unmanaged directory symlink

license: ISC


text:
---
published: false
layout: post
title: Distributed Matrix product
date: 2016-04-03T11:10:00.000Z
categories: "Computer-Science"
---

Matrix multiplication is something a mathemacial operation that takes two matrices and produces another one as a result. Before explaining how distributed matrices product can work, we are going to do a quick reminder of whati is a matrix and what's a dot product of matrices. You can skip that part if everything is fresh in your mind.

## Matrices and dot product

### Matrices
A matrix is a data structure that's made of columns and rows. It is basically a Tic tac toe grid with a potentially infinite number of rows and columns and numbers within the grid.

![Tictactoe]({{site.baseurl}}/assets/images/distributed-matrix/tictactoe.png)

With numbers instead of crosses and circles.

![TictactoeNumber]({{site.baseurl}}/assets/images/distributed-matrix/tittacttoenumber.png)

When a matrix has the same number of rows and column we say that it is squared ... because it looks like a square.

![squarematrix]({{site.baseurl}}/assets/images/distributed-matrix/squarematrix.png)

### Dot Product
A dot product an operation that takes two matrices and return another matrix as the result. Let's take an example to go through the process.

Let A be a squared 2x2 (2 rows & 2 columns) matrix and B another squared 2x2 matrix.

![AB]({{site.baseurl}}/assets/images/distributed-matrix/ab.png)

This matrix product will result in another 2x2 matrix C

![c]({{site.baseurl}}/assets/images/distributed-matrix/c.png)

In that configuration each element of C: c(1,1), c(1,2), c(2,1) and c(2,2) is the result of sums and products on the corresponding rows of A and columns of B with the following fashion:

* c(1,1) = 1 * 2 + 3 * 3 = 11
* c(1,2) = 1 * 1 + 3 * 1 = 4
* c(2,1) = 5 * 2 + 2 * 3 = 16
* c(2,2) = 5 * 1 + 2 * 1 = 7

The overall operation look like this, in red is circled the elements of the matrix involved in getting the c(1,1) = 11 part of the resulting matrix C:

![product]({{site.baseurl}}/assets/images/distributed-matrix/product.png)

## Distributed matrix product

Why trying to distribute this operation accross processors?

This operation is used in a lot of Machine Learning algorithms. The more data you have in machine learning, the better the output of your algorithm is likely to be. So we want to be able to make that operation on very large matrices that potentialy don't fit into memory.

For the sake of simplicity we will consider squared matrices but everything can be generalized to all kind of matrices.

### Column/Row data segmentation

Since our main problem is to be able to store the whole matrices data into memory on one processor we will have to distribute it.

Let p be the number of processors we can use.

A first way to do that is to split the first matrix in p slices of rows and split B in p slices of columns.

![slice-1]({{site.baseurl}}/assets/images/distributed-matrix/column-row-slice.png)

Let's attribute each slice of the data for each matrix to a processor. What happens in processor 1 ?

It gets the first rows slice of A and the first column slice of B. With that, and using the definition of the dot product, it is only able to compute a specific part of C, the top left corner of C.

![c_res1]({{site.baseurl}}/assets/images/distributed-matrix/c_res.png)

Follwing that logic, each processor will be able to compute a part of the diagonal on C. Resulting in a partial result of the dot product for C. The only elements that we will be able to compute will the the blacked squared elements on the following drawing.

![c_diag]({{site.baseurl}}/assets/images/distributed-matrix/c_diag.png)

In order to fill the blanks we will iterate but we will change how the slice of B are affected to processors. Now processor one will have rows' slice 1 of A and columns slice 2 of B and will be able to compute the corresponding part of C, which is the intersection of slice 1 and 2. If we imagine the processors in a ring all they have to do at each iteration is pass their current slice of B to their neighboor untill everybody has seen all the slices of B.

![column_ring]({{site.baseurl}}/assets/images/distributed-matrix/column_ring.png)

The result will of the next iteration will be the parts of C drawn in red.

![c_diag_2]({{site.baseurl}}/assets/images/distributed-matrix/c_diag_2.png)

This really gives us the intuition that if we repeat that operation enough we will be able to compute the whole matrix after having computed small parts of it.

### Submatrices data segmentation

An intuition that you can get from the previous method is that instead of slicing one matrix verticaly and the other horizontaly by the number of processors, could we slice it in p submatrices

![sub_matrix_prod]({{site.baseurl}}/assets/images/distributed-matrix/sub_matrix_prod.png)

In that configuration, each one of the c(x,x) can be expressed as the sum of the dot product of a subset of A & B submatrices.

![equation_sub]({{site.baseurl}}/assets/images/distributed-matrix/equation_sub.png)

That equation expresses the fact that, like before, we still need the entire row and column to compute the complete dot product but the way to get there is different. Now, each processor is responsible for computing only one subpart of the resulting matrix C.

Now what's needed to get the result of that computation ?

Let's take processor 1 as an example, with a total of 4 processors. Then, in order to compute its submatrix of C, C(1,1), it needs A(1,1), B(1,1), A(1,2) and B(1,2):

* C(1,1) = A(1,1)B(1,1) + A(1,2)B(2,1)
* C(1,2) = A(1,1)B(1,2) + A(1,2)B(2,2)
* C(2,1) = A(2,1)B(1,1) + A(2,2)B(2,1)
* C(2,2) = A(2,1)B(1,2) + A(2,2)B(2,2)

In order to have all those pieces we are going to play the same game as in the previous algorithm. We are going to swap around the pieces of A and B so that every processor gets what it needs without having all the data at once.

This time let's imagine the processors in a 2x2 grid. On each iteration, each processor is going to give its part of B to the processor one way down and its part of A one way right. In the following drawing, A parts follow the the green arrows and B parts the red arrows.

![submatrix-flip]({{site.baseurl}}/assets/images/distributed-matrix/submatrix-flip.png)


text:
`nix-build` action
==================

This GitHub Action will run `nix-build`, using the latest
[nixos/nix docker image](https://github.com/NixOS/docker).

It will build one of, in order or preference:

 * `"$@"` if arguments are set
 * `nix-build release.nix` if release.nix exists
 * `nix-build default.nix` if default.nix exists

`/nix/store`
------------

Given that this executes in a single-use Docker container, the Nix store is not
persistent, and will be lost once the action is over.

The results from running `nix-build [release|default].nix` will be
automatically resolved from their symlinks and copied in place in a non-
recursive manner.

This means that `release.nix` is expected to not keep reference to the store.

Environment
-----------

### Channel

By default, it will use `nixos-unstable` as a channel. This is meant to
keep the action "always up to date" even on new NixOS releases.

To configure another channel, set `NIX_PATH` accordingly

```
action "samueldr/action-nix-build@master" {
  uses = "samueldr/action-nix-build@master"
  env = {
    NIX_PATH = "nixpkgs=channel:nixos-18.09"
  }
}
```

See the [Nix manual](https://nixos.org/nix/manual/) for more information about
`NIX_PATH`.

### Unfree

The easiest way to handle this is to use the environment variable that Nixpkgs
looks at.

```
action "samueldr/action-nix-build@master" {
  uses = "samueldr/action-nix-build@master"
  env = {
    NIXPKGS_ALLOW_UNFREE = "1"
  }
}
```

repository: samueldr/action-nix-build

repo_name: samueldr/action-nix-build


text:
# cudos-token

### Cudos Token Smart Contract

* Is ERC20 compliant
* Responsible for holding all tokens balances on the Cudos platform infrastructure
* The **CudosToken** has the following properties
  * Defines a token `name` - `CudosToken`
  * Defines a token `symbol` - `CUDOS`
  * Defines the number of `decimals` the token is divisible by - `18`
  * Defines the total supply of tokens - `10 billion` tokens are created upon contract creation
* The token has a `transfersEnabled` flag that can be called once and once only to enable transfers for all. Only whitelisted admin addresses can call this function.
* The token has a `whitelisted` addresses that can transfer tokens even if the `transfersEnabled` flag is set to false. Only whitelisted admin addresses can add other addresses to the whitelist.

## Local Installation & Testing

1. Install [Truffle](http://truffleframework.com), [Ganache](https://www.trufflesuite.com/ganache) and [NodeJs](https://nodejs.org/en/)(version 10.x upwards) globally
```bash
npm install -g truffle
```

2. Install dependencies.
```bash
npm install
```

3. Run tests.
```bash
npm run test
```

### Code Coverage

* Code coverage and instrumentation performed by [solidity-coverage](https://github.com/sc-forks/solidity-coverage)

* To run code coverage `npm run coverage` - this will produce the following:
  * Configuration found in `./solcover.js`
  * HTML output in `/coverage/index.html`
  * JSON output in `./.coverage.json`
  * Terminal output

repository: blockrockettech/cudos-token-contracts

repo_name: blockrockettech/cudos-token-contracts


text:
(This document describes an extension that front-ends aren't required to implement. In fact, no front-end is *known* to implement it; this document serves as an example of how to extend the protocol. Front-ends that don't implement this extension should reject attempts to set the `add-query-metric` configuration option.)

When the configuration option `add-query-metric` is set to a value other than `all`, if that value identifies a query metric known to the front-end, then the value for this metric will be appended to each query response. This option may be set several times; each one will (try to) add another query metric.

Setting this option to the value `all` will cause *all* metrics known to the front-end to be included.

## Commands

### Configuration mode

#### `add-query-metric METRIC` (two tokens)

Request that query responses also include the value of the query metric `METRIC`, if that's recognised by the front-end.

Responses:

* `epbprtv0 ok`

  The metric `METRIC` was recognised, and query responses will include a value for it.

* `epbprtv0 fail`

  The metric `METRIC` was not recognised; query responses will not include a value for it.

#### `add-query-metric all` (two tokens)

Request that query responses also include the values of all query metrics recognised by the front-end.

Responses:

* `epbprtv0 ok`

  Query responses will include the values of all metrics known to the front-end. (This may not actually change the output; the front-end could, in principle, support this extension but not recognise any query metrics.)

* `epbprtv0 fail`

  Front-ends may choose to emit this response if they do not recognise *any* query metrics, but they may also emit `epbprtv0 ok` in these circumstances (to indicate that all zero metrics will be included in the output).

### Query mode

#### `ENTRY N` (two tokens)

This extension changes the behaviour of one response:

* `epbprtv0 ok R [NAME0 VALUE0 ...]`

  `R` (greater than zero and less than or equal to `N`) close matches were found. Each of the next `R` lines, when tokenised, will consist of the token `epbprtv0` followed by a token specifying the index of a close match. (The first line should identify the *closest* close match, and the `R`-th should identify the furthest away.)

  If additional query metrics were specified and recognised during configuration mode, then their names and values will be provided as a number of pairs of tokens after `R`. For example, a response including the hypothetical `buckets_searched` and `candidates_checked` metrics might look like this:

  `epbprtv0 ok 10 buckets_searched 8 candidates_checked 507`

repository: milvus-io/ann-benchmarks

repo_name: milvus-io/ann-benchmarks


text:
https://plusbryan.com/my-first-5-minutes-on-a-server-or-essential-security-for-linux-servers

2013

2 accounts
- root
- deploy

# deploy
- sudo via long passwd
- devs log in with public key
admin = keep authorized_key up to date

# what
- passwd # root, long, not used
- apt update & upgrade
- apt install fail2ban # monitor logs, block auspicious activity
- user deploy
~~~
useradd deploy
mkdir -p /home/deploy/.ssh
chmod 700 /home/deploy/.ssh
~~~
- require public key
~~~
vi /home/deploy/.ssh/authorized_keys # add id_rsa.pub
chmod /home/deploy/.ssh/authorized_keys
chown deploy:deploy /home/deploy -R
~~~
- test user and enable sudo
~~~
passwd deploy # memorable passwd. used for sudo
visudo
# root ALL=(ALL) ALL
# deploy ALL=(ALL) ALL
~~~
- lock down ssh
~~~
vim /etc/ssh/sshd_config
# PermitRootLogin no
# PasswordAuthentication no
# AllowUsers deploy@(your-ip)
systemctl restart ssh
~~~
- enable auto security updates
- install logwatch
monitor logs and email them

repository: predoiua/infrastructure

repo_name: predoiua/infrastructure


text:
# MGEDateFormatter

**MGEDateFormatter** provides a set of extensions to NSDate and NSDateFormatter to build a nice API which simplify the conversion from NSDate to NSString and back.

Creating a `NSDateFormatter` is an expensive task. For this reason, **MGEDateFormatter** takes care of caching the created `NSDateFormatter` in order to reuse them along the lifecycle of your app.

The aim of this project is to have a nice API to get strings representations from `NSDate` instaces:

````swift
let stringWithStyles = date.string(withDateStyle: .MediumStyle, timeStyle: .NoStyle)
let stringWithTemplate = date.string(withTemplate: "MMMMyyyy")
let stringWithFormat = date.string(withFormat: "MM/yy")
let monthAndYearString = date.string(with: .monthAndYear)
````

Keep reading to know how!

> Check the preliminary **Swift 3** version [here](https://github.com/ManueGE/MGEDateFormatter/tree/feature/swift_3).

## Installation

Add the following to your `Podfile`:

````
pod 'MGEDateFormatter'
````

Then run `$ pod install`.

And finally, in the classes where you need **MGEDateFormatter**:

````
import MGEDateFormatter
````

If you don’t have CocoaPods installed or integrated into your project, you can learn how to do so [here](http://cocoapods.org).

## Usage

### NSDate to String

There are three main ways to convert a `NSDate` to a `String`.

##### Using NSDateFormatterStyle

````swift
let date = NSDate()
let string = date.string(withDateStyle: .ShortStyle, timeStyle: .ShortStyle)
````

if needed, you can provide a custom locale to perform the conversion:

````swift
let spanishLocale = NSLocale(localeIdentifier: "es")
let date = NSDate()
let string = date.string(withDateStyle: .MediumStyle, timeStyle: .NoStyle, locale: spanishLocale)
````

##### Using format from template
````swift
let date = NSDate()
let string = date.string(withTemplate: "MMMyyyy")
````

if needed, you can provide a custom locale to perform the conversion:

````swift
let spanishLocale = NSLocale(localeIdentifier: "es")
let date = NSDate()
let string = date.string(withTemplate: "MMMyyyy", locale: spanishLocale)
````

##### Using date format
````swift
let date = NSDate()
let string = date.string(withFormat: "MM/dd/yyyy HH:mm:ss")
````

if needed, you can provide a custom locale to perform the conversion:

````swift
let spanishLocale = NSLocale(localeIdentifier: "es")
let date = NSDate()
let string = date.string(withFormat: "MM/dd/yyyy HH:mm:ss", locale: spanishLocale)
````

### String to NSDate

In the same way, there are three ways to create a `NSDate` from a `String`. The thee of them are provided as `NSDate` initializers:

##### Using NSDateFormatterStyle

````swift
let string = "11/18/83, 11:30 AM"
let convertedDate = NSDate(string: string, dateStyle: .ShortStyle, timeStyle: .ShortStyle)
````
**Note**: The convertedDate is an `Optional<NSDate>`, and will be `nil` if the string couldn't be parsed

if needed, you can provide a custom locale to perform the conversion:

````swift
let spanishLocale = NSLocale(localeIdentifier: "es")
let string = "18/11/83 11:30"
let convertedDate = NSDate(string: string, dateStyle: .ShortStyle, timeStyle: .ShortStyle, locale: spanishLocale)
````

##### Using format from template
````swift
let string = "November 18, 1983, 11:30"
let convertedDate = NSDate(string: string, template: "ddMMMMyyyyHHmm")
````
**Note**: The convertedDate is an `Optional<NSDate>`, and will be `nil` if the string couldn't be parsed

if needed, you can provide a custom locale to perform the conversion:

````swift
let spanishLocale = NSLocale(localeIdentifier: "es")
let string = "noviembre 18, 1983, 11:30"
let convertedDate = NSDate(string: string, template: "ddMMMMyyyyHHmm", locale: spanishLocale)
````

##### Using date format
````swift
let string = "18/November/1983 11:30"
let convertedDate = NSDate(string: string, format: "dd/MMMM/yyyy HH:mm")
````
**Note**: The convertedDate is an `Optional<NSDate>`, and will be `nil` if the string couldn't be parsed

if needed, you can provide a custom locale to perform the conversion:

````swift
let spanishLocale = NSLocale(localeIdentifier: "es")
let string = "18/noviembre/1983 11:30"
let convertedDate = NSDate(string: string, format: "dd/MMMM/yyyy HH:mm", locale: spanishLocale)
````

### Best practices

In my own apps, I like to use **MGEDateFormatter** in this way:

##### 1- Create a `enum` with my date formatter templates and/or formats:

Usually I have just a set of few templates and/or formats to use. I wrap them into a couple of `enum`:

````swift
enum DateTemplate: String {
    case monthAndYear = "MMMyyyy"
    case fullShortDate = "ddMMyy"
}

enum DateFormat: String {
    case fullDate = "dd/MM/yyyy"
    case fullDateAndTime = "dd/MM/yyyy HH:mm:ss"
}
````

#### 2- Create a `NSDate` extension:

I create an extension that wraps the `MGEDateFormatter` methods to accept values of the defined `enum`:

````swift
extension NSDate {

    // MARK: Helpers Date -> String

    func string(with template: DateTemplate) -> String {
        return string(withTemplate: template.rawValue)
    }

    func string(with format: DateFormat) -> String {
        return string(withFormat: format.rawValue)
    }

    // MARK: Helpers String -> Date

    convenience init?(string: String, template: DateTemplate) {
        self.init(string: string, template: template.rawValue)
    }

    convenience init?(string: String, format: DateFormat) {
        self.init(string: string, format: format.rawValue)
    }
}
````

#### 3- Call the methods from the extension:

Now, we have a nice, swifty, simple API to convert dates to strings and back:

````swift
let date = NSDate()

// Templates
let monthAndYearString = date.string(with: .monthAndYear)
let fullShortDateString = date.string(with: .fullShortDate)

let dateFromMonthAndYear = NSDate(string: "11/1983", template: .monthAndYear)

// Formats
let fullDateString = date.string(with: .fullDate)
let fullDateAndTimeString = date.string(with: .fullDateAndTime)

let dateFromfullDateString = NSDate(string: "11/18/1983", format: .fullDate)
````

### Custom formatters

Aren't the three methods provided to format strings enough for you? Don't worry, you can still take advantage of **MGEDateFormatter**.

If you want to add further customization to your formatter, you can use the `DateFormatterProvider` protocol.

To conform this protocol you have to override a property (`cacheKey`) and a function (`configure(_: NSDateFormatter)`). Here you have an example:

````swift
class MyDateFormatterProvider: DateFormatterProvider {
    let cacheKey: String
    let format: String

    init(format: String) {
        self.format = format
        self.cacheKey = "MyConfigurator(\(format))"
    }

    func configure(formatter: NSDateFormatter) {
        formatter.dateFormat = format
        formatter.monthSymbols = ["JN", "FB", "MR", "AP", "MY", "JN", "JL", "AG", "SP", "OT", "NV", "DC"]
        // whatever configuration you need
    }
}

````

and then, later:

````swift
let myProvider = MyDateFormatterProvider(format: "dd MMMM yyyy")

// from date to string
let date = NSDate()
let myCustomFormatString = date.string(with: myProvider)

// from string to date
let string = "18 NV 1983"
let convertedDate = NSDate(string: string, provider: myProvider)

````
The `NSDateFormatter` used to serialize the `NSDate` or the `String` will be cached under the defined `cacheKey` and will be nicely reused if it is needed again. In other words, if in any other point of the app we create a new provider with the same format as this

````swift
let otherProvider = MyDateFormatterProvider(format: "dd MMMM yyyy")

// from date to string
let otherDate = NSDate()
let otherCustomFormatString = date.string(with: otherProvider)
````

the `NSDateFormatter` will be reused.

#### No cached formatters
If you don't mind about caching formatters, you simply can use the `NSDate` extension to convert `NSDate` from/to `String` using a `NSDateFormatter`:

````swift
let formatter = NSDateFormatter()
formatter.dateFormat = "MM/yyyy"

let string = NSDate().string(with: formatter)
let date = NSDate(string: "06/2016, formatter: formatter")
````

---

## Contact

[Manuel García-Estañ Martínez](http://github.com/ManueGE)
[@manueGE](https://twitter.com/ManueGE)

## License

MGEDateFormatter is available under the [MIT license](LICENSE.md).

repository: carabina/MGEDateFormatter

repo_name: carabina/MGEDateFormatter


text:
## \{{floor}}

> Returns the value rounded down to the nearest integer.

Parameters: `none`

Data:

```js
value = 5.6
```
Template:

```handlebars
\{{floor value}}
```
Renders to:

```
5
```

repository: jonschlinkert/markdown-links

repo_name: jonschlinkert/markdown-links


text:
# ShuffleMapStage

`ShuffleMapStage` (_shuffle map stage_ or simply _map stage_) is a [Stage](Stage.md).

`ShuffleMapStage` corresponds to (and is associated with) a [ShuffleDependency](#shuffleDep).

`ShuffleMapStage` can be [submitted independently](DAGScheduler.md#submitMapStage) but it is usually an intermediate step in a physical execution plan (with the final step being a [ResultStage](ResultStage.md)).

## Creating Instance

`ShuffleMapStage` takes the following to be created:

*  Stage ID
*  [RDD](../rdd/ShuffleDependency.md#rdd) (of the [ShuffleDependency](#shuffleDep))
*  Number of tasks
*  Parent [Stage](Stage.md)s
*  First Job ID (of the [ActiveJob](ActiveJob.md) that created it)
*  `CallSite`
*  [ShuffleDependency](../rdd/ShuffleDependency.md)
*  [MapOutputTrackerMaster](MapOutputTrackerMaster.md)
*  Resource Profile ID

`ShuffleMapStage` is created when:

* `DAGScheduler` is requested to [plan a ShuffleDependency for execution](DAGScheduler.md#createShuffleMapStage)

##  Missing Partitions

```scala
findMissingPartitions(): Seq[Int]
```

`findMissingPartitions` requests the [MapOutputTrackerMaster](#mapOutputTrackerMaster) for the [missing partitions](MapOutputTrackerMaster.md#findMissingPartitions) (of the [ShuffleDependency](#shuffleDep)) and returns them.

If not available (`MapOutputTrackerMaster` does not track the `ShuffleDependency`), `findMissingPartitions` simply assumes that all the [partitions](Stage.md#numPartitions) are missing.

`findMissingPartitions` is part of the [Stage](Stage.md#findMissingPartitions) abstraction.

## ShuffleMapStage Ready

When "executed", a `ShuffleMapStage` saves **map output files** (for reduce tasks).

When [all partitions have shuffle map outputs available](#isAvailable), `ShuffleMapStage` is considered **ready** (_done_ or _available_).

###  isAvailable

```scala
isAvailable: Boolean
```

`isAvailable` is `true` when the `ShuffleMapStage` is ready and all partitions have shuffle outputs (i.e. the [numAvailableOutputs](#numAvailableOutputs) is exactly the [numPartitions](Stage.md#numPartitions)).

`isAvailable` is used when:

* `DAGScheduler` is requested to [getMissingParentStages](DAGScheduler.md#getMissingParentStages), [handleMapStageSubmitted](DAGScheduler.md#handleMapStageSubmitted), [submitMissingTasks](DAGScheduler.md#submitMissingTasks), [processShuffleMapStageCompletion](DAGScheduler.md#processShuffleMapStageCompletion), [markMapStageJobsAsFinished](DAGScheduler.md#markMapStageJobsAsFinished) and [stageDependsOn](DAGScheduler.md#stageDependsOn)

###  Available Outputs

```scala
numAvailableOutputs: Int
```

`numAvailableOutputs` requests the [MapOutputTrackerMaster](#mapOutputTrackerMaster) to [getNumAvailableOutputs](MapOutputTrackerMaster.md#getNumAvailableOutputs) (for the [shuffleId](../rdd/ShuffleDependency.md#shuffleId) of the [ShuffleDependency](#shuffleDep)).

`numAvailableOutputs` is used when:

* `DAGScheduler` is requested to [submitMissingTasks](DAGScheduler.md#submitMissingTasks)
* `ShuffleMapStage` is requested to [isAvailable](#isAvailable)

##  Active Jobs

`ShuffleMapStage` defines `_mapStageJobs` internal registry of [ActiveJob](ActiveJob.md)s to track jobs that were submitted to execute the stage independently.

A new job is registered (_added_) in [addActiveJob](#addActiveJob).

An active job is deregistered (_removed_) in [removeActiveJob](#removeActiveJob).

###  addActiveJob

```scala
addActiveJob(
  job: ActiveJob): Unit
```

`addActiveJob` adds the given [ActiveJob](ActiveJob.md) to (the front of) the [_mapStageJobs](#_mapStageJobs) list.

`addActiveJob` is used when:

* `DAGScheduler` is requested to [handleMapStageSubmitted](DAGScheduler.md#handleMapStageSubmitted)

###  removeActiveJob

```scala
removeActiveJob(
  job: ActiveJob): Unit
```

`removeActiveJob` removes the [ActiveJob](ActiveJob.md) from the [_mapStageJobs](#_mapStageJobs) registry.

`removeActiveJob` is used when:

* `DAGScheduler` is requested to [cleanupStateForJobAndIndependentStages](DAGScheduler.md#cleanupStateForJobAndIndependentStages)

###  mapStageJobs

```scala
mapStageJobs: Seq[ActiveJob]
```

`mapStageJobs` returns the [_mapStageJobs](#_mapStageJobs) list.

`mapStageJobs` is used when:

* `DAGScheduler` is requested to [markMapStageJobsAsFinished](DAGScheduler.md#markMapStageJobsAsFinished)

## Demo: ShuffleMapStage Sharing

A `ShuffleMapStage` can be shared across multiple jobs (if these jobs reuse the same RDDs).

![Skipped Stages are already-computed ShuffleMapStages](../images/scheduler/dagscheduler-webui-skipped-stages.png)

```scala
val keyValuePairs = sc.parallelize(0 to 5).map((_, 1))
val rdd = keyValuePairs.sortByKey()  // (1)

scala> println(rdd.toDebugString)
(6) ShuffledRDD[4] at sortByKey at <console>:39 []
 +-(16) MapPartitionsRDD[1] at map at <console>:39 []
    |   ParallelCollectionRDD[0] at parallelize at <console>:39 []

rdd.count  // (2)
rdd.count  // (3)
```

1. Shuffle at `sortByKey()`
1. Submits a job with two stages (and two to be executed)
1. Intentionally repeat the last action that submits a new job with two stages with one being shared as already-computed

## Map Output Files

`ShuffleMapStage` writes out **map output files** (for a shuffle).

repository: japila-books/apache-spark-internals

repo_name: japila-books/apache-spark-internals


text:
All setup scripts that run on a node.  These scripts are referenced as ePoxy
actions in an epoxy setup script in http://github.com/m-lab/epoxy-images ,
specifically [`stage3post.json`](https://github.com/m-lab/epoxy-images/blob/dev/actions/stage3_coreos/stage3post.json).

The script sets up the `kubelet` daemon to run correctly, gets a log-in token
from the epoxy master, and then calls `kubeadm join` with the token for the
cluster master node.  Once the node has joined the cluster, all node
configuration can (and probably should) be done through kubernetes.

It is my hope that we can figure out a way to make `setup_k8s.sh` eventually be
only the last three lines, and that a better `/etc` can become easily shipped as
part of the epoxy-served image.


text:
# SketchBeamer

HTML editor with live preview. It features dynamic loading of angular components.

### What does it mean?

It means that you can create declare your Angular modules as inputs of SketchBeamer and build HTML pages with your Angular components inside, without the need to setup a development environment!

### Why would I need it?

If you're building a library with Angular, with SketchBeamer you can deploy a web app to let people play with your library.
For example, if your library is a ui kit, it would let people without a technical background (as designers) to build quick prototypes with only a browser.

### May I take a quick look?
There is a running demo [here](https://acarrara.github.io/sketch-beamer/).
The demo web app depends on a `CardModule` containing a `sb-card` component that you can add to the HTML source.

## Installation

Run `npm run serve` for a development server. Navigate to `http://localhost:4200/`. The app will automatically reload if you change any of the source files.

## Usage

In your angular app, add the `sb-sketch` component.

```html
...
<sb-sketch [modules]="myModules"></sb-sketch>
...
```
 Declare your modules as inputs:
 ```javascript
 ...
   modules = [
    CardModule
  ];
  ...
 ```
You can use the emmet notation when editing the HTML source.

## Credits

Inspired by [this article](https://blog.angularindepth.com/here-is-what-you-need-to-know-about-dynamic-components-in-angular-ac1e96167f9e). Many thanks to the author for sharing his experience.

## Similar projects

- [ng-dynamic](https://www.npmjs.com/package/ng-dynamic) - Lets you inject html at runtime and mount known Angular components.

## License

**MIT License**

Copyright (c) 2017 Alessandro Carrara

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

 IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

repository: acarrara/sketch-beamer

repo_name: acarrara/sketch-beamer