text:
<file_sep>// @flow

// STATUS REQUEST
export const REQUEST = 'counter/REQUEST'
export const SUCCESS = 'counter/SUCCESS'
export const FAILURE = 'counter/FAILURE'

// CRUD
export const INIT = 'counter/INIT'
export const INCREMENT_REQUESTED = 'counter/INCREMENT_REQUESTED'
export const INCREMENT = 'counter/INCREMENT'
export const DECREMENT_REQUESTED = 'counter/DECREMENT_REQUESTED'
export const DECREMENT = 'counter/DECREMENT'
<file_sep>import { configure, addDecorator, setAddon } from '@storybook/react'
import infoAddon from '@storybook/addon-info'
import { withOptions } from '@storybook/addon-options'
import moment from 'moment'

addDecorator((story) => {
  moment.locale('en')
  return story()
})

withOptions({
  name: 'REACT-APP',
  url: 'https://github.com/micro-company/react-app',
})

function loadStories() {
  // auth
  require('../stories/AuthForm')

  // error page
  require('../stories/ErrorPage')
  // You can require as many stories as you need.
}

setAddon(infoAddon)

configure(loadStories, module)
<file_sep>import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import { withStyles } from '@material-ui/core/styles'
import Button from '@material-ui/core/Button'
import { oauthRequest } from '../../../../actions/session'

const styles = theme => ({
  box: {
    display: 'grid',
    gridTemplateColumns: '1fr 1fr',
    padding: theme.spacing.unit,
  },
  button: {
    margin: theme.spacing.unit,
  },
})

class OAuth extends PureComponent { // eslint-disable-line
  static propTypes = {
    classes: PropTypes.object.isRequired,

    oauthRequestActions: PropTypes.func.isRequired,
  }

  constructor() {
    super()

    this.onClickOauth = this.onClickOauth.bind(this)
  }

  onClickOauth(type) {
    this.props.oauthRequestActions(type)
      .then(response => window.open(response.url, '_blank'))
  }

  render() {
    const { classes } = this.props

    return (

        <Button
          color="secondary"
          variant="outlined"
          className={classes.button}
          onClick={() => this.onClickOauth('google')}
        >
          Google
        </Button>

        <Button
          color="secondary"
          variant="outlined"
          className={classes.button}
          onClick={() => this.onClickOauth('github')}
        >
          Github
        </Button>

    )
  }
}

function mapStateToProps() {
  return {}
}

function mapDispatchToProps(dispatch) {
  return {
    oauthRequestActions: bindActionCreators(oauthRequest, dispatch),
  }
}

export default connect(
  mapStateToProps,
  mapDispatchToProps,
)(withStyles(styles)(OAuth))
<file_sep>import * as SESSION from '../constants/session'
import * as EVENT from '../constants/event'
import { history } from '../store/configureStore'

function checkStatus(response, dispatch) {
  if (response.status >= 200 && response.status < 300) {
    return response.json()
  }

  if (response.status === 401) {
    dispatch({
      type: SESSION.LOGOUT,
      payload: response,
    })

    history.push('/auth')
    throw response.json()
  }

  throw response.json()
}

function formError(error) {
  if (error && typeof error.then === 'function') {
    return error.then(response => { throw response })
  }

  throw { error: { _error: ['Problem with connect to server'] } } // eslint-disable-line
}

export function login(data) {
  return dispatch => fetch(`${process.env.REACT_APP_API_URL}/auth`, {
    method: 'POST',
    headers: {
      Accept: 'application/json',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify(data),
  })
    .then(response => checkStatus(response, dispatch))
    .then(response => {
      dispatch({
        type: SESSION.LOGIN,
        payload: response,
      })

      history.push('/')
    })
    .catch(error => formError(error))
}

export function registration(data) {
  return dispatch => fetch(`${process.env.REACT_APP_API_URL}/auth/new`, {
    method: 'POST',
    headers: {
      Accept: 'application/json',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify(data),
  })
    .then(response => checkStatus(response, dispatch))
    .then(() => {
      dispatch({
        type: EVENT.ADD,
        payload: {
          message: 'Success registration. Need log in.',
          created_at: new Date(),
        },
      })
    })
    .catch(error => formError(error))
}

export function logout() {
  return (dispatch, getState) => fetch(`${process.env.REACT_APP_API_URL}/auth`, {
    method: 'DELETE',
    headers: {
      Accept: 'application/json',
      'Content-Type': 'application/json',
      Authorization: getState().session.tokens.access,
    },
  })
    .then(response => checkStatus(response, dispatch))
    .then(() => dispatch({
      type: SESSION.LOGOUT,
      payload: null,
    }))
    .catch(error => {
      dispatch({
        type: SESSION.LOGOUT,
        payload: null,
      })

      formError(error)
    })
}

export function recovery(data) {
  return dispatch => fetch(`${process.env.REACT_APP_API_URL}/auth/recovery`, {
    method: 'POST',
    headers: {
      Accept: 'application/json',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify(data),
  })
    .then(response => checkStatus(response, dispatch))
    .catch(error => formError(error))
}

export function recoveryPassword(data) {
  return dispatch => fetch(`${process.env.REACT_APP_API_URL}/auth/recovery/${data.recoveryToken}`, {
    method: 'POST',
    headers: {
      Accept: 'application/json',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify(data),
  })
    .then(response => checkStatus(response, dispatch))
    .catch(error => formError(error))
}

export function refresh(tokenRefresh) {
  return dispatch => {
    dispatch({
      type: SESSION.REQUEST_REFRESH_TOKEN,
      payload: true,
    })

    return fetch(`${process.env.REACT_APP_API_URL}/auth/refresh`, {
      method: 'POST',
      headers: {
        Accept: 'application/json',
        'Content-Type': 'application/json',
        Authorization: tokenRefresh,
      },
    })
      .then(response => checkStatus(response, dispatch))
      .then(response => {
        dispatch({
          type: SESSION.REQUEST_REFRESH_TOKEN,
          payload: false,
        })

        dispatch({
          type: SESSION.LOGIN,
          payload: response,
        })
      })
      .catch(error => {
        dispatch({
          type: SESSION.REQUEST_REFRESH_TOKEN,
          payload: false,
        })

        formError(error)
      })
  }
}

export function oauthRequest(type) {
  return dispatch => fetch(`${process.env.REACT_APP_API_URL}/oauth/${type}`, {
    method: 'GET',
    headers: {
      Accept: 'application/json',
      'Content-Type': 'application/json',
    },
  })
    .then(response => checkStatus(response, dispatch))
    .then(response => response)
    .catch(error => {
      dispatch({
        type: SESSION.REQUEST_REFRESH_TOKEN,
        payload: false,
      })

      formError(error)
    })
}

export function oauthGetProtectedResources({ name, code }) {
  return dispatch => fetch(`${process.env.REACT_APP_API_URL}/oauth/callback/${name}`, {
    method: 'POST',
    headers: {
      Accept: 'application/json',
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({ code }),
  })
    .then(response => checkStatus(response, dispatch))
    .then(response => response)
    .catch(error => {
      dispatch({
        type: SESSION.REQUEST_REFRESH_TOKEN,
        payload: false,
      })

      formError(error)
    })
}

export function oauthLogin(data) {
  return dispatch => dispatch({
    type: SESSION.LOGIN,
    payload: data,
  })
}
<file_sep>import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import { Switch, Route } from 'react-router-dom'
import Helmet from 'react-helmet'
import { withRouter } from 'react-router'
import { connect } from 'react-redux'
import { MuiThemeProvider, createMuiTheme } from '@material-ui/core/styles'
import Authenticated from '../../containers/Authenticated'
import Main from '../Main'
import Auth from '../Auth'
import AuthCallback from '../AuthCallback'

import Forbidden from '../403'
import NotFound from '../404'
import InternalServerError from '../500'

const theme = createMuiTheme({
  typography: {
    useNextVariants: true,
  },
})

class App extends PureComponent {
  static propTypes = {
    router: PropTypes.object.isRequired,
  }

  render() {
    return ([
      <Helmet
        key="helmet"
        titleTemplate="Hello - %s"
      />,

      <MuiThemeProvider key="main" theme={theme}>
        <Switch key="switch" {...this.props.router}>
          <Route
            path="/recovery/:recoveryToken"
            component={Auth}
          />
          <Route
            path="/auth/:type/:name"
            component={AuthCallback}
          />
          <Route
            path="/auth"
            component={Auth}
          />
          <Route
            path="/403"
            component={Forbidden}
          />
          <Route
            path="/404"
            component={NotFound}
          />
          <Route
            path="/500"
            component={InternalServerError}
          />
          <Authenticated>

          </Authenticated>
        </Switch>
      </MuiThemeProvider>,
    ])
  }
}

function mapStateToProps(state) {
  return {
    router: state.router,
  }
}

function mapDispatchToProps() {
  return {}
}

export default withRouter(connect(
  mapStateToProps,
  mapDispatchToProps,
)(App))
<file_sep>import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import { withStyles } from '@material-ui/core/styles'
import { bindActionCreators } from 'redux'
import { withRouter } from 'react-router'
import { connect } from 'react-redux'
import IconButton from '@material-ui/core/IconButton'
import SnackbarContent from '@material-ui/core/Snackbar'
import DeleteIcon from '@material-ui/icons/Delete'
import { remove, check } from '../../actions/event'

const styles = theme => ({
  root: {
    marginTop: theme.spacing.unit * 3,
    position: 'absolute',
    bottom: 0,
    zIndex: 9999,
  },
  snackbar: {
    margin: theme.spacing.unit,
  },
})

class Notify extends PureComponent {
  static propTypes = {
    event: PropTypes.object.isRequired,
    classes: PropTypes.object.isRequired,

    removeEventAction: PropTypes.func.isRequired,
    checkEventAction: PropTypes.func.isRequired,
  }

  componentWillMount() {
    this.props.checkEventAction()
  }

  render() {
    const { event, classes } = this.props

    return (

        {
          event.event.map((item, indexEvent) => (
            <SnackbarContent
              key={`${indexEvent}-${item.message}`} // eslint-disable-line
              className={classes.snackbar}
              message={item.message}
              action={(
                <IconButton
                  color="secondary"
                  onClick={() => this.props.removeEventAction(indexEvent)}
                >
                  <DeleteIcon />
                </IconButton>
              )}
            />
          ))
        }

    )
  }
}

function mapStateToProps(state) {
  return {
    router: state.router,
    event: state.event,
  }
}

function mapDispatchToProps(dispatch) {
  return {
    removeEventAction: bindActionCreators(remove, dispatch),
    checkEventAction: bindActionCreators(check, dispatch),
  }
}

export default withStyles(styles)(withRouter(connect(
  mapStateToProps,
  mapDispatchToProps,
)(Notify)))
<file_sep># Front-End

### Run

```
helm --kube-context minikube install \
  --name react-app     \
  --namespace=micro-company \
  --set CI_PROJECT_NAME="react-app" \
  .
```

### Stop

```
helm del --purge react-app
```
<file_sep>// @flow

// CRUD
export const ADD = 'event/ADD'
export const REMOVE = 'event/REMOVE'
export const CHECK = 'event/CHECK'
<file_sep>import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import { Helmet } from 'react-helmet'
import Button from '@material-ui/core/Button'

import * as COUNTER from '../../actions/counter'

class Home extends PureComponent {
  static propTypes = {
    count: PropTypes.number.isRequired,
    initActions: PropTypes.func.isRequired,
    isIncrementing: PropTypes.bool.isRequired,
    isDecrementing: PropTypes.bool.isRequired,

    incrementActions: PropTypes.func.isRequired,
    incrementAsyncActions: PropTypes.func.isRequired,
    decrementActions: PropTypes.func.isRequired,
    decrementAsyncActions: PropTypes.func.isRequired,
  }

  componentDidMount() {
    this.props.initActions()
  }

  render() {
    return [
      <Helmet key="home" title="Home" />,

          Home

          Count:
          {this.props.count}

          <Button
            variant="contained"
            color="primary"
            disabled={this.props.isIncrementing}

            onClick={this.props.incrementActions}
          >
            Increment
          </Button>

          <Button
            variant="contained"
            color="primary"
            disabled={this.props.isIncrementing}

            onClick={this.props.incrementAsyncActions}
          >
            Increment Async
          </Button>

          <Button
            variant="contained"
            color="secondary"
            disabled={this.props.isDecrementing}

            onClick={this.props.decrementActions}
          >
            Decrementing
          </Button>

          <Button
            variant="contained"
            color="secondary"
            disabled={this.props.isDecrementing}

            onClick={this.props.decrementAsyncActions}
          >
            Decrement Async
          </Button>

,
    ]
  }
}

function mapStateToProps(state) {
  return {
    count: state.counter.count,
    isIncrementing: state.counter.isIncrementing,
    isDecrementing: state.counter.isDecrementing,
  }
}

function mapDispatchToProps(dispatch) {
  return {
    initActions: bindActionCreators(COUNTER.init, dispatch),
    incrementActions: bindActionCreators(COUNTER.increment, dispatch),
    incrementAsyncActions: bindActionCreators(COUNTER.incrementAsync, dispatch),
    decrementActions: bindActionCreators(COUNTER.decrement, dispatch),
    decrementAsyncActions: bindActionCreators(COUNTER.decrementAsync, dispatch),
  }
}

export default connect(
  mapStateToProps,
  mapDispatchToProps,
)(Home)
<file_sep>import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import { withStyles } from '@material-ui/core/styles'
import classnames from 'classnames'
import IconComponents from './iconComponent'

const styles = () => ({
  Icon: {
    position: 'relative',
    fill: 'currentColor',
    color: 'currentColor',
  },
})

class Icon extends PureComponent {
  static propTypes = {
    name: PropTypes.string.isRequired,
    style: PropTypes.object,
    onClick: PropTypes.func,
    className: PropTypes.string,
  }

  static defaultProps = {
    style: {},
    onClick: () => {},
    className: undefined,
  }

  render() {
    return (

        {IconComponents[this.props.name]}

    )
  }
}

export default withStyles(styles)(Icon)
<file_sep>export function objectListToArrayList(list) {
  return Object.keys(list).map(item => list[item])
}

export function arrayListToObjectArray(list) {
  const newList = {}
  list.forEach(item => { newList[item.id] = item })
  return newList
}
<file_sep>import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import { withRouter } from 'react-router'
import { Route, Redirect } from 'react-router-dom'

class Authenticated extends PureComponent {
  static propTypes = {
    isAuthenticated: PropTypes.bool.isRequired,
    children: PropTypes.node.isRequired,
    location: PropTypes.object.isRequired,
  }

  render() {
    const { isAuthenticated } = this.props

    return (
      <Route
        path="*"
        render={() => (
          isAuthenticated ? this.props.children : (
            <Redirect
              to={{
                pathname: '/auth',
                state: { from: this.props.location },
              }}
            />
          ))}
      />
    )
  }
}

function mapStateToProps(state) {
  return {
    isAuthenticated: state.session.isAuthenticated,
  }
}

function mapDispatchToProps() {
  return {}
}

export default withRouter(connect(
  mapStateToProps,
  mapDispatchToProps,
)(Authenticated))
<file_sep>## Bug Report

**What did you do?**
A clear and concise description of the steps you took (or insert a code snippet).

**What did you expect to see?**
A clear and concise description of what you expected to happen (or insert a code snippet).

**What did you see instead? Under which circumstances?**
A clear and concise description of what you expected to happen (or insert a code snippet).
<file_sep>import _ from 'lodash'
import isFuture from 'date-fns/is_future'
import * as SESSION from '../../constants/session'
import { refresh } from '../../actions/session'
import { history } from '../../store/configureStore'

export default store => next => action => {
  // only worry about expiring token for async actions
  const isAuthPage = !window.location.pathname.includes('auth')

  if (action.type && isAuthPage) {
    const time = _.get(store.getState(), 'session.user.exp', false)
    const timeForRefresh = process.env.REACT_REFRESH_TIME || 180
    const expTime = new Date((time - timeForRefresh) * 1000)
    const isExp = isFuture(expTime)
    const isAuthenticated = _.get(store.getState(), 'session.isAuthenticated')

    if (!isExp && isAuthenticated) {
      const tokenRefresh = _.get(store.getState(), 'session.tokens.refresh', false)
      const isRequestRefreshToken = _.get(store.getState(), 'session.request.refreshToken', false)

      // make sure we are not already refreshing the token
      if (!isRequestRefreshToken && action.type && action.type !== SESSION.REQUEST_REFRESH_TOKEN) {
        store.dispatch(refresh(tokenRefresh))
          .then(() => next(action))
          .catch(error => {
            history.push('/auth')
            console.warn('ERROR', error)
          })
      }
    }
  }

  return next(action)
}
<file_sep>## Front-End

[![License](https://img.shields.io/npm/l/sequelize.svg?maxAge=2592000?style=plastic)](https://github.com/micro-company/react-app/blob/master/LICENSE)

An example of demonstration work with a micro-service architecture

![UserPage](./docs/UserPage.png)

### Getting start (only front-end)

1. Create `.env` file with ENV variables
2. Install dependencies `npm i`
3. Run application `npm start`

### Kubernetes

##### Requirements

1. [Docker](https://docs.docker.com/install/)
1. [Minikube](https://kubernetes.io/docs/tasks/tools/install-minikube/)
1. [Helm](https://docs.helm.sh/using_helm/#installing-helm)

```
# Add repo to Helm
helm repo add batazor https://batazor.github.io/charts/

# Update repo charts
helm repo update

# Install project
helm install batazor/react-app
```

#### Enviroment variables

| **NAME**                           | **VALUE**             |
| ---------------------------------- | --------------------- |
| REACT_APP_API_URL                  | http://localhost:4070 |
| REACT_APP_GOOGLE_RECAPTCHA_SITEKEY | secretKey             |
| **Auth**                           | -                     |
| REACT_REFRESH_TIME                 | 180 (seconds)         |
| **For CI**                         | -                     |
| GITHUB_USER                        | -                     |
| GITHUB_PASSWORD                    | -                     |

#### CI FLOW

![ci-flow](./docs/ci-flow.png)
<file_sep>extends: airbnb
rules:
  no-underscore-dangle: 0
  semi: ["error", "never"]
  arrow-parens: ["error", "as-needed"]
  max-len: ["error", { "code": 120, "ignoreTrailingComments": true, "ignoreUrls": true, "ignoreStrings": true, "ignoreComments": true }]
  no-console: ["error", { allow: ["warn", "error", "group", "groupEnd"] }]
  react/jsx-filename-extension: 0
  import/no-cycle: 0
  react/sort-comp: 0
  react/forbid-prop-types: 0
  react/destructuring-assignment: 0
  react/jsx-one-expression-per-line: 0
  import/no-extraneous-dependencies: 0
env:
  node: true
  browser: true
  es6: true
  jest: true
parser: babel-eslint
parserOptions:
  sourceType: 'module'
  ecmaFeatures:
    jsx: true
    modules: true
    destructuring: true
    classes: true
    forOf: true
    blockBindings: true
    arrowFunctions: true
plugins:
- react
<file_sep>import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import { bindActionCreators } from 'redux'
import { connect } from 'react-redux'
import classNames from 'classnames'
import { withStyles } from '@material-ui/core/styles'
import { withRouter } from 'react-router'
import { NavLink } from 'react-router-dom'
import SwipeableDrawer from '@material-ui/core/SwipeableDrawer'
import List from '@material-ui/core/List'
import ListItem from '@material-ui/core/ListItem'
import ListItemIcon from '@material-ui/core/ListItemIcon'
import ListItemText from '@material-ui/core/ListItemText'
import Avatar from '@material-ui/core/Avatar'
import Button from '@material-ui/core/Button'
import ExitIcon from '@material-ui/icons/ExitToApp'
import PersonIcon from '@material-ui/icons/Person'
import HomeIcon from '@material-ui/icons/Home'
import { logout } from '../../actions/session'

const drawerWidth = 240

const styles = theme => ({
  drawerPaper: {
    display: 'grid',
    overflowX: 'hidden',
    height: '100%',
    width: drawerWidth,
    transition: theme.transitions.create('width', {
      easing: theme.transitions.easing.sharp,
      duration: theme.transitions.duration.enteringScreen,
    }),
  },
  drawerPaperClose: {
    width: 60,
    overflowX: 'hidden',
    transition: theme.transitions.create('width', {
      easing: theme.transitions.easing.sharp,
      duration: theme.transitions.duration.leavingScreen,
    }),
  },
  drawerInner: {
    display: 'grid',
    flexDirection: 'column',
    gridTemplateRows: '1fr auto',
  },
  typeContainer: {
    height: '100%',
  },
  user: {
    flex: 0,
    paddingLeft: 0,
    backgroundColor: theme.palette.background.default,
  },
  userItem: {
    paddingLeft: 10,
    justifyContent: 'space-between',
  },
  activeLink: {
    '&>li': {
      background: theme.palette.primary[100],
    },
  },
})

class MainMenu extends PureComponent {
  static propTypes = {
    openDrawer: PropTypes.bool.isRequired,
    classes: PropTypes.object.isRequired,

    logoutAction: PropTypes.func.isRequired,
    onChangeDrawer: PropTypes.func.isRequired,
  }

  render() {
    const { classes } = this.props

    return (
      <SwipeableDrawer
        type="permanent"
        classes={{
          paper: classNames(classes.drawerPaper, !this.props.openDrawer && classes.drawerPaperClose),
        }}
        open={this.props.openDrawer}
        onOpen={() => this.props.onChangeDrawer(true)}
        onClose={() => this.props.onChangeDrawer(false)}
      >

          <List>
            <NavLink to="/" exact activeClassName={classes.activeLink}>
              <ListItem button>
                <ListItemIcon>
                  <HomeIcon />
                </ListItemIcon>

                <ListItemText primary="Home" />
              </ListItem>
            </NavLink>

            <NavLink to="/users" exact activeClassName={classes.activeLink}>
              <ListItem button>
                <ListItemIcon>
                  <PersonIcon />
                </ListItemIcon>

                <ListItemText primary="Users" />
              </ListItem>
            </NavLink>
          </List>

          <List className={classes.user}>
            <ListItem className={classes.userItem}>
              <ListItemIcon>
                <Avatar alt="Remy Sharp">
                  <PersonIcon />
                </Avatar>
              </ListItemIcon>

              <Button
                variant="contained"
                color="secondary"
                onClick={this.props.logoutAction}
              >
                Logout
                <ExitIcon />
              </Button>
            </ListItem>
          </List>

      </SwipeableDrawer>
    )
  }
}

function mapStateToProps() {
  return {}
}

function mapDispatchToProps(dispatch) {
  return {
    logoutAction: bindActionCreators(logout, dispatch),
  }
}

export default withRouter(connect(
  mapStateToProps,
  mapDispatchToProps,
)(withStyles(styles)(MainMenu)))
<file_sep>import * as COUNTER from '../constants/counter'

const initialState = {
  count: 0,
  isIncrementing: false,
  isDecrementing: false,
}

export default (state = initialState, action) => {
  switch (action.type) {
    case COUNTER.INIT:
      return {
        ...state,
        isIncrementing: false,
        isDecrementing: false,
      }
    case COUNTER.INCREMENT_REQUESTED:
      return {
        ...state,
        isIncrementing: true,
      }

    case COUNTER.INCREMENT:
      return {
        ...state,
        count: state.count + 1,
        isIncrementing: !state.isIncrementing,
      }

    case COUNTER.DECREMENT_REQUESTED:
      return {
        ...state,
        isDecrementing: true,
      }

    case COUNTER.DECREMENT:
      return {
        ...state,
        count: state.count - 1,
        isDecrementing: !state.isDecrementing,
      }

    default:
      return state
  }
}
<file_sep>FROM node:18-alpine as builder

# Configuration
ARG REACT_APP_API_URL
ENV REACT_APP_API_URL ${REACT_APP_API_URL:-http://localhost:4070}

ARG REACT_APP_GOOGLE_RECAPTCHA_SITEKEY
ENV REACT_APP_GOOGLE_RECAPTCHA_SITEKEY ${REACT_APP_GOOGLE_RECAPTCHA_SITEKEY:-secretKey}

ARG REACT_REFRESH_TIME
ENV REACT_REFRESH_TIME ${REACT_REFRESH_TIME:-180}

# Build project
WORKDIR /src
COPY ./ ./
RUN npm i --ignore-scripts
RUN npm run build

FROM nginx:1.25.1-alpine
WORKDIR /usr/share/nginx/html
COPY --from=builder /src/build ./
<file_sep>import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'

class Form extends PureComponent {
  static propTypes = {
    onSubmit: PropTypes.func.isRequired,
  }

  render() {
    const { onSubmit } = this.props

    return (
      <form onSubmit={onSubmit} />
    )
  }
}

export default Form
<file_sep>import * as EVENT from '../constants/event'

const initialState = {
  loaded: false,
  event: [],
}

export default function update(state: Object = initialState, action: Object): Object {
  switch (action.type) {
    case EVENT.CHECK: {
      return {
        ...state,
        event: state.event.filter(item => new Date(item.timeout) > new Date()),
      }
    }
    case EVENT.ADD: {
      return {
        ...state,
        event: [
          ...state.event,
          action.payload,
        ],
      }
    }
    case EVENT.REMOVE: {
      return {
        ...state,
        event: [
          ...state.event.slice(0, action.payload),
          ...state.event.slice(action.payload + 1),
        ],
      }
    }
    default:
      return state
  }
}
<file_sep>import React, { PureComponent } from 'react'
import PropTypes from 'prop-types'
import { withStyles } from '@material-ui/core/styles'
import Form from 'react-final-form-generator'
import Card from '@material-ui/core/Card'
import CardContent from '@material-ui/core/CardContent'
import Tab from '@material-ui/core/Tab'
import Tabs from '@material-ui/core/Tabs'
import AppBar from '@material-ui/core/AppBar'
import Icon from '../../../../components/Icon'
import getForm from './getForm'

const styles = () => ({
  Card: {
    alignItems: 'center',
    marginTop: '4em !important',
    justifyContent: 'flex-start !important',
    display: 'flex',
    flexDirection: 'column',
  },
  Icon: {
    fontSize: '15em',
  },
  form: {
    margin: '1em',
  },
  root: {
    width: '70%',
    maxWidth: '30em',
  },
  recaptcha: {
    margin: '1em 0',
    display: 'flex',
    justifyContent: 'center',
  },
})

class Auth extends PureComponent {
  static propTypes = {
    classes: PropTypes.object.isRequired,
    mode: PropTypes.string.isRequired,

    onSubmit: PropTypes.func.isRequired,
    onChangeMode: PropTypes.func.isRequired,
  }

  static getDerivedStateFromProps(nextProps) {
    let iconName = 'login'

    switch (nextProps.mode) {
      case 'recovery':
      case 'recoveryPassword':
        iconName = 'forgotPassword'
        break
      default:
        iconName = 'login'
    }

    return {
      iconName,
    }
  }

  constructor() {
    super()

    this.state = {
      iconName: 'login',
    }

    this.onChange = this.onChange.bind(this)
  }

  onChange = (form, e) => {
    console.warn('onChange', form, e)
  }

  render() {
    const {
      mode, onChangeMode, onSubmit, classes,
    } = this.props

    return (
      <Card className={classes.Card} elevation={0}>
        <Icon name={this.state.iconName} className={classes.Icon} />

        <CardContent className={classes.root}>
          <AppBar position="static">
            <Tabs
              value={mode}
              onChange={onChangeMode}
              variant="fullWidth"
            >
              <Tab label="LOG IN" value="logIn" />
              <Tab label="SIGN ON" value="signOn" />
              <Tab label="RECOVERY" value="recovery" />
            </Tabs>
          </AppBar>

          <Form
            id="AuthFormId"
            className={classes.form}
            fields={getForm({ mode, classes })}

            onChange={this.onChange}
            onSubmit={onSubmit}
          />
        </CardContent>
      </Card>
    )
  }
}

export default withStyles(styles)(Auth)
<file_sep>import React, { Fragment, PureComponent } from 'react'
import PropTypes from 'prop-types'
import { bindActionCreators } from 'redux'
import ui from 'redux-ui'
import { withStyles } from '@material-ui/core/styles'
import { connect } from 'react-redux'
import { Helmet } from 'react-helmet'
import ReactTable from 'react-table'
import IconButton from '@material-ui/core/IconButton'
import Tooltip from '@material-ui/core/Tooltip'
import EditIcon from '@material-ui/icons/Edit'
import DeleteIcon from '@material-ui/icons/Delete'
import {
  list, add, update, remove,
} from '../../actions/users'
import { objectListToArrayList } from '../../utils/structure'
import AddUserDialog from './UI/AddUserDialog'
import UpdateUserDialog from './UI/UpdateUserDialog'
import DeleteUserDialog from './UI/DeleteUserDialog'
import HeaderUserList from './UI/HeaderUserList'

const styles = theme => ({
  box: {
    display: 'grid',
    gridTemplateColumns: '1fr auto auto',
    alignItems: 'center',
  },
  button: {
    margin: theme.spacing.unit,
  },
})

class User extends PureComponent {
  static propTypes = {
    classes: PropTypes.object.isRequired,
    user: PropTypes.object.isRequired,
    ui: PropTypes.object.isRequired,

    updateUI: PropTypes.func.isRequired,
    listActions: PropTypes.func.isRequired,
    addActions: PropTypes.func.isRequired,
    updateActions: PropTypes.func.isRequired,
    removeActions: PropTypes.func.isRequired,
  }

  constructor(props) {
    super(props)

    this.state = {
      loading: false,
      users: objectListToArrayList(props.user.users),
      currentUser: {},
    }

    this.renderCell = this.renderCell.bind(this)
    this.onSendForm = this.onSendForm.bind(this)
    this.onAddSubmitForm = this.onAddSubmitForm.bind(this)
    this.onUpdateSubmitForm = this.onUpdateSubmitForm.bind(this)
    this.onChangeAddUserDialog = this.onChangeAddUserDialog.bind(this)
    this.onChangeUpdateUserDialog = this.onChangeUpdateUserDialog.bind(this)
    this.onChangeDeleteUserDialog = this.onChangeDeleteUserDialog.bind(this)
    this.onConfirmDeleteUser = this.onConfirmDeleteUser.bind(this)
  }

  componentWillMount() {
    const { loaded, users } = this.props.user

    if (!loaded && Object.keys(users) === 0) {
      this.props.listActions()
    }
  }

  componentWillReceiveProps(props) {
    this.setState({ users: objectListToArrayList(props.user.users) })
  }

  onChangeAddUserDialog() {
    this.setState({ loading: false })
    this.props.updateUI({ addUserDialog: !this.props.ui.addUserDialog })
  }

  onChangeUpdateUserDialog(data) {
    this.setState({
      currentUser: { ...data, password: <PASSWORD> },
      loading: false,
    })
    this.props.updateUI({ updateUserDialog: !this.props.ui.updateUserDialog })
  }

  onChangeDeleteUserDialog(data) {
    this.setState({
      currentUser: { ...data, password: <PASSWORD> },
      loading: false,
    })
    this.props.updateUI({ deleteUserDialog: !this.props.ui.deleteUserDialog })
  }

  onSendForm = () => {
    this.setState({ loading: true })

    document
      .getElementById('UserFormId')
      .dispatchEvent(new Event('submit', { cancelable: true }))
  }

  onAddSubmitForm(data) {
    return this.props.addActions(data)
      .then(this.onChangeAddUserDialog)
      .catch(error => { // eslint-disable-line no-unused-vars
        this.setState({ loading: false })
        // throw new SubmissionError(error.error)
      })
  }

  onUpdateSubmitForm(data) {
    return this.props.updateActions(data)
      .then(this.onChangeUpdateUserDialog)
      .catch(error => { // eslint-disable-line no-unused-vars
        this.setState({ loading: false })
        // throw new SubmissionError(error.error)
      })
  }

  onConfirmDeleteUser(data) {
    return this.props.removeActions(data)
      .then(this.onChangeDeleteUserDialog)
      .catch(error => { // eslint-disable-line no-unused-vars
        this.setState({ loading: false })
        // throw new SubmissionError(error.error)
      })
  }

  renderCell(row) {
    return (

        {row.value}

        <Tooltip placement="bottom" title="Edit user">
          <IconButton
            color="primary"
            aria-label="edit"
            onClick={() => this.onChangeUpdateUserDialog(row.original)}
          >
            <EditIcon />
          </IconButton>
        </Tooltip>

        <Tooltip placement="bottom" title="Delete user">
          <IconButton
            color="secondary"
            aria-label="delete"
            onClick={() => this.onChangeDeleteUserDialog(row.original)}
          >
            <DeleteIcon />
          </IconButton>
        </Tooltip>

    )
  }

  render() {
    return (
      <Fragment>
        <Helmet title="User" />

        <AddUserDialog
          ui={this.props.ui}
          loading={this.state.loading}

          onAddSubmitForm={this.onAddSubmitForm}
          onChangeAddUserDialog={this.onChangeAddUserDialog}
          onSendForm={this.onSendForm}
        />

        <UpdateUserDialog
          ui={this.props.ui}
          loading={this.state.loading}
          currentUser={this.state.currentUser}

          onChangeUpdateUserDialog={this.onChangeUpdateUserDialog}
          onUpdateSubmitForm={this.onUpdateSubmitForm}
          onSendForm={this.onSendForm}
        />

        <DeleteUserDialog
          ui={this.props.ui}
          loading={this.state.loading}
          currentUser={this.state.currentUser}

          onSendForm={this.onSendForm}
          onConfirmDeleteUser={this.onConfirmDeleteUser}
          onChangeDeleteUserDialog={this.onChangeDeleteUserDialog}
        />

        <HeaderUserList
          listActions={this.props.listActions}
          onChangeAddUserDialog={this.onChangeAddUserDialog}
        />

        <ReactTable
          data={this.state.users}
          columns={[
            {
              Header: 'Email',
              accessor: 'email',
              Cell: this.renderCell,
            },
          ]}
          defaultPageSize={10}
        />
      </Fragment>
    )
  }
}

function mapStateToProps(state) {
  return {
    user: state.user,
  }
}

function mapDispatchToProps(dispatch) {
  return {
    listActions: bindActionCreators(list, dispatch),
    addActions: bindActionCreators(add, dispatch),
    updateActions: bindActionCreators(update, dispatch),
    removeActions: bindActionCreators(remove, dispatch),
  }
}

export default ui({
  state: {
    addUserDialog: false,
    updateUserDialog: false,
    deleteUserDialog: false,
  },
})(connect(
  mapStateToProps,
  mapDispatchToProps,
)(withStyles(styles)(User)))
<file_sep>apiVersion: apps/v1beta2
kind: Deployment
metadata:
  name: {{ .Values.CI_PROJECT_NAME }}
  labels:
    app: {{ .Values.CI_PROJECT_NAME }}
    chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
    heritage: "{{ .Release.Service }}"
    release: "{{ .Release.Name }}"
    pipeline_id: "{{ .Values.CI_PIPELINE_ID }}"
    build_id: "{{ .Values.CI_BUILD_ID }}"
    commit_sha: "{{ .Values.CI_COMMIT_SHA }}"
    component: react-app
spec:
  replicas: 1
  revisionHistoryLimit: 2
  selector:
    matchLabels:
      app: {{ .Values.CI_PROJECT_NAME }}
      component: react-app
  template:
    metadata:
      annotations:
      {{- range $key, $value := .Values.annotations }}
        {{ $key }}: {{ $value }}
      {{- end }}
      labels:
        app: {{ .Values.CI_PROJECT_NAME }}
        chart: "{{ .Chart.Name }}-{{ .Chart.Version }}"
        pipeline_id: "{{ .Values.CI_PIPELINE_ID }}"
        build_id: "{{ .Values.CI_BUILD_ID }}"
        component: react-app
    spec:
      dnsConfig:
        options:
          - name: ndots
            value: "1"
      containers:
      - name: {{ .Values.CI_PROJECT_NAME }}
        image: {{ .Values.image.repository }}:{{ .Values.image.tag }}
        imagePullPolicy: Always
        enableServiceLinks: false
        ports:
        - name: web
          containerPort: 3000
        livenessProbe:
          httpGet:
            path: /
            port: 3000
          initialDelaySeconds: 5
          timeoutSeconds: 15
        readinessProbe:
          httpGet:
            path: /
            port: 3000
          initialDelaySeconds: 5
          timeoutSeconds: 3
        resources:
{{ toYaml .Values.resources | indent 12 }}
    {{- if .Values.nodeSelector }}
      nodeSelector:
{{ toYaml .Values.nodeSelector | indent 8 }}
    {{- end }}
<file_sep>## Question

**What did you do?**
A clear and concise description of the steps you took (or insert a code snippet).

**What did you expect to see?**
A clear and concise description of what you expected to happen (or insert a code snippet).

**What did you see instead? Under which circumstances?**
A clear and concise description of what you expected to happen (or insert a code snippet).
<file_sep>// @flow

// STATUS REQUEST
export const REQUEST = 'session/REQUEST'
export const SUCCESS = 'session/SUCCESS'
export const FAILURE = 'session/FAILURE'

// CRUD
export const LOGIN = 'session/LOGIN'
export const LOGOUT = 'session/LOGOUT'

// TOKEN
export const REQUEST_REFRESH_TOKEN = 'session/REQUEST_REFRESH_TOKEN'
<file_sep>import React from 'react'
import ReactDOM from 'react-dom'
import { Provider } from 'react-redux'
import { ConnectedRouter } from 'connected-react-router'
import { PersistGate } from 'redux-persist/es/integration/react'
import 'react-table/react-table.css'
import store, { history, persistor } from './store/configureStore'
import App from './pages/App'
import Loading from './components/Loading'

ReactDOM.render(
  (
    <Provider store={store}>
      <PersistGate
        loading={<Loading />}
        persistor={persistor}
      >
        <ConnectedRouter history={history}>
          <App />
        </ConnectedRouter>
      </PersistGate>
    </Provider>
  ), document.getElementById('root'),
)
<file_sep>import jwt from 'jsonwebtoken'
import * as SESSION from '../constants/session'

const initialState = {
  isAuthenticated: false,
  tokens: {
    access: null,
    refresh: null,
  },
  request: {
    refreshToken: false,
  },
}

export default function update(state: Object = initialState, action: Object): Object {
  switch (action.type) {
    case SESSION.LOGIN: {
      return {
        ...state,
        ...action.payload,
        user: jwt.decode(action.payload.tokens.access),
        isAuthenticated: true,
      }
    }
    case SESSION.LOGOUT: {
      return initialState
    }
    case SESSION.REQUEST_REFRESH_TOKEN: {
      return {
        ...state,
        request: {
          ...state.request,
          refreshToken: action.payload,
        },
      }
    }
    default:
      return state
  }
}
<file_sep>

languages: Dockerfile Markdown JavaScript YAML

repo_language: Dockerfile

repo_name: micro-company/react-app


text:
<file_sep># Fitness Log

![Badge](https://img.shields.io/github/last-commit/JoannaTanveer/Fitness-log?style=plastic) ![Badge](https://img.shields.io/github/repo-size/JoannaTanveer/Fitness-log?style=plastic)

![image relative path](screenshot_fitness.png)

As an avid fitness buff, I want to be able to view, create and track daily workouts. I want to be able to log multiple exercises in a workout on a given day. I should also be able to track the name, type, weight, sets, reps, and duration of exercise. If the exercise is a cardio exercise, I should be able to track my distance traveled. This app does all that!

## Table of Contents

- [Technologies](#technologies)
- [Installation](#installation)
- [Usage](#usage)
- [Credits](#credits)
- [License](#license)
- [Questions](#questions)

### Technologies

The technologies utilized in this application are as follows: MongoDB (database), Mongoose, and Heroku .
- MongoDB is used because this database works as persistent storage of your workouts.![link](https://img.shields.io/npm/v/mongoDB database?style=plastic?logo=npm)
- Mongoose is an ORM/ODM that works alongside MongoDB to translate the MongoDB code and objects in JS.
- Heroku was used to deploy the website.

### Installation

This application is deployed to Heroku [link](https://calm-journey-26270.herokuapp.com/)

### Usage

The purpose of this program is to solve the problem of keeping track of your work out while at the gym on an application that goes with you and harnessess the power of the internet.

### Credits

The Dev community prides itself in the open source culture that it celebrates and maintains. This application couldn't have been made possible without the help of
- <NAME> for his undefined. [<NAME>](https://www.linkedin.com/in/anthony-zachry-3464b551/)
- <NAME> for his undefined. [<NAME>](https://www.linkedin.com/in/zarlengo/)

#### Thank You!

### License
Licensed under the MIT license. ![link](https://img.shields.io/github/license/JoannaTanveer/Fitness-Log?style=plastic)

### Questions
All questions and comments are welcome! Please contact me at <EMAIL>	 or visit my [Github Profile](https://github.com/JoannaTanveer).

branch_name: refs/heads/master

repo_language: Markdown

repo_name: JoannaTanveer/Fitness-Log


text:
<file_sep>{% extends 'base.html' %}

{% block css_extra %}
  {% endblock %}

{% block contenido %}

Carga de Archivos

 {{mensaje_formulario}}

       <form action="" id="upload_form" method="post" enctype="multipart/form-data">{% csrf_token %}
           {% csrf_token %}

                          Archivo:
                            {{form.docfile}} {% csrf_token %}

                          Tipo Archivo:

                            {{form.tipo_archivo}} {% csrf_token %}

        <button class= "submit" type="submit" value="Submit">CARGAR ARCHIVO</button>
    </form>

{% endblock %}

{% block submenu%}

Oficina Virtual:

Cargar Archivos

Estados Archivos

{% endblock%}

<file_sep>{% extends 'base.html' %}

{% block css_extra %}
  {% endblock %}

{% block contenido %}

Adhesión Factura por Mail

 Muchas gracias por adherirse a nuestro servicio de Factura por Mail.

 Nuestro sistema ya registro su pedido. De ahora en más, usted recibirá la factura de Esperanza Servicios SAPEM a la siguiente dirección:  {{usuario.email}}  {% csrf_token %}

{% endblock %}

{% block submenu%}

{% endblock%}

<file_sep>django=1.6.1
bokeh
panda

reportlab

django-crontab # este no funciono
pip install django-crontab==0.6.0   -----> si tenes una version de django menor a 1.8

django_cron

languages: Text HTML

repo_language: Text

repo_name: pandretich/proygas


text:
<repo_name>yii2extension/yii2-qr<file_sep>/src/helpers/QrHelper.php
<?php

namespace yii2extension\qr\helpers;

use yii\helpers\ArrayHelper;
use chillerlan\QRCode\{QRCode, QROptions};
use yii2rails\extension\yii\helpers\FileHelper;

class QrHelper
{

    public static function encodeToFile($data, $file, $options = []) {
        $options['outputType'] = FileHelper::fileExt($file);
        $binaryData = QrHelper::encode($data, $options);
        FileHelper::save($file, $binaryData);
    }

    public static function encode($data, $options) {
        $qrcode = self::getInstance($options);
        $binaryData = $qrcode->render($data);
        return $binaryData;
    }

    public static function prepareOptoins($options) {
        $defaultOptions = [
            'version'    => QRCode::VERSION_AUTO,
            'eccLevel'   => QRCode::ECC_L,
            'addQuietzone' => false,
            'imageTransparent' => false,
            //'outputType' => QRCode::OUTPUT_MARKUP_SVG,
            'imageBase64' => false,
        ];
        return ArrayHelper::merge($defaultOptions, $options);
    }

    public static function getInstance($options) {
        $options = self::prepareOptoins($options);
        $optionsObject = new QROptions($options);
        $qrcode = new QRCode($optionsObject);
        return $qrcode;
    }

}

repo_language: PHP


text:
<file_sep># open files in a folder

import csv as csv
import numpy as np
import os

#open up a csc file in to a python object

for filename in os.listdir('./HKEX/HKEX_2010'):
	csv_file_object = csv.reader(open('./HKEX/HKEX_2010/' + filename, 'rb'))

	data = []
	for row in csv_file_object:
		data.append(row)
	data = np.array(data)

print data[-1]

repo_language: Python


text:
<repo_name>paul-butcher/twant<file_sep>/build.xml
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="Twant" basedir="." default="unit-test">

    <property name="src.dir" value="."/>
    <property name="testclasses.dir" value="testclasses"/>
    <property name="classes.dir" value="classes"/>
    <property name="reports.dir" value="reports"/>
	<property name="version.num" value="1.00"/>
	<buildnumber file="build.num"/>
	<tstamp>
	   <format property="start.timestamp" pattern="dd-MMM-yyyy HH:mm:ss" />
	</tstamp>

    <target name="clean" description="Delete all generated files">
		<echo>Cleaning...</echo>
    	<delete dir="${classes.dir}" failonerror="false"/>
    	<delete dir="${testclasses.dir}" failonerror="false"/>
    	<delete dir="${reports.dir}" failonerror="false"/>
        <delete file="${ant.project.name}.jar"/>
    </target>

	<target name="compile" description="Compiles Twant" >
		<echo>Compiling...</echo>
        <mkdir dir="${classes.dir}"/>
        <javac srcdir="${src.dir}" destdir="${classes.dir}" excludes="**/test*.java" classpath="ext/commons-codec-1.3.jar">

        </javac>
    </target>

	<target name="compile-test" depends="jar">
		<echo>Compiling Tests...</echo>
        <mkdir dir="${testclasses.dir}"/>
        <javac srcdir="${src.dir}" destdir="${testclasses.dir}" classpath="${classes.dir}" includes="**/test*.java" />
    </target>

	<target name="unit-test" depends="compile-test">
		<echo>Running Unit tests...</echo>
        <mkdir dir="${reports.dir}"/>
	    <junit  printsummary="yes" showoutput="yes" failureproperty="test.failed">
			<classpath>
				<pathelement path="${ant.project.name}.jar" />
				<pathelement path="${testclasses.dir}"/>
			</classpath>
			<batchtest fork="yes" todir="${reports.dir}/">
				<formatter type="xml"/>
				<fileset dir="${src.dir}">
				<include name="**/test*.java"/>
				</fileset>
			</batchtest>
	    </junit>
		<antcall target="broadcast-failure" />
		<fail if="test.failed">Unit tests failed</fail>
	</target>

	<target name="broadcast-failure" if="test.failed">
		<taskdef name="tweet" classname="twant.Tweet" classpath="${ant.project.name}.jar"/>
		<tweet credentialsfile="twitterlogin" message="build '${version.num}-b${build.number}' of ${ant.project.name} initiated by ${user.name} at ${start.timestamp} failed unit tests" />
    </target>

    <target name="jar" description="JARs Twant" depends="compile">
		<echo message="Jarring: ${version.num}-b${build.number}" />
		<delete file="MANIFEST.MF"/>
		<manifest file="MANIFEST.MF">
			<attribute name="Implementation-Version" value="${version.num}-b${build.number}"/>
		</manifest>
        <jar destfile="${ant.project.name}.jar" basedir="${classes.dir}" manifest="MANIFEST.MF" />
    </target>

    <target name="broadcast-result" description="tweets about it" depends="unit-test">
    	<taskdef name="tweet" classname="twant.Tweet" classpath="${ant.project.name}.jar"/>
		<tweet credentialsfile="twitterlogin" message="build: '${version.num}-b${build.number}' of ${ant.project.name} initiated by ${user.name} at ${start.timestamp} was successful" />
	</target>

</project>

repo_language: Ant Build System

repo_name: paul-butcher/twant


text:
<repo_name>AnsaganK/SeleniumParser<file_sep>/constants.py
CHROME_PATH = None
IS_LINUX = False<file_sep>/playfire.py
alphabet = ['а', 'б', 'в', 'г', 'д', 'е', 'ж', 'з', 'и', 'к', 'л', 'м', 'н', 'о', 'п', 'р', 'с', 'т', 'у', 'ф', 'х', 'ц', 'ч', 'ш', 'щ', 'ъ/ь', 'ы', 'э', 'ю', 'я',]
print(len(alphabet))
key = input('Key = ')
key = key.lower()
key_list = []
for i in key:
    if i == 'ъ' or i == 'ь':
        i = 'ъ/ь'
    if not (i in key_list):
        key_list.append(i)
        print(i)
        alphabet.remove(i)
print(key_list)
text = input('Text = ')
for i in range(5):
    print()
    for j in range(6):
        index = (i*6)+(j+1)
        if len(key_list) >= index:
            if key_list[index-1] == 'ъ/ь':
                letter = key_list[index-1]
            else:
                letter = f' {key_list[index-1]} '
        else:

            number_letter = index - len(key_list)
            letter = alphabet[number_letter-1]
            if letter != 'ъ/ь':
                letter = f' {letter} '
        print(letter, end='    ')
<file_sep>/requirements.txt
beautifulsoup4==4.10.0
bs4==0.0.1
selenium==3.141.0
soupsieve==2.2.1
urllib3==1.26.6

<file_sep>/main.py
from pip._vendor import requests
from selenium import webdriver
import csv
import time
from bs4 import BeautifulSoup as BS
from constants import CHROME_PATH, IS_LINUX
from datetime import datetime
import re
from selenium.webdriver.chrome.options import Options

from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC

INDEX = 0
FILE_NAME = 'hotels.csv'  # Назавние файла для сохранения
# QUERY = 'lawn care New york'  # Запрос в поиске
QUERY = 'Отели в москве'  # Запрос в поиске
URL = f'https://www.google.com/search?q={QUERY}&newwindow=1&tbm=lcl&sxsrf=AOaemvJF91rSXoO-Kt8Dcs2gkt9_JXLlCQ%3A1632305149583&ei=_f9KYayPI-KExc8PlcaGqA4&oq={QUERY}&gs_l=psy-ab.3...5515.12119.0.12483.14.14.0.0.0.0.0.0..0.0....0...1c.1.64.psy-ab..14.0.0....0.zLZdDbmH5so#rlfi=hd:;'
PAGE = 100  # Количество страниц для парсинга

KEY = '<KEY>'
CID_API_URL = 'https://maps.googleapis.com/maps/api/place/details/json?cid={0}&key='+KEY
CID_URL = 'https://maps.google.com/?cid={0}'

display = None

if IS_LINUX:
    from pyvirtualdisplay import Display
    display = Display(visible=False, size=(800, 600))
    display.start()

def startFireFox(url=URL):
    driver = webdriver.Firefox()
    driver.get(url)
    return driver

def startChrome(url=URL, path=None):
    chrome_options = Options()
    chrome_options.add_argument("--headless")
    chrome_options.add_argument("--no-sandbox")
    chrome_options.add_argument("--disable-gpu")
    chrome_options.add_argument("--disable-software-rasterizer")
    if path:
        driver = webdriver.Chrome(executable_path=path, options=chrome_options)
    else:
        driver = webdriver.Chrome(options=chrome_options)
    driver.get(url)
    return driver

def is_find_object(parent_object, class_name):
    try:
        object = parent_object.find_element_by_class_name(class_name)
    except:
        print(class_name)
        object = ''
    return object

def get_site(url):
    r = requests.get(url)
    if r.status_code == 200:
        return r.text
    return None

def get_soup(html):
    if html:
        return BS(html)
    return html

def get_attractions(driver):
    attractions_list = []
    try:
        attractions = is_find_object(driver, 'xtu1r-K9a4Re-ibnC6b-haAclf')
        attractions = attractions.find_elements_by_class_name('NovK6')
        for attraction in attractions:
            pattern = r'(?<=image:url\(//)(.+?)(?=\))'
            attraction_img = attraction.get_attribute('innerHTML')
            attraction_img_url = re.search(pattern, attraction_img)
            attraction_text = attraction.get_attribute('innerText')
            attractions_list.append({'url': attraction_img_url.group(), 'text': attraction_text})
    except:
        pass
    print(attractions_list)
    return attractions_list

def get_photos(driver):
    try:
        photo_buttons = driver.find_elements_by_class_name('a4izxd-tUdTXb-xJzy8c-haAclf-UDotu')
        photo_buttons[0].click()
        wait = WebDriverWait(driver, 10)
        wait.until(EC.presence_of_element_located((By.CLASS_NAME, 'mWq4Rd-HiaYvf-CNusmb-gevUs')))
        photos = driver.find_elements_by_class_name('mWq4Rd-HiaYvf-CNusmb-gevUs')[:3]
        print(len(photos))
        time.sleep(3)
        for i in photos:
            print(i)
            print(i.get_attribute('innerHTML'))
            photo = i.find_element_by_class_name('mWq4Rd-HiaYvf-CNusmb-gevUs').get_attribute('innerHTML')
            pattern = r'(?<=image:url\(")(.+?)(?="\))'
            photo_url = re.search(pattern, photo)
            print(photo_url.group())
    except Exception as e:
        print(e.__class__.__name__)
        pass

def get_place_information(driver):
    try:
        place_information = is_find_object(driver, 'uxOu9-sTGRBb-UmHwN')
        print(place_information.get_attribute('innerText'))
        return place_information.get_attribute('innerText')
    except:
        return None

def get_location_information(driver):
    try:
        location_name = is_find_object(driver, 'exOO9c-V1ur5d')
        location_rating = is_find_object(driver, 'v10Rgb-v88uof-haAclf')
        location_text = is_find_object(driver, 'XgnsRd-HSrbLb-h3fvze-text')
        print(location_name.get_attribute('innerText'))
        print(location_rating.get_attribute('innerText'))
        print(location_text.get_attribute('innerText'))
    except:
        print('Район не взял')

def get_base_photo(driver):
    try:
        photo = is_find_object(driver, 'F8J9Nb-LfntMc-header-HiaYvf-LfntMc')
        button = photo.find_element_by_tag_name('img')
        src = button.get_attribute('src')
        if len(src.split('=')) == 2:
            print('Ссылка на главное фото: ', src.split('=')[0])
        else:
            print('Ссылка на главное фото: ', src)
    except Exception as e:
        print(e.__class__.__name__)
        return None

def get_reviews(driver):
    try:
        review_button = driver.find_element_by_class_name('Yr7JMd-pane-hSRGPd')
        review_button.click()
        wait = WebDriverWait(driver, 10)
        wait.until(EC.presence_of_all_elements_located((By.CLASS_NAME, 'ODSEW-ShBeI')))
        reviews = driver.find_elements_by_class_name('ODSEW-ShBeI')
        print(len(reviews))
        for review in reviews:
            author_name = review.find_element_by_class_name('ODSEW-ShBeI-title').get_attribute('innerText')
            stars = review.find_element_by_class_name('ODSEW-ShBeI-RGxYjb-wcwwM').get_attribute('innerText')
            text = ''
            print(author_name, stars)
    except Exception as e:
        print(e.__class__.__name__)
        return None

def place_detail(cid):
    global startTime
    url = CID_URL.format(cid)
    # driver = startFireFox(url=url)
    driver = startChrome(url=url)
    try:
        endTime = datetime.now()
        time = endTime - startTime
        title = is_find_object(driver, 'x3AX1-LfntMc-header-title-title').text
        # address = is_find_object(driver, 'rogA2c').text
        print(' --------- Главное фото: ')
        base_photo = get_base_photo(driver)
        print(' --------- Информация о месте: ')
        place_information = get_place_information(driver)
        print(' --------- Достопримечательности: ')
        attractions = get_attractions(driver)                     # class Attraction - manyToMany
        print(' --------- Информация о месте: ')
        location_information = get_location_information(driver)     # class LocationInfo, class Location - ForeignKey
        # photos = get_photos(driver)                                 # class PlacePhoto
        print(' --------- Отзывы: ')
        reviews = get_reviews(driver)
        print(title, )
        print(time)
        print('Закрыто')
        print('----------------')
        driver.close()
    except Exception as e:
        print(e.__class__.__name__)
        print('Ошибка')
        driver.close()

def place_api_detail(cid):
    url = CID_API_URL.format(cid)
    r = requests.get(url)
    if r.status_code == 200:
        print(r.json())
        if r.json()['status'] == 'OK':
            result = r.json()['result']
            print(result['place_id'], result['formatted_address'])
        else:
            print(r.json()['status'])
    return None

# Функция которая парсит отели на странице
def parse_places(driver):
    global INDEX
    time.sleep(3)
    places = driver.find_elements_by_class_name('uMdZh')
    print(len(places))
    for place in places:
        title = place.find_element_by_class_name('dbg0pd').text if place.find_element_by_class_name('dbg0pd') else None
        cid = place.find_element_by_class_name('C8TUKc').get_attribute('data-cid') if place.find_element_by_class_name('C8TUKc') else None
        INDEX += 1
        print(INDEX, 'https://www.google.com/maps?cid='+cid)
        place_detail(cid) if cid else None

# Функция для смены страниц

def get_pagination(driver, page):
    pagination = driver.find_element_by_class_name('AaVjTc')
    available_pages = pagination.find_elements_by_tag_name('td')
    for i in available_pages:
        if str(page) == i.text and page != 1:
            i.click()
            # После клика нужно ждать
            # чтобы не ставить на долгое время, использовал цикл, который при
            # изменении текущей страницы на следующую запустить парсинг страницы
            for j in range(20):
                try:
                    pagination = driver.find_element_by_class_name('AaVjTc')
                    current_page = pagination.find_element_by_class_name('YyVfkd')
                    if current_page.text == str(page):
                        return True
                except:
                    pass
                time.sleep(1)
            time.sleep(1)
            break
    return False

# Запуск скрипта
def main():
    #driver = startChrome()
    driver = startChrome(path=CHROME_PATH)
    # driver = startFireFox()
    try:
        for page in range(1, PAGE+1):
            # Проверяю сколько доступных страниц для клика, и если следующая страница есть в пагинации то происходит клик
            if page == 1:
                print(f'СТРАНИЦА {page} начата')
                parse_places(driver)
                print(f'{page} страница готова')
                print('-----------------------------------')
            elif get_pagination(driver, page):
                print(f'СТРАНИЦА {page} начата')
                parse_places(driver)
                print(f'{page} страница готова')
                print('-----------------------------------')
        print('Парсинг завершен')
        driver.close()
    except Exception as e:
        print(e.__class__.__name__)
        if display:
            display.stop()
        print('Критическая ошибка')
        driver.close()

if __name__ == '__main__':
    startTime = datetime.now()
    main()

languages: Text Python

repo_name: AnsaganK/SeleniumParser


text:
<repo_name>Anshor29/tugas_21_javascript<file_sep>/README.md
# tugas_21_javascript
Tugas Niomic


text:
<file_sep>git add blindStatsAlarm.atsuo
git add blindStatsAlarm.atsln
git add blindStatsAlarm/*
git add statsAlarm/*
git add gitAddFiles.bat
git status<file_sep>/*
 * blindStatsAlarm.c
 *
 * Created: 11.04.2017 14:59:38
 *  Author: mira
 */

#include <avr/io.h>
#include <stdio.h>
#include <avr/interrupt.h>
#include <util/atomic.h>

#define  ckdiv8

#define alarmSecs   180
//#define alarmSecs   20

int8_t  tickCnt;
int32_t  secsCnt;

int8_t alarmOn;

void initBuzzerTimer()
{
	TCCR0A = (1 << COM0B1) | (1 << WGM00) | (1<< WGM01);
	TCCR0B = (1 << WGM02);
	OCR0A =  200;
	OCR0B =  100;    // should together give a squarewave of 5k
	TCNT0 = 0;
	PORTB &= ~(1 << PB1);   // initial value 0
	DDRB |= (1 << DDB1);    // set as ouput
}

void startBuzzerTimer()
{
#ifdef ckdiv8
	TCCR0B |=  (1<< CS00) ;   // prescaler = 1
#else
	TCCR0B |=  (1<< CS01) ;    //  prescaler = 8
#endif
}

void stopBuzzerTimer()
{
	TCCR0B &= ~((1<< CS00) | (1<< CS01) | (1 << CS02));
}

void toggleBuzzerAlarm()
{
	if (alarmOn == 0) {
		initBuzzerTimer();
		startBuzzerTimer();
		alarmOn = 1;
	} else {
		stopBuzzerTimer();
		alarmOn = 0;
	}

}

ISR(TIMER1_COMPA_vect)
{
	++ tickCnt;
	if (tickCnt > 1) {
		tickCnt = 0;
		++ secsCnt;
		if (secsCnt > alarmSecs)  {
			toggleBuzzerAlarm();
		}
	}
}

void initHW()
{
	cli();

	// start Timer 1

	tickCnt = 0;
	secsCnt = 0;
	alarmOn = 0;
	TCCR1 = (1 << CTC1);
	OCR1A = 0xF4;  // counter top value means approx   2 per sec
	GTCCR = 0x00;
	TIMSK  = 1 << OCIE1A;  //  interrupt needed
	TCNT1 = 0x00 ;

#ifdef ckdiv8
	TCCR1 |=  (1 << CS12) | (1 << CS13) ;      //   2048 prescaler... about 488 Hz at 8Mhz CLK
#else
	TCCR1 |=  (1 << CS10) |  (1 << CS11) | (1 << CS12) | (1 << CS13) ;      //   16384 prescaler... about 488 Hz at 8Mhz CLK
#endif
	sei();
}

#include <avr/io.h>

int main(void)
{
	initHW();
    while(1)
    {
        //TODO:: Please write your application code
    }
}

languages: C Batchfile

repo_language: C

repo_name: ipupiara/blindStatsAlarm


text:
<repo_name>iliketorock/Mantl<file_sep>/Mantl/Diary.m
//
//  Diary.m
//  Mantl
//
//  Created by <NAME> on 21/05/14.
//  Copyright (c) 2014 <NAME> 2. All rights reserved.
//

#import "Diary.h"

@implementation Diary

@end
<file_sep>/Mantl/Plaats.h
//
//  Plaats.h
//  Mantl
//
//  Created by <NAME> on 22/05/14.
//  Copyright (c) 2014 <NAME>ep 2. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface Plaats : NSObject

@property (nonatomic, strong) NSString *titel;
@property (nonatomic, strong) NSString *adres;
@property (nonatomic, strong) NSString *afbeelding;
@property (nonatomic, strong) NSString *soort;

//Voorzieningen
@property (nonatomic, strong) NSString *wc;
@property (nonatomic, strong) NSString *parking;
@property (nonatomic, strong) NSString *rolstoel;
@property (nonatomic, strong) NSString *eten;
@property (nonatomic, strong) NSString *drinken;

//Ratings
@property (nonatomic, strong) NSString *ster1;
@property (nonatomic, strong) NSString *ster2;
@property (nonatomic, strong) NSString *ster3;
@property (nonatomic, strong) NSString *ster4;
@property (nonatomic, strong) NSString *ster5;

@end
<file_sep>/Mantl/CreateAccountViewController.h
//
//  CreateAccountViewController.h
//  Mantl
//
//  Created by <NAME> on 20/05/14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface CreateAccountViewController : UIViewController
@property (weak, nonatomic) IBOutlet UITextField *txtEmail;
@property (weak, nonatomic) IBOutlet UITextField *txtWachtwoord;
@property (weak, nonatomic) IBOutlet UITextField *txtWachtwoord2;
- (IBAction)backgroundClick:(id)sender;

- (IBAction)Registreer:(id)sender;
@end
<file_sep>/Mantl/CreateAccountViewController.m
//
//  CreateAccountViewController.m
//  Mantl
//
//  Created by <NAME> on 20/05/14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

#import "CreateAccountViewController.h"
#import "SBJson.h"

@interface CreateAccountViewController ()

@end

@implementation CreateAccountViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (IBAction)backgroundClick:(id)sender {
    [_txtEmail resignFirstResponder];
    [_txtWachtwoord resignFirstResponder];
    [_txtWachtwoord2 resignFirstResponder];

}

- (IBAction)Registreer:(id)sender {
    @try {

        if([[_txtEmail text] isEqualToString:@""] || [[_txtWachtwoord text] isEqualToString:@""] || [[_txtWachtwoord2 text] isEqualToString:@""]) {
            [self alertStatus:@"Please fill in all field" :@"Register Failed!"];
        } else {
            NSString *post =[[NSString alloc] initWithFormat:@"email=%@&paswoord=%@&paswoord2=%@",[_txtEmail text],[_txtWachtwoord text],[_txtWachtwoord2 text]];
            NSLog(@"PostData: %@",post);

            NSURL *url=[NSURL URLWithString:@"http://gandibleux.eu/PHP/jsoncreate.php"];

            NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES];

            NSString *postLength = [NSString stringWithFormat:@"%d", [postData length]];

            NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
            [request setURL:url];
            [request setHTTPMethod:@"POST"];
            [request setValue:postLength forHTTPHeaderField:@"Content-Length"];
            [request setValue:@"application/json" forHTTPHeaderField:@"Accept"];
            [request setValue:@"application/x-www-form-urlencoded" forHTTPHeaderField:@"Content-Type"];
            [request setHTTPBody:postData];

            //[NSURLRequest setAllowsAnyHTTPSCertificate:YES forHost:[url host]];

            NSError *error = [[NSError alloc] init];
            NSHTTPURLResponse *response = nil;
            NSData *urlData=[NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error];

            NSLog(@"Response code: %d", [response statusCode]);
            if ([response statusCode] >=200 && [response statusCode] <300)
            {
                NSString *responseData = [[NSString alloc]initWithData:urlData encoding:NSUTF8StringEncoding];
                NSLog(@"Response ==> %@", responseData);

                SBJsonParser *jsonParser = [SBJsonParser new];
                NSDictionary *jsonData = (NSDictionary *) [jsonParser objectWithString:responseData error:nil];
                NSLog(@"%@",jsonData);
                NSInteger success = [(NSNumber *) [jsonData objectForKey:@"success"] integerValue];
                NSLog(@"%d",success);
                if(success == 1)
                {
                    NSLog(@"Register SUCCESS");
                    [self alertStatus:@"Registered Successfully." :@"Register Success!"];
                    [self performSegueWithIdentifier: @"GoToHome" sender: self];

                } else {

                    NSString *error_msg = (NSString *) [jsonData objectForKey:@"error_message"];
                    [self alertStatus:error_msg :@"Register Failed!"];
                }

            } else {
                if (error) NSLog(@"Error: %@", error);
                [self alertStatus:@"Connection Failed" :@"Login Failed!"];
            }
        }
    }
    @catch (NSException * e) {
        NSLog(@"Exception: %@", e);
        [self alertStatus:@"Login Failed." :@"Login Failed!"];
    }

}
- (void) alertStatus:(NSString *)msg :(NSString *)title
{
    UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:title
                                                        message:msg
                                                       delegate:self
                                              cancelButtonTitle:@"Ok"
                                              otherButtonTitles:nil, nil];

    [alertView show];
}

- (BOOL)prefersStatusBarHidden
{
    return YES;
}

@end
<file_sep>/Mantl/Diary.h
//
//  Diary.h
//  Mantl
//
//  Created by <NAME> on 21/05/14.
//  Copyright (c) 2014 <NAME> 2. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface Diary : NSObject
@property (nonatomic, strong) NSString * tekst;
@property (nonatomic, strong) NSString * date;

@end
<file_sep>/Mantl/MijnVraagEnAntwoordTableViewController.m
//
//  MijnVraagEnAntwoordTableViewController.m
//  Mantl
//
//  Created by <NAME> on 22/05/14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

#import "MijnVraagEnAntwoordTableViewController.h"

@interface MijnVraagEnAntwoordTableViewController ()

@property (nonatomic) NSArray* antwoorden;

@end

@implementation MijnVraagEnAntwoordTableViewController
#define UIColorFromRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0]

- (id)initWithStyle:(UITableViewStyle)style
{
    self = [super initWithStyle:style];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];

    // Uncomment the following line to preserve selection between presentations.
    // self.clearsSelectionOnViewWillAppear = NO;

    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
    // self.navigationItem.rightBarButtonItem = self.editButtonItem;

    _antwoorden = [NSArray arrayWithObjects: @"In de supermarkt", @"In den Aldi", @"Mijn moestuintje", nil];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    // Return the number of sections.
    return 2;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    if (section == 0) {
        return 1;
    } else {
        return _antwoorden.count;
    }
}

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
    if (section == 0) {
        return @"Vraag";
    } else {
        return @"Antwoorden";
    }
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"MijnVraagEnAntwoord"];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"MijnVraagEnAntwoord"];
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
    }

    if (indexPath.section == 0) {
        cell.textLabel.text = @"Waar kan ik spruiten kopen? En deze zin moet langer zijn dus maak ik ze ook wat langer. Just like my dick.";
        [cell setBackgroundColor:UIColorFromRGB(0xE06025)];
    } else {
        NSString* currenttitle = [_antwoorden objectAtIndex:indexPath.row];
        cell.textLabel.text = currenttitle;
        if (indexPath.row % 2 == 0) {
            [cell setBackgroundColor:UIColorFromRGB(0xFF935B)];
        } else {
            [cell.textLabel setTextColor:UIColorFromRGB(0xFF935B)];
        }
    }

    return cell;
}

/*
 // Override to support conditional editing of the table view.
 - (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
 {
 // Return NO if you do not want the specified item to be editable.
 return YES;
 }
 */

/*
 // Override to support editing the table view.
 - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
 {
 if (editingStyle == UITableViewCellEditingStyleDelete) {
 // Delete the row from the data source
 [tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
 } else if (editingStyle == UITableViewCellEditingStyleInsert) {
 // Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
 }
 }
 */

/*
 // Override to support rearranging the table view.
 - (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
 {
 }
 */

/*
 // Override to support conditional rearranging of the table view.
 - (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
 {
 // Return NO if you do not want the item to be re-orderable.
 return YES;
 }
 */

/*
 #pragma mark - Navigation

 // In a storyboard-based application, you will often want to do a little preparation before navigation
 - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
 {
 // Get the new view controller using [segue destinationViewController].
 // Pass the selected object to the new view controller.
 }
 */

@end
<file_sep>/Mantl/Plaats.m
//
//  Plaats.m
//  Mantl
//
//  Created by <NAME> on 22/05/14.
//  Copyright (c) 2014 <NAME> 2. All rights reserved.
//

#import "Plaats.h"

@implementation Plaats

@synthesize titel;
@synthesize adres;
@synthesize afbeelding;
@synthesize soort;

//Voorzieningen
@synthesize wc;
@synthesize parking;
@synthesize rolstoel;
@synthesize eten;
@synthesize drinken;

@end
<file_sep>/Mantl/DagboekTableViewController.h
//
//  DagboekTableViewController.h
//  Mantl
//
//  Created by <NAME> on 20/05/14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface DagboekTableViewController : UITableViewController

@end
<file_sep>/Mantl/Vraag.h
//
//  Vraag.h
//  Mantl
//
//  Created by <NAME> on 21/05/14.
//  Copyright (c) 2014 <NAME> 2. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface Vraag : NSObject

@property (nonatomic) NSString *titel;
@property (nonatomic) NSString *vraag;

- (id)initMetTitelEnVraag:(NSString *) titel :(NSString *) vraag;

@end
<file_sep>/Mantl/DagboekViewController.m
//
//  DagboekViewController.m
//  Mantl
//
//  Created by <NAME> on 21/05/14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

#import "DagboekViewController.h"
#import "Diary.h"
#import "DetailDagboekViewController.h"

@interface DagboekViewController ()
{
    HomeModel *_homeModel;
    NSArray*_feedItems;
}

@end

@implementation DagboekViewController

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Set this view controller object as the delegate and data source for the table view
    self.listTableView.delegate = self;
    self.listTableView.dataSource = self;

    // Create array object and assign it to _feedItems variable
    _feedItems = [[NSArray alloc] init];

    // Create new HomeModel object and assign it to _homeModel variable
    _homeModel = [[HomeModel alloc] init];

    // Set this view controller object as the delegate for the home model object
    _homeModel.delegate = self;

    // Call the download items method of the home model object
    [_homeModel downloadItems];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

-(void)itemsDownloaded:(NSArray *)items
{
    // This delegate method will get called when the items are finished downloading

    // Set the downloaded items to the array
    _feedItems = items;

    // Reload the table view
    [self.listTableView reloadData];
}
#pragma mark Table View Delegate Methods

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    // Return the number of feed items (initially 0)
    return _feedItems.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    // Retrieve cell
    NSString *cellIdentifier = @"BasicCell";
    UITableViewCell *myCell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];

    // Get the location to be shown
    Diary * item = _feedItems[indexPath.row];

    // Get references to labels of cell
    myCell.textLabel.text = [item.tekst substringToIndex:14];

    myCell.detailTextLabel.text = item.date;

    return myCell;
}

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    if ([segue.identifier isEqualToString:@"detail"]) {
        NSIndexPath *indexPath = [self.listTableView  indexPathForSelectedRow];
        DetailDagboekViewController *destViewController = segue.destinationViewController;
        Diary *temp = [_feedItems  objectAtIndex:indexPath.row];

        destViewController.dagboektekst = temp.tekst;
        destViewController.datum = temp.date;
    }
}

@end
<file_sep>/Mantl/LoginControllerViewController.h
//
//  LoginControllerViewController.h
//  Mantl
//
//  Created by <NAME> on 20/05/14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface LoginControllerViewController : UIViewController
@property (weak, nonatomic) IBOutlet UITextField *usernameTxt;
@property (weak, nonatomic) IBOutlet UITextField *paswoordTxt;
- (IBAction)LoginButton:(id)sender;
- (IBAction)backgroundClick:(id)sender;

@end
<file_sep>/Mantl/DagboekViewController.h
//
//  DagboekViewController.h
//  Mantl
//
//  Created by <NAME> on 21/05/14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "HomeModel.h"

@interface DagboekViewController : UIViewController <UITableViewDataSource, UITableViewDelegate, HomeModelProtocol>
@property (weak, nonatomic) IBOutlet UITableView *listTableView;

@end
<file_sep>/Mantl/ForgetPasswordViewController.h
//
//  ForgetPasswordViewController.h
//  Mantl
//
//  Created by <NAME> on 20/05/14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface ForgetPasswordViewController : UIViewController
@property (weak, nonatomic) IBOutlet UITextField *emailtxt;
- (IBAction)send:(id)sender;
- (IBAction)backgroundClick:(id)sender;

@end
<file_sep>/Mantl/DetailDagboekViewController.h
//
//  DetailDagboekViewController.h
//  Mantl
//
//  Created by <NAME> on 22/05/14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface DetailDagboekViewController : UIViewController
@property (strong, nonatomic) IBOutlet UITextView *dagboekData;
@property (nonatomic, strong) NSString *dagboektekst;
@property (nonatomic, strong) NSString *datum;
@property (strong, nonatomic) IBOutlet UILabel *datumLabel;

@end
<file_sep>/Mantl/SchrijfViewController.h
//
//  SchrijfViewController.h
//  Mantl
//
//  Created by <NAME> on 21/05/14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface SchrijfViewController : UIViewController

@property (weak, nonatomic) IBOutlet UITextView *tekstveld;
- (IBAction)opslaan:(id)sender;
- (IBAction)backgroundClicker:(id)sender;

@end
<file_sep>/Mantl/Home.h
//
//  Home.h
//  Mantl
//
//  Created by <NAME> on 22/05/14.
//  Copyright (c) 2014 <NAME> 2. All rights reserved.
//

#import <Foundation/Foundation.h>

@protocol HomeProtocol <NSObject>

- (void)itemsDownloaded:(NSArray *)items;

@end

@interface Home : NSObject <NSURLConnectionDataDelegate>

@property (nonatomic, weak) id<HomeProtocol> delegate;

- (void)downloadItems;

@end<file_sep>/PHP/Login.php
<?php

$host="gandibleux.eu.mysql"; // Host name
$username="gandibleux_eu"; // Mysql username
$password="<PASSWORD>"; // Mysql password
$db_name="gandibleux.eu"; // Database name
//$tbl_name="members"; // Table name

// Connect to server and select databse.
//$connection = mysql_connect("$host", "$username", "$password")or die("cannot connect");
//mysql_select_db("$db_name")or die("cannot select DB");

// Create connection
 $connection =mysql_connect("$host","$username","$password","$db_name");

// Check connection
if (mysqli_connect_errno())
{
  echo "Failed to connect to MySQL: " . mysqli_connect_error();
}

// This SQL statement selects ALL from the table 'Accounts'
$sql = "SELECT * FROM Accounts";

// Check if there are results
if ($result = mysqli_query($connection, $sql))
{
    // If so, then create a results array and a temporary one
    // to hold the data
    $resultArray = array();
    $tempArray = array();

    // Loop through each row in the result set
    while($row = $result->fetch_object())
    {
        // Add each row into our results array
        $tempArray = $row;
        array_push($resultArray, $tempArray);
    }

    // Finally, encode the array to JSON and output the results
    echo json_encode($resultArray);
}

// Close connections
mysqli_close($result);
mysqli_close($connection);
?><file_sep>/Mantl/Vraag.m
//
//  Vraag.m
//  Mantl
//
//  Created by <NAME> on 21/05/14.
//  Copyright (c) 2014 <NAME> 2. All rights reserved.
//

#import "Vraag.h"

@implementation Vraag

- (id)initMetTitelEnVraag:(NSString *)titel :(NSString *)vraag {
    if (self = [super init]) {
        self.titel = titel;
        self.vraag = vraag;
    }
    return self;
}

@end
<file_sep>/Mantl/Home.m
//
//  Home.m
//  Mantl
//
//  Created by <NAME> on 22/05/14.
//  Copyright (c) 2014 <NAME> 2. All rights reserved.
//

#import "Home.h"
#import "Plaats.h"

@interface Home()
{
    NSMutableData *_downloadedData;
}
@end

@implementation Home

- (void)downloadItems
{
    // Download the json file
    NSURL *jsonFileUrl = [NSURL URLWithString:@"http://gandibleux.eu/PHP/jsonGetPlaatsen.php"];

    // Create the request
    NSURLRequest *urlRequest = [[NSURLRequest alloc] initWithURL:jsonFileUrl];

    // Create the NSURLConnection
    [NSURLConnection connectionWithRequest:urlRequest delegate:self];
}

#pragma mark NSURLConnectionDataProtocol Methods

- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
{
    // Initialize the data object
    _downloadedData = [[NSMutableData alloc] init];
}

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
    // Append the newly downloaded data
    [_downloadedData appendData:data];
}

- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
    // Create an array to store the locations
    NSMutableArray *_plaatsen = [[NSMutableArray alloc] init];

    // Parse the JSON that came in
    NSError *error;
    NSArray *jsonArray = [NSJSONSerialization JSONObjectWithData:_downloadedData options:NSJSONReadingAllowFragments error:&error];

    // Loop through Json objects, create question objects and add them to our questions array
    for (int i = 0; i < jsonArray.count; i++)
    {
        NSDictionary *jsonElement = jsonArray[i];

        // Create a new location object and set its props to JsonElement properties
        Plaats *newPlaats = [[Plaats alloc] init];
        newPlaats.titel = jsonElement[@"Titel"];
        newPlaats.adres = jsonElement[@"adres"];
        newPlaats.afbeelding = jsonElement[@"afbeelding"];
        newPlaats.soort = jsonElement[@"soort"];

        //voorzieningen
        newPlaats.wc = jsonElement[@"wc"];
        newPlaats.parking = jsonElement[@"parking"];
        newPlaats.rolstoel = jsonElement[@"rolstoel"];
        newPlaats.eten = jsonElement[@"eten"];
        newPlaats.drinken = jsonElement[@"drinken"];

        // Add this question to the locations array
        [_plaatsen addObject:newPlaats];
    }

    // Ready to notify delegate that data is ready and pass back items
    if (self.delegate)
    {
        [self.delegate itemsDownloaded:_plaatsen];
    }
}

@end
<file_sep>/Mantl/plaatsViewController.h
//
//  plaatsViewController.h
//  Mantl
//
//  Created by <NAME> on 22/05/14.
//  Copyright (c) 2014 <NAME> 2. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "Home.h"

@interface plaatsViewController : UIViewController <UITableViewDataSource, UITableViewDelegate, HomeProtocol>

@property (weak, nonatomic) IBOutlet UITableView *plaatsTableView;

@end
<file_sep>/Mantl/AlleVragenTableViewController.h
//
//  AlleVragenTableViewController.h
//  Mantl
//
//  Created by <NAME> on 20/05/14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface AlleVragenTableViewController : UITableViewController

@end
<file_sep>/Mantl/plaatsViewController.m
//
//  plaatsViewController.m
//  Mantl
//
//  Created by <NAME> on 22/05/14.
//  Copyright (c) 2014 <NAME>. All rights reserved.
//

#import "plaatsViewController.h"
#import "Plaats.h"

@interface plaatsViewController ()
{
    Home *_home;
    NSArray *_feedItems;
}

@property (nonatomic) NSString* userID;

@end

@implementation plaatsViewController

- (void)viewDidLoad
{
    [super viewDidLoad];

    // Set this view controller object as the delegate and data source for the table view
    self.plaatsTableView.delegate = self;
    self.plaatsTableView.dataSource = self;

    // Create array object and assign it to _feedItems variable
    _feedItems = [[NSArray alloc] init];

    // Create new HomeModel object and assign it to _homeModel variable
    _home = [[Home alloc] init];

    // Set this view controller object as the delegate for the home model object
    _home.delegate = self;

    // Call the download items method of the home model object
    [_home downloadItems];

    // **********************************************************************************
    // User ID
    NSUserDefaults* userData = [NSUserDefaults standardUserDefaults];
    _userID = [userData objectForKey:@"userID"];
    NSLog(@"%@", _userID);
    // **********************************************************************************
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

-(void)itemsDownloaded:(NSArray *)items
{
    // This delegate method will get called when the items are finished downloading

    // Set the downloaded items to the array
    _feedItems = items;

    // Reload the table view
    [self.plaatsTableView reloadData];
}

#pragma mark Table View Delegate Methods

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    // Return the number of feed items (initially 0)
    return _feedItems.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    // Retrieve cell
    NSString *cellIdentifier = @"BasicCell";
    UITableViewCell *myCell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];

    // Get the location to be shown
    Plaats *item = _feedItems[indexPath.row];

    // Get references to labels of cell

    //TITEL
    UILabel *plaatsTitel = (UILabel *)[myCell viewWithTag:1];
    plaatsTitel.text = item.titel;

    //ADRES
    UILabel *plaatsAdres = (UILabel *)[myCell viewWithTag:2];
    plaatsAdres.text = item.adres;

    // AFBEELDING DAT SOORT PLAATS WEERGEEFT
    NSString* linkImg = [NSString stringWithFormat:@"%@.jpg", item.soort];

    UIImageView *plaatsImg = (UIImageView *)[myCell viewWithTag:3];
    plaatsImg.image = [UIImage imageNamed:linkImg];

    //VOORZIENINGEN
    UIImageView *plaatsWc = (UIImageView *)[myCell viewWithTag:101];

    if ( [item.wc  isEqual: @"ja"])
    {
        plaatsWc.image = [UIImage imageNamed:@"wc.jpg"];
    }

    //Cell returnen
    return myCell;
}

@end
<file_sep>/Mantl/HomeScreenViewController.h
//
//  HomeScreenViewController.h
//  Mantl
//
//  Created by <NAME> on 17/05/14.
//  Copyright (c) 2014 <NAME> 2. All rights reserved.
//

#import <UIKit/UIKit.h>

@interface HomeScreenViewController : UIViewController

@end

languages: Objective-C PHP

repo_language: Objective-C

repo_name: iliketorock/Mantl


text:
<file_sep>package com.epam.Task2;

public class AssortedSweets extends NYGift {
	public AssortedSweets(String sname,int sqty) {
		super(sname,sqty);
	}
	@Override
	void wrap() {
		System.out.println(this.getGName()+" is gift wrapped!");
	}

}
<file_sep>package com.epam.Task2;

/**
 * Hello world!
 *
 */
public abstract class NYGift
{
    private String giftname;
    private int giftqty;
    public NYGift(String name,int qty) {
    	giftname=name;
    	giftqty=qty;
    }
    public void setGName(String x) {
    	giftname=x;
    }
    public String getGName() {
    	return giftname;
    }
    public void setGQty(int y) {
    	giftqty=y;
    }
    public int getGQty() {
    	return giftqty;
    }
    abstract void wrap();

}

repo_language: Java


text:
<repo_name>devcwilkey/Project-3<file_sep>/routes/api.js
const router = require('express').Router();
const { User, Movie } = require('../models');
const { Types } = require('mongoose');

// Get all users or a specific user by id.
router.get('/users', (req, res) => {
    console.log(req.path);
    const id = req.body ? req.body.id : null;
    const promise = id ? User.findById(Types.ObjectId(id)) : User.find();
    promise.then(res.send).catch(res.send);
});

// Delete a user by id.
router.delete('/users', (req, res) => {
    const id = req.body ? req.body.id : null;
    User.findByIdAndDelete(Types.ObjectId(id)).then(res.send).catch(res.send);
});

// Create a new user.
router.post('/users', (req, res) => {
    User.create(req.body).then(res.send).catch(res.send);
});

// Get all movies, a specific movie by id, or titles starting with given title string.
router.get('/movies', (req, res) => {
    console.log(req.path);
    const id = req.body ? req.body.id : null;
    const title = req.body ? req.body.title : null;
    const promise = id ? Movie.findById(Types.ObjectId(id)) :
        title ? Movie.find({ title: new RegEx('^' + title) }) :
            Movie.find();
    promise.then(res.send).catch(res.send);
});

// Delete a movie by id.
router.delete('/movies', (req, res) => {
    const id = req.body ? req.body.id : null;
    movie.findByIdAndDelete(Types.ObjectId(id)).then(res.send).catch(res.send);
});

// Create a new movie.
router.post('/movies', (req, res) => {
    movie.create(req.body).then(res.send).catch(res.send);
});

const deepCopy = (from, to) => {
    const copy = (value, item) => {
        if (typeof value == 'object')
            deepCopy(value, to[item]);
        else
            to[item] = item === 'id' || item === 'movie' ? Types.ObjectId(value) : value;
    };
    if (Array.isArray(from))
        from.forEach(copy);
    else
        for (let item in from)
            copy(from[item], item);
};

// Modify a user with given id. All fields in body will be copied into given user.
router.put('/users', (req, res) => {
    if (!req.body) res.sendStatus(400);
    const { id } = req.body;
    if (!id) res.sendStatus(400);
    // Delete id property of body so that it won't be copied.
    delete req.body.id;
    User.findByIdAndUpdate(Types.ObjectId(id)).then(user => {
        deepCopy(req.body, user);
        res.sendStatus(200);
    });
});

/* Given an array of movie ids and a user id,
 * return movies the user hasn't saved, rated, or rejected. */
router.get('/unseen', (req, res) => {
    if (!req.body) res.sendStatus(400);
    const { id, movies } = req.body;
    User.findById(Types.ObjectId(id)).then(user => {
        res.send(movies.filter(movie => {
            for (let item of ['ratings', 'rejects', 'saves'])
                if (user[item].find(Types.ObjectId(movie)))
                    return false;
            return true;
        }));
    });
});

module.exports = router;<file_sep>/client/src/components/NewModal/movie-browser/movie-browser.service.js
// const BASEURL = "https://api.themoviedb.org/3/discover/movie?api_key="
// "&language=en-US&sort_by=popularity.desc&include_adult=false&include_video=false&page=1";

// WARNING: Don't check your actual API key into GitHub
const MOVIE_DB_API_KEY = '<KEY>';
const MOVIE_DB_BASE_URL = 'https://api.themoviedb.org/3';

const createMovieDbUrl = (relativeUrl, queryParams) => {
  let baseUrl = `${MOVIE_DB_BASE_URL}${relativeUrl}?api_key=${MOVIE_DB_API_KEY}&language=en-US`;
  if (queryParams) {
    Object.keys(queryParams)
      .forEach(paramName => baseUrl += `&${paramName}=${queryParams[paramName]}`);
  }
  return baseUrl;
}

export const getTopMovies = async ({page}) => {
  const fullUrl = createMovieDbUrl('/movie/top_rated', {
    page
  });
  return fetch(fullUrl);
}
// https://api.themoviedb.org/3/movie/upcoming?api_key=dbc0a6d62448554c27b6167ef7dabb1b&language=en-US&page=1
export const getUpcoming = async ({page}) => {
  const fullUrl = createMovieDbUrl('/movie/upcoming', {
    page
  });
  return fetch(fullUrl);
}
export const getNowPlaying = async ({page}) => {
  const fullUrl = createMovieDbUrl('/movie/now_playing', {
    page
  });
  return fetch(fullUrl);
}
export const getPopular = async ({page}) => {
  const fullUrl = createMovieDbUrl('/movie/popular', {
    page
  });
  return fetch(fullUrl);
}

// https://api.themoviedb.org/3/movie/{movie_id}/recommendations?api_key=dbc0a6d62448554c27b6167ef7dabb1b&language=en-US&page=1
export const getRecommendations = async ({movieId}) => {
  const fullUrl = createMovieDbUrl(`/movie/${movieId}/recommendations`);
  return fetch(fullUrl);
}

export const searchMovies = async ({ page, query}) => {
  const fullUrl = createMovieDbUrl('/search/movie', {
    page,
    query
  });
  return fetch(fullUrl);
}

export const getMovieDetails = async ({movieId}) => {
  const fullUrl = createMovieDbUrl(`/movie/${movieId}`);
  return fetch(fullUrl);
}
export const getMovieCredits = async ({movieId}) => {
  const fullUrl = createMovieDbUrl(`/movie/${movieId}/credits`);
  return fetch(fullUrl);
}<file_sep>/server.js
const path = require('path');
const express = require('express');

const router = require('./routes');

const mongoose = require('mongoose');
const MONGODB_URI = process.env.MONGODB_URI || 'mongodb://localhost/watches';

mongoose.set('useNewUrlParser', true);
mongoose.set('useFindAndModify', false);
mongoose.set('useCreateIndex', true);
mongoose.set('useUnifiedTopology', true);

mongoose.connect(MONGODB_URI, (err) => {
    if (err) throw err;
});

const app = express();

app.use(express.urlencoded({ extended: true }));
app.use(express.json());
if (process.env.NODE_ENV === 'production') {
    app.use(express.static('client/build'));
}

app.use('/', router);

const PORT = process.env.PORT || 8080;

app.listen(PORT, () => console.log('Listening on ' + PORT));

module.exports = app;
<file_sep>/test/api.js
//During the test the env variable is set to test
process.env.NODE_ENV = 'test';

const mongoose = require("mongoose");
const { User, Movie } = require('../models');

//Require the dev-dependencies
const chai = require('chai');
const { expect } = chai;
const server = require('../server');

chai.use(require('chai-http'));

describe('API', () => {
    before(() => {
        const MONGODB_URI = 'mongodb://localhost/test';
        mongoose.set('useNewUrlParser', true);
        mongoose.set('useFindAndModify', false);
        mongoose.set('useCreateIndex', true);
        mongoose.set('useUnifiedTopology', true);
        mongoose.connect(MONGODB_URI, (err) => {
            if (err) throw err;
        });
    });
    /*
      * Test the /GET route
      */
    describe('/GET user', () => {
        it('should GET all the users', () =>
            chai.request(server)
                .get('/api/users')
                .then(res => {
                    expect(res.body).to.be.an('array');
                })
        );
    });

});

repo_language: JavaScript


text:
<repo_name>reakain/PrusaSlicer-Settings<file_sep>/README.md
# Prusa i3 Mk3s Presets for PrusaSlicer 2.0.0+win64

I don't use basically any of the filament brands/materials that Prusa has settings for, and I got tired of trawling forums for settings and tweaking printer parameters. So! Here is my bundle of different custom settings.

Note: I have not upgraded my nozzle yet, and at this point I have an enclosure installed.

There are custom print resolution settings for different materials (ie, retraction speed changes), and the filament brands I current have settings for are:
* eSun
* Polymaker

Need to document settings for:
* Tttyt3D
* Ziro
* NinjaTek
* CC3D
* Taulman

### eSun Filament
Includes:
* PLA+
* PETG
* ABS+ (WITH ENCLOSURE)
* ABS (WITH ENCLOSURE)

Missing:
* PLA
* Silk PLA
* ePA Nylon

### Polymaker Filament
Includes:
* PolyLite PETG

Missing:
* PolySmooth

### Tttyt3D Filament
Includes:
*

Missing:
* Silk PLA

### Ziro Filament
Includes:
*

Missing:
* Woodfill
* Brass

### NinjaTek Filament
Includes:
*

Missing:
* Ninjaflex 85A

### CC3D Filament
Includes:
*

Missing:
* Silk PLA

### Taulman Filament
Includes:
*

Missing:
* PCTPE

### Print Settings
Includes:
* 0.05mm resolution for PETG

repo_name: reakain/PrusaSlicer-Settings