Repository: Chalarangelo/30-seconds-of-interviews
Branch: master
Commit: da235b618572
Files: 187
Total size: 2.0 MB
Directory structure:
gitextract_5uw1kd4g/
├── .babelrc
├── .editorconfig
├── .eslintignore
├── .eslintrc.js
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── new-feature.md
│ │ └── wrong-answer.md
│ └── PULL_REQUEST_TEMPLATE.md
├── .gitignore
├── .prettierrc.js
├── .travis/
│ ├── build.sh
│ ├── checkIfCron.sh
│ ├── forcepush.sh
│ ├── lintweb.sh
│ ├── push.sh
│ └── write_cname.sh
├── .travis.yml
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── LICENSE
├── README.md
├── data/
│ └── questions.json
├── docs/
│ ├── .nojekyll
│ ├── CNAME
│ ├── index.html
│ ├── modern-normalize.1ceaea8e.css
│ ├── prism.610ed272.css
│ ├── website.0466d8c4.js
│ ├── website.1d637206.js
│ ├── website.29127d6f.css
│ ├── website.47c6b05d.js
│ ├── website.8315a0d5.js
│ ├── website.972908d6.css
│ ├── website.ab1c4b5c.js
│ └── website.c597656c.js
├── logo.psd
├── package.json
├── question-template.md
├── questions/
│ ├── .eslintrc.js
│ ├── accessibility-aria.md
│ ├── accessibility-contrast.md
│ ├── accessibility-testing.md
│ ├── accessibility-tree.md
│ ├── alt-attribute.md
│ ├── async-defer-attributes.md
│ ├── async-functions.md
│ ├── batches.md
│ ├── bem.md
│ ├── big-o-notation.md
│ ├── bind-function.md
│ ├── cache-busting.md
│ ├── callback-hell.md
│ ├── callback-in-setState.md
│ ├── callback-refs-vs-finddomnode.md
│ ├── callbacks.md
│ ├── children-prop.md
│ ├── class-name.md
│ ├── clone-object.md
│ ├── closures.md
│ ├── comparing-objects.md
│ ├── context.md
│ ├── cors.md
│ ├── css-box-model.md
│ ├── css-preprocessors.md
│ ├── css-sibling-selectors.md
│ ├── css-specificity.md
│ ├── debouncing.md
│ ├── dom.md
│ ├── double-vs-triple-equals.md
│ ├── element-vs-component.md
│ ├── em-rem-difference.md
│ ├── error-boundaries.md
│ ├── event-delegation.md
│ ├── event-driven-programming.md
│ ├── expression-vs-statement.md
│ ├── falsy-truthy.md
│ ├── fibonacci.md
│ ├── find-the-anagrams.md
│ ├── flex-layout.md
│ ├── floating-point.md
│ ├── focus-ring.md
│ ├── for-each-map.md
│ ├── fragments.md
│ ├── functional-programming.md
│ ├── handling-route-changes-in-single-page-apps.md
│ ├── hoc-component.md
│ ├── hoisting-example.md
│ ├── hoisting.md
│ ├── html-multiple-header-footers.md
│ ├── html-specification-implementation.md
│ ├── html-vs-react-event-handling.md
│ ├── html-vs-xhtml.md
│ ├── html5-semantic-elements-usage.md
│ ├── html5-web-storage.md
│ ├── iife.md
│ ├── imperative-vs-declarative.md
│ ├── inline-conditional-expressions.md
│ ├── keys.md
│ ├── landmark-roles.md
│ ├── lexical-vs-dynamic-scoping.md
│ ├── lifecycle-methods.md
│ ├── lifecycle.md
│ ├── lift-state.md
│ ├── mask.md
│ ├── media-properties.md
│ ├── memoize.md
│ ├── methods-context-react-classes.md
│ ├── mime.md
│ ├── mutable-vs-immutable.md
│ ├── nan.md
│ ├── node-error-first-callback.md
│ ├── node-event-loop.md
│ ├── null-vs-undefined.md
│ ├── object-creation.md
│ ├── parameter-vs-argument.md
│ ├── pass-by-value-reference.md
│ ├── passing-arguments-to-event-handlers.md
│ ├── pipe.md
│ ├── portals.md
│ ├── postfix-vs-prefix-increment.md
│ ├── promise-states.md
│ ├── promises.md
│ ├── prop-validation.md
│ ├── prototypal-inheritance.md
│ ├── pure-functions.md
│ ├── react-comments.md
│ ├── recursion.md
│ ├── reference-example.md
│ ├── refs.md
│ ├── rel-noopener.md
│ ├── rest.md
│ ├── return-semicolon.md
│ ├── semicolons.md
│ ├── short-circuit-evaluation.md
│ ├── sprites.md
│ ├── stateful-components.md
│ ├── stateless-components.md
│ ├── static-vs-instance-method.md
│ ├── sync-vs-async.md
│ ├── this.md
│ ├── typeof-typeof.md
│ ├── types.md
│ ├── ui-library-framework-purpose.md
│ ├── use-strict.md
│ ├── var-let-const.md
│ ├── virtual-dom.md
│ ├── wcag.md
│ └── xss.md
├── scripts/
│ ├── .eslintrc.js
│ ├── build.js
│ ├── extract.js
│ └── util.js
├── static-parts/
│ ├── README-end.md
│ └── README-start.md
└── website/
├── css/
│ ├── _base.scss
│ ├── _prism.scss
│ ├── _vars.scss
│ ├── components/
│ │ ├── BackToTopButton.scss
│ │ ├── Dropdown.scss
│ │ ├── DropdownItem.scss
│ │ ├── Filter.scss
│ │ ├── Footer.scss
│ │ ├── Header.scss
│ │ ├── Introduction.scss
│ │ ├── Question.scss
│ │ └── Questions.scss
│ └── index.scss
├── index.html
├── index.js
└── js/
├── actions.js
├── browser.js
├── components/
│ ├── BackToTopButton.js
│ ├── Dropdown.js
│ ├── DropdownItem.js
│ ├── Filter.js
│ ├── FilterButton.js
│ ├── Footer.js
│ ├── Header.js
│ ├── Icon.js
│ ├── Introduction.js
│ ├── Markdown.js
│ ├── Question.js
│ ├── Questions.js
│ ├── RecommendedResource.js
│ └── SortButton.js
├── state.js
├── utils.js
└── view.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .babelrc
================================================
{
"presets": ["stage-3"],
"plugins": [["transform-react-jsx", { "pragma": "h" }]]
}
================================================
FILE: .editorconfig
================================================
# top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
[*.json]
indent_style = tab
indent_size = 2
trim_trailing_spaces = true
# Matches multiple files with brace expansion notation
# Set default charset
[*.js]
charset = utf-8
indent_style = space
indent_size = 2
max_line_length = 80
# Matches the exact files either package.json or .travis.yml
[{package.json,.travis.yml}]
indent_style = space
indent_size = 2
# trailing spaces in markdown indicate word wrap
[*.md]
trim_trailing_spaces = false
max_line_length = 80
================================================
FILE: .eslintignore
================================================
/node_modules
/dist
/docs
README.md
================================================
FILE: .eslintrc.js
================================================
module.exports = {
env: {
browser: true,
es6: true,
node: true
},
extends: ["airbnb-base", "prettier"],
plugins: ["import", "react", "markdown"],
parserOptions: {
sourceType: "module",
ecmaFeatures: {
jsx: true
}
},
rules: {
"linebreak-style": "off",
"react/jsx-uses-vars": "error",
"no-nested-ternary": "off",
indent: ["error", 2, { SwitchCase: 1 }],
"no-plusplus": ["error", { allowForLoopAfterthoughts: true }],
"no-unused-vars": [2, { varsIgnorePattern: "h" }],
"linebreak-style": ["error", "unix"],
quotes: ["error", "double"],
semi: ["error", "never"],
"array-bracket-spacing": [
"error",
"always",
{
singleValue: false
}
],
"object-curly-spacing": [
"error",
"always",
{
arraysInObjects: false,
objectsInObjects: false
}
],
"no-param-reassign": ["error", { props: false }]
}
}
================================================
FILE: .github/ISSUE_TEMPLATE/new-feature.md
================================================
## Description
## What does your feature belong to?
- [ ] Website
- [ ] README
- [ ] General / Things regarding the repository (like CI Integration)
================================================
FILE: .github/ISSUE_TEMPLATE/wrong-answer.md
================================================
#####Question file name:
## Current Answer
## Expected Answer
================================================
FILE: .github/PULL_REQUEST_TEMPLATE.md
================================================
## Description
**Resolves** #(issue number)
## What does your PR belong to?
* [ ] Questions / Answers
* [ ] Website
* [ ] General / Things regarding the repository (like CI Integration)
## Types of changes
* [ ] Bug fix (non-breaking change which fixes an issue)
* [ ] Enhancement (non-breaking improvement of a question)
* [ ] New feature (non-breaking change which adds functionality)
* [ ] Breaking change (fix or feature that would cause existing functionality to change)
## Checklist:
* [ ] My code follows the code style of this project.
* [ ] My change requires a change to the documentation.
* [ ] I have updated the documentation accordingly.
* [ ] I have checked that the changes are working properly
* [ ] I have checked that there isn't any PR doing the same
* [ ] I have read the **CONTRIBUTING** document.
================================================
FILE: .gitignore
================================================
# 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 (http://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 Integrity file
.yarn-integrity
# dotenv environment variables file
.env
# parcel
.cache
dist
# editor
.vscode
.idea
================================================
FILE: .prettierrc.js
================================================
module.exports = {
printWidth: 80,
semi: false,
useTabs: false,
tabWidth: 2,
singleQuote: false,
bracketSpacing: true,
jsxBracketSameLine: false,
}
================================================
FILE: .travis/build.sh
================================================
test $TRAVIS_EVENT_TYPE = cron \
&& echo -e "\e[95mCRON triggered build, thus building website." \
&& rm -rf docs \
&& yarn build \
&& touch docs/.nojekyll \
&& chmod +x .travis/write_cname.sh \
&& cd docs/ && ./../.travis/write_cname.sh \
&& cd ../
if [[ $TRAVIS_COMMIT_MESSAGE == *"--force-build"* ]];
then echo -e "\e[95mFORCE-BUILD: Building website." \
&& rm -rf docs \
&& yarn build \
&& touch docs/.nojekyll \
&& chmod +x .travis/write_cname.sh \
&& cd docs/ && ./../.travis/write_cname.sh \
&& cd ../;
fi
exit 0
================================================
FILE: .travis/checkIfCron.sh
================================================
test $TRAVIS_BRANCH != master && (test $TRAVIS_EVENT_TYPE = push || test $TRAVIS_EVENT_TYPE = pull_request) && echo -e "\e[95mNot a CRON triggered build, thus only checking for errors."
exit 0
================================================
FILE: .travis/forcepush.sh
================================================
if [[ $TRAVIS_COMMIT_MESSAGE == *"--force-build"* ]];
then echo -e "\e[95mFORCE-DEPLOY: Deploying to Repository" && chmod +x .travis/push.sh && ./.travis/push.sh;
fi
================================================
FILE: .travis/lintweb.sh
================================================
test $TRAVIS_EVENT_TYPE = push && test $TRAVIS_BRANCH = master \
&& echo -e "\e[95mMaster push, checking for script and web errors." \
&& yarn lint \
&& yarn format
exit 0
================================================
FILE: .travis/push.sh
================================================
#!/bin/bash
setup_git() {
git config --global user.email "30secondsofcode@gmail.com"
git config --global user.name "30secondsofcode"
}
commit_website_files() {
if [ $TRAVIS_EVENT_TYPE != "pull_request" ]; then
if [ $TRAVIS_BRANCH == "master" ]; then
echo "Committing to master branch..."
git checkout master
git add *
if [ $TRAVIS_EVENT_TYPE == "cron" ]; then
git commit --message "Travis build: $TRAVIS_BUILD_NUMBER [cron]"
elif [ $TRAVIS_EVENT_TYPE == "api" ]; then
git commit --message "Travis build: $TRAVIS_BUILD_NUMBER [custom]"
else
git commit --message "Travis build: $TRAVIS_BUILD_NUMBER [FORCED]"
fi
fi
fi
}
upload_files() {
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/30-seconds/30-seconds-of-interviews.git" master > /dev/null 2>&1
fi
fi
}
setup_git
commit_website_files
upload_files
================================================
FILE: .travis/write_cname.sh
================================================
echo "30secondsofinterviews.org" > CNAME
================================================
FILE: .travis.yml
================================================
jobs:
include:
- stage: conditional_build
notifications:
email:
on_success: [change]
on_failure: [change]
language: node_js
node_js:
- node
install:
- yarn install
before_script:
- chmod +x .travis/checkIfCron.sh && ./.travis/checkIfCron.sh
- chmod +x .travis/lintweb.sh && ./.travis/lintweb.sh
- yarn formatQuestions
- yarn extractor
- yarn builder
script:
- chmod +x .travis/build.sh && ./.travis/build.sh
after_script:
- test $TRAVIS_EVENT_TYPE = cron
&& echo -e "\e[95mDeploying to Repository"
&& chmod +x .travis/push.sh
&& ./.travis/push.sh
- chmod +x .travis/forcepush.sh && ./.travis/forcepush.sh
cache:
directories:
- node_modules
================================================
FILE: CODE_OF_CONDUCT.md
================================================
# 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 ns.fejes.stefan@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/
================================================
FILE: CONTRIBUTING.md
================================================
# Contribution guidelines
> 30 seconds of interviews is a community effort, so feel free to contribute in any way you can. Every contribution helps!
## There are several ways in which you can help:
* Submit [pull requests](https://github.com/fejes713/30-seconds-of-interviews/pulls) with new questions using our [template](https://github.com/fejes713/30-seconds-of-interviews/blob/master/question-template.md)
* Don't sweat if you don't know the answer to the question. Simply put **TODO** as an answer, and someone will try to answer it
* Try to keep answers **short** and **straight to the point**. They should be understandable in under 30 seconds
* Summarize your answer in short thesis in **good to hear** section.
* Every code snippet and html tag should be enclosed in markdown code blocks.
* Of course, 30 seconds is not enough to fully cover a specific topic so include up to three additional links that further describe the mentioned topic
* [Open issue](https://github.com/fejes713/30-seconds-of-interviews/issues/new)
* If you would like to see a new feature(eg. a new category of questions)
* If you noticed the wrong answer to a question
* If you noticed any other bug in our codebase
* Whenever you get an idea of the better answer to any question, please share it with us in a new [pull request](https://github.com/fejes713/30-seconds-of-interviews/pulls)
* If it's just a typo, we don't mind, submit a quick fix to it
* If you happen to find a better code example for the answer share it with us
## Additional information regarding the project and its structure
* **Do not modify** the `README.md` or `index.html` files. **Travis CI** will automatically build the README.md and index.html files when your pull request is merged. All changes to questions should be inside of `questions directory`
* We weren't sure how to name files inside `questions` directory. If you have any idea, let us know
* Currently, we support 4 categories of questions: _javascript_, _css_, _html_ and _node_
* We would like to expand the project to include more categories
* Some of the planned categories are _general_, _security_, _database_
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) 2018 Stefan Feješ
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: README.md
================================================
` elements that are siblings of `
` elements that are placed immediately after `
` elements that are siblings of `
` elements that are placed immediately after `