Skip to content
This repository has been archived by the owner on Jun 17, 2021. It is now read-only.

Commit

Permalink
Merge pull request #66 from 30-seconds/from-starter
Browse files Browse the repository at this point in the history
Use 30-seconds-starter template
  • Loading branch information
Chalarangelo committed Aug 28, 2019
2 parents 17a2f41 + 89141c3 commit 4ab2bc9
Show file tree
Hide file tree
Showing 138 changed files with 26,640 additions and 1,324 deletions.
8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
src/docs/* linguist-documentation
scripts/* linguist-documentation
gatsby-browser.js linguist-documentation
gatsby-config.js linguist-documentation
gatsby-node.js linguist-documentation
gatsby-ssr.js linguist-documentation
.travis/* linguist-documentation
config.js linguist-documentation
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Bug report
about: Create a report to help us improve

---

## Bug description
<!-- A clear and concise description of what the bug is. -->

## Steps to reproduce
<!-- Where did you encounter the bug/What code caused the bug to appear? -->

## Expected behavior
<!-- A clear and concise description of what you expected to happen. -->

## Screenshots
<!-- If applicable, add screenshots to help explain your problem. -->

## Environment
<!-- Provide some information about your OS, Browser or mobile device (if applicable). -->
8 changes: 8 additions & 0 deletions .github/ISSUE_TEMPLATE/discussion.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
name: Discussion
about: Discuss something with us

---

## Description
<!-- A clear and concise description of what you want to discuss. -->
9 changes: 9 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
name: Feature request
about: Suggest an idea for this project

---

## Description
<!-- A clear and concise description of what you want to happen. -->
<!-- Provide sample code, useful information, possible solutions and examples whenever possible. -->
15 changes: 15 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- Use a descriptive title, prefix it with [FIX], [FEATURE] or [ENHANCEMENT] if applicable (use only one) -->

## Description
<!-- Write a detailed description of your changes/additions here -->
<!-- If your PR resolves an issue, please state "Resolves #(issue number)" to help maintainers process it faster -->
<!-- If you think your PR will cause breaking changes, require changes in the documentation etc, please be so kind as to explain what, where and how -->

## PR Type
- [ ] Snippets, Tests & Tags (new snippets, updated snippets, re-tagging of snippets, added/updated tests)
- [ ] Tools, Scripts & Automation (anything related to files in the scripts folder, Gatsby, website, Travis CI or Netlify)
- [ ] General, Typos, Misc. & Meta (everything related to content, typos, general stuff and meta files in the repository - e.g. the issue template)
- [ ] Other (please specifiy in the description above)

## Guidelines
- [ ] I have read the guidelines in the [CONTRIBUTING](https://github.com/30-seconds/30-seconds-starter/blob/master/CONTRIBUTING.md) document.
71 changes: 71 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,74 @@
vendor
composer.lock
.DS_STORE

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage

# nyc test coverage
.nyc_output

# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn
yarn-error.log
.pnp/
.pnp.js

# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
.env

# next.js build output
.next

# gatsby files
.cache/
public
28 changes: 8 additions & 20 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,12 @@
language: php
sudo: false

php:
- 7.2

language: node_js
cache:
directories:
- "$HOME/.composer/cache"

before_script:
- travis_retry composer self-update
- travis_retry composer install --no-interaction --prefer-dist --no-suggest

- node_modules
node_js:
- lts/*
script:
- vendor/bin/phpunit --verbose
- npm run extractor
- npm run builder
after_success:
- composer build
- chmod +x .travis/push.sh
- ".travis/push.sh"

env:
matrix:
secure: invNYdjJ6ngLMCL1Io1H4cFa8MpV961YoAPTrztADY8T7KfRl6p/V0T3NgTY4nnR6+fDptf8+rmtMUJmJkeRE2TNArtlvAM0vcJe2kpni7xSXKVHcRUlPoBdpNMFr6CVmF0l1Uu+WcLQMVXDIohxjSMtiT+ubXFVlaIWdHjW2erx7CXiN8/DcHQ8XIeVKHgUuArbmv2lvnGHK3MyzJoe3PxafKOAglSFCOPF4ObWrK269IVhmA7NSo36UkPbdVThceK1iM+6z3cEm3sr4C7JZ1C9L3N0vNjlLebdmor7uH9LbqDVM+f3MDsiCZK2e5QOKv3GOJ+71we9UWGwmnFlRRESv0FfKoIYpqowz5DYbiNZxXNBFnpoCZOxiQlPhlfAkOjBx755DOuwsHynhDMrBPZp/JgCNRhvwmGjrr1zYq7HSNE4a6EnBaDpwqwVpbT6QU26pkNIF5Y5evdxbfgenZqWg/tG64Z+OVxTEx7K43tgyaoMcyBIm4UWugqABzNzNdkG0Skw95cOXWEwbjYrqbU0sonfYDTuGZktuKBFnTU2HqjRcQIoJYqa/PPjJGaSSgqRYk0nOJbsmAa61jFc04rykZ/0LufmUjWDAb7Fy6d1ZK2ugu+bK3K18iOrDNsVHhAGKGtQCbtCGqhnINxvG7JY5Z7S8/FYtlZYvApSShc=
- chmod +x .travis/push.sh
- .travis/push.sh
6 changes: 3 additions & 3 deletions .travis/push.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash
setup_git() {
git config --global user.email "sohelamincse@gmail.com"
git config --global user.name "sohelamin"
git config --global user.email "30secondsofcode@gmail.com"
git config --global user.name "30secondsofcode"
}

git_commit() {
Expand All @@ -25,7 +25,7 @@ git_push() {
if [ $TRAVIS_EVENT_TYPE != "pull_request" ]; then
if [ $TRAVIS_BRANCH == "master" ]; then
echo "Pushing to master branch..."
git push --force --quiet "https://${GH_TOKEN}@github.com/appzcoder/30-seconds-of-php-code.git" master > /dev/null 2>&1
git push --force --quiet "https://${GH_TOKEN}@github.com/30-seconds/30-seconds-of-php-code.git" master > /dev/null 2>&1
fi
fi
}
Expand Down
46 changes: 46 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at 30secondsofcode@gmail.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
51 changes: 37 additions & 14 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,40 @@
# Contribution Guide
# Contribution guidelines

## Quick Guide
- Fork the repo.
- Checkout.
- Install the dependencies `composer install --dev`
- Generate your snippet using `php scripts/generate snippet` command.
- Update your snippet file located at snippets directory. eg. `snippet/mySnippet.md`
- Add the function to `src/helpers.php`
- Write the test case.
- Test the code using `composer test`
- Make the pull request.
**30 seconds of PHP** is a community effort, so feel free to contribute in any way you can. Every contribution helps!

Note: **DO NOT TOUCH** the **[README.md](README.md)** file and **data** directory.
Here's what you can do to help:

## Coding Style
We follow the PSR-2 coding standard.
- Submit [pull requests](https://github.com/30-seconds/30-seconds-of-php/pulls) with snippets and tests that you have created (see below for guidelines).
- [Open issues](https://github.com/30-seconds/30-seconds-of-php/issues/new) for things you want to see added or modified.
- Be part of the discussion by helping out with [existing issues](https://github.com/30-seconds/30-seconds-of-php/issues) or talking on our [gitter channel](https://gitter.im/30-seconds-of-php/Lobby).
- Tag uncategorized snippets by adding the appropriate in the snippet's frontmatter in `tags`.
- Fix typos in existing snippets, improve snippet descriptions and explanations or provide better examples.
- Write tests for existing snippets (see below for guidelines).

### Snippet submission and Pull request guidelines

- **DO NOT MODIFY THE README.md FILE!** Make changes to individual snippet files. **Travis CI** will automatically build the `README.md` file when your pull request is merged.
- **Snippet filenames** must correspond to the title of the snippet. For example, if your snippet is titled `awesomeSnippet` the filename should be `awesomeSnippet.md`.
- Use `camelCase`, not `kebab-case` or `snake_case`.
- Avoid capitalization of words, except if the whole word is capitalized (e.g. `URL` should be capitalized in the filename and the snippet title).
- **Snippet metadata** must be included in all snippets in the form of frontmatter.
- All snippets must contain a title.
- All snippets must contain tags, prefixed with `tags:` and separated by commas (optional spaces in-between).
- Make sure the first tag in your snippet's tags is one of the main categories, as seen in the `README.md` file or the website.
- Snippet tags must include a difficulty setting (`begginer`, `intermediate` or `advanced`), preferrably at the end of the list.
- **Snippet titles** should be the same as the name of the function that is present in the snippet.
- All snippet titles must be prefixed with `title:` and be at the very first line of your snippet's frontmatter.
- Snippet titles must be unique (although if you cannot find a better title, just add some placeholder at the end of the filename and title and we will figure it out).
- Follow snippet titles with an empty line.
- **Snippet descriptions** must be short and to the point. Try to explain *what* the snippet does and *how* the snippet works and what Javascript features are used. Remember to include what functions you are using and why.
- Follow snippet descriptions with an empty line.
- **Snippet code** must be enclosed inside ` ```php ` and ` ``` `.
- Remember to start your snippet's code on a new line below the opening backticks.
- Try to keep your snippets' code short and to the point. Use modern techniques and features. Make sure to test your code before submitting.
- All snippets must be followed by one (more if necessary) test case after the code, in a new block enclosed inside ` ```php ` and ` ``` `. The syntax for this is `myFunction('testInput') // 'testOutput'`. Use multiline examples only if necessary.
- Try to make your function name unique, so that it does not conflict with existing snippets.
- Snippet functions do not have to handle errors in input, unless it's necessary (e.g. a mathematical function that cannot be extended to negative numbers should handle negative input appropriately).
- Snippets should be short (usually below 10 lines). If your snippet is longer than that, you can still submit it, and we can help you shorten it or figure out ways to improve it.
- Snippets *should* solve real-world problems, no matter how simple.
- Snippets *should* be abstract enough to be applied to different scenarios.
- You can start creating a new snippet, by using the [snippet template](snippet-template.md) to format your snippets.

0 comments on commit 4ab2bc9

Please sign in to comment.