├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── README.md ├── _frontend-search.sh └── frontend-search.plugin.zsh /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at [INSERT EMAIL ADDRESS]. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | 78 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to start 2 | 3 | ```bash 4 | git clone https://github.com/willmendesneto/ngx-feature-toggle.git 5 | cd ngx-feature-toggle 6 | npm install 7 | npm start 8 | ``` 9 | 10 | # Running test 11 | 12 | ```bash 13 | npm test 14 | ``` 15 | 16 | ## Submitting Pull Requests 17 | 18 | **Please follow these basic steps to simplify pull request reviews - if you don't you'll probably just be asked to anyway.** 19 | 20 | - Please rebase your branch against the current master 21 | - Run `npm install` to make sure your development dependencies are up-to-date 22 | - Please ensure that the test suite passes **and** that code is lint free before submitting a PR by running: 23 | - `npm test` 24 | - If you've added new functionality, **please** include tests which validate its behaviour 25 | - Make reference to possible [issues](https://github.com/willmendesneto/ngx-feature-toggle/issues) on PR comment 26 | - This module follows Angular commit message standard, so please make sure that you are following this standard. 27 | 28 | ## Submitting bug reports 29 | 30 | - Please detail the affected browser(s) and operating system(s) 31 | - Please be sure to state which version of node **and** npm you're using 32 | - Please use try to simulate your bug based on [the demo on Stackblitz](https://ngx-copy-to-clipboard-sample.stackblitz.io)! 33 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Frontend search 2 | 3 | > Start your searches easily via CLI 4 | 5 | ## This repository was merged on Oh-My-Zsh project 6 | 7 | ## Why activate this repository again? 8 | 9 | Unfortunately, On-My-Zsh repository is not being updated regularly. So that I'm activating this repository again until some changes comes to the master. 10 | 11 | This solution is totally temporary and I'll create Pull Requests for all features, fixes or changes done in this repository. 12 | 13 | ## Rationale 14 | 15 | The idea for this script is to help searches in important doc contents from frontend. 16 | 17 | ## Instalation 18 | 19 | I will send a Pull Request with this plugin for .oh-my-zsh official repository. If accept them, it's only add in plugins list that exists in `.zshrc` file. 20 | 21 | For now, you can clone this repository and add in `custom/plugins` folder 22 | 23 | ```bash 24 | $ git clone https://github.com/willmendesneto/frontend-search.git ~/.oh-my-zsh/custom/plugins/frontend-search 25 | ``` 26 | 27 | After this, restart your terminal and frontend-search plugin is configurated in you CLI. 28 | 29 | ```bash 30 | ... 31 | plugins=( ... frontend-search) 32 | ... 33 | ``` 34 | 35 | ## Usage 36 | 37 | You can use the frontend-search plugin in these two forms: 38 | 39 | - `frontend [more terms if you want]` 40 | - ` [more terms if you want]` 41 | 42 | For example, these two are equivalent: 43 | 44 | ```zsh 45 | $ frontend angular dependency injection 46 | # Will turn into ... 47 | $ angular dependency injection 48 | ``` 49 | 50 | Available search contexts are: 51 | 52 | | context | URL | 53 | | ------------- | --------------------------------------------------------------------------- | 54 | | angular | `https://angular.io/docs/ts/latest/api/#!?query=` | 55 | | angularjs | `https://google.com/search?as_sitesearch=angularjs.org&as_q=` | 56 | | bem | `https://google.com/search?as_sitesearch=bem.info&as_q=` | 57 | | bootsnipp | `http://bootsnipp.com/search?q=` | 58 | | caniuse | `http://caniuse.com/#search=` | 59 | | codepen | `http://codepen.io/search?q=` | 60 | | compassdoc | `http://compass-style.org/search?q=` | 61 | | cssflow | `http://www.cssflow.com/search?q=` | 62 | | dartlang | `https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:` | 63 | | emberjs | `http://emberjs.com/api/#stp=1&stq=` | 64 | | fontello | `http://fontello.com/#search=` | 65 | | flowtype | `https://google.com/search?as_sitesearch=flow.org/en/docs/&as_q=` | 66 | | typescript | `https://google.com/search?as_sitesearch=www.typescriptlang.org/docs&as_q=` | 67 | | github | `https://github.com/search?q=` | 68 | | html5please | `http://html5please.com/#` | 69 | | jquery | `https://api.jquery.com/?s=` | 70 | | jestjs | `https://www.google.com/search?as_sitesearch=jestjs.io&as_q=` | 71 | | lodash | `https://devdocs.io/lodash/index#` | 72 | | mdn | `https://developer.mozilla.org/search?q=` | 73 | | nodejs | `https://www.google.com/search?as_sitesearch=nodejs.org/en/docs/&as_q=` | 74 | | npmjs | `https://www.npmjs.com/search?q=` | 75 | | qunit | `https://api.qunitjs.com/?s=` | 76 | | reactjs | `https://google.com/search?as_sitesearch=facebook.github.io/react&as_q=` | 77 | | smacss | `https://google.com/search?as_sitesearch=smacss.com&as_q=` | 78 | | stackoverflow | `http://stackoverflow.com/search?q=` | 79 | | unheap | `http://www.unheap.com/?s=` | 80 | | bundlephobia | `https://bundlephobia.com/result?p=` | 81 | | vuejs | `https://www.google.com/search?as_sitesearch=vuejs.org&as_q=` | 82 | 83 | ## New Features 84 | 85 | New features are coming soon. If you want to have another context, open an Issue and tell us! 86 | 87 | ## Author 88 | 89 | **Wilson Mendes (willmendesneto)** 90 | 91 | - 92 | - 93 | - 94 | -------------------------------------------------------------------------------- /_frontend-search.sh: -------------------------------------------------------------------------------- 1 | #compdef frontend 2 | 3 | zstyle ':completion:*:descriptions' format '%B%d%b' 4 | zstyle ':completion::complete:frontend:*:commands' group-name commands 5 | zstyle ':completion::complete:frontend:*:frontend_points' group-name frontend_points 6 | zstyle ':completion::complete:frontend::' list-grouped 7 | 8 | zmodload zsh/mapfile 9 | 10 | function _frontend() { 11 | local CONFIG=$HOME/.frontend-search 12 | local ret=1 13 | 14 | local -a commands 15 | local -a frontend_points 16 | 17 | frontend_points=( "${(f)mapfile[$CONFIG]//$HOME/~}" ) 18 | 19 | commands=( 20 | 'jquery: Search in jQuery website' 21 | 'jestjs: Search in Jest website' 22 | 'mdn: Search in MDN website' 23 | 'compassdoc: Search in COMPASS website' 24 | 'html5please: Search in HTML5 Please website' 25 | 'caniuse: Search in Can I Use website' 26 | 'dartlang: Search in Dart website' 27 | 'lodash: Search in Lo-Dash website' 28 | 'qunit: Search in Qunit website' 29 | 'fontello: Search in fontello website' 30 | 'typescript: Search in TypeScript website' 31 | 'flowtype: Search in Flowtype website' 32 | 'github: Search in GitHub website' 33 | 'bootsnipp: Search in bootsnipp website' 34 | 'cssflow: Search in cssflow website' 35 | 'codepen: Search in codepen website' 36 | 'unheap: Search in unheap website' 37 | 'bem: Search in BEM website' 38 | 'smacss: Search in SMACSS website' 39 | 'angular: Search in Angular.io website' 40 | 'angularjs: Search in docs.angularjs.org website' 41 | 'reactjs: Search in React website' 42 | 'emberjs: Search in Ember website' 43 | 'stackoverflow: Search in StackOverflow website' 44 | 'vuejs: Search in VueJS website' 45 | 'npmjs: Search in NPMJS website' 46 | 'nodejs: Search in NodeJS website' 47 | 'bundlephobia: Search in Bundlephobia website' 48 | ) 49 | 50 | _arguments -C \ 51 | '1: :->first_arg' \ 52 | '2: :->second_arg' && ret=0 53 | 54 | case $state in 55 | first_arg) 56 | _describe -t frontend_points "Warp points" frontend_points && ret=0 57 | _describe -t commands "Commands" commands && ret=0 58 | ;; 59 | second_arg) 60 | case $words[2] in 61 | jquery) 62 | _describe -t points "Warp points" frontend_points && ret=0 63 | ;; 64 | mdn) 65 | _describe -t points "Warp points" frontend_points && ret=0 66 | ;; 67 | compassdoc) 68 | _describe -t points "Warp points" frontend_points && ret=0 69 | ;; 70 | html5please) 71 | _describe -t points "Warp points" frontend_points && ret=0 72 | ;; 73 | caniuse) 74 | _describe -t points "Warp points" frontend_points && ret=0 75 | ;; 76 | dartlang) 77 | _describe -t points "Warp points" frontend_points && ret=0 78 | ;; 79 | lodash) 80 | _describe -t points "Warp points" frontend_points && ret=0 81 | ;; 82 | qunit) 83 | _describe -t points "Warp points" frontend_points && ret=0 84 | ;; 85 | fontello) 86 | _describe -t points "Warp points" frontend_points && ret=0 87 | ;; 88 | github) 89 | _describe -t points "Warp points" frontend_points && ret=0 90 | ;; 91 | bootsnipp) 92 | _describe -t points "Warp points" frontend_points && ret=0 93 | ;; 94 | cssflow) 95 | _describe -t points "Warp points" frontend_points && ret=0 96 | ;; 97 | codepen) 98 | _describe -t points "Warp points" frontend_points && ret=0 99 | ;; 100 | unheap) 101 | _describe -t points "Warp points" frontend_points && ret=0 102 | ;; 103 | bem) 104 | _describe -t points "Warp points" frontend_points && ret=0 105 | ;; 106 | smacss) 107 | _describe -t points "Warp points" frontend_points && ret=0 108 | ;; 109 | angularjs) 110 | _describe -t points "Warp points" frontend_points && ret=0 111 | ;; 112 | reactjs) 113 | _describe -t points "Warp points" frontend_points && ret=0 114 | ;; 115 | emberjs) 116 | _describe -t points "Warp points" frontend_points && ret=0 117 | ;; 118 | stackoverflow) 119 | _describe -t points "Warp points" frontend_points && ret=0 120 | ;; 121 | npmjs) 122 | _describe -t points "Warp points" frontend_points && ret=0 123 | ;; 124 | bundlephobia) 125 | _describe -t points "Warp points" frontend_points && ret=0 126 | ;; 127 | flowtype) 128 | _describe -t points "Warp points" frontend_points && ret=0 129 | ;; 130 | typescript) 131 | _describe -t points "Warp points" frontend_points && ret=0 132 | ;; 133 | vuejs) 134 | _describe -t points "Warp points" frontend_points && ret=0 135 | ;; 136 | nodejs) 137 | _describe -t points "Warp points" frontend_points && ret=0 138 | ;; 139 | jestjs) 140 | _describe -t points "Warp points" frontend_points && ret=0 141 | ;; 142 | esac 143 | ;; 144 | esac 145 | 146 | return $ret 147 | } 148 | 149 | _frontend "$@" 150 | 151 | # Local Variables: 152 | # mode: Shell-Script 153 | # sh-indentation: 2 154 | # indent-tabs-mode: nil 155 | # sh-basic-offset: 2 156 | # End: 157 | # vim: ft=zsh sw=2 ts=2 et -------------------------------------------------------------------------------- /frontend-search.plugin.zsh: -------------------------------------------------------------------------------- 1 | alias angular='frontend angular' 2 | alias angularjs='frontend angularjs' 3 | alias bem='frontend bem' 4 | alias bootsnipp='frontend bootsnipp' 5 | alias caniuse='frontend caniuse' 6 | alias codepen='frontend codepen' 7 | alias compassdoc='frontend compassdoc' 8 | alias cssflow='frontend cssflow' 9 | alias dartlang='frontend dartlang' 10 | alias emberjs='frontend emberjs' 11 | alias fontello='frontend fontello' 12 | alias html5please='frontend html5please' 13 | alias jquery='frontend jquery' 14 | alias jestjs='frontend jestjs' 15 | alias lodash='frontend lodash' 16 | alias mdn='frontend mdn' 17 | alias npmjs='frontend npmjs' 18 | alias qunit='frontend qunit' 19 | alias reactjs='frontend reactjs' 20 | alias smacss='frontend smacss' 21 | alias stackoverflow='frontend stackoverflow' 22 | alias unheap='frontend unheap' 23 | alias bundlephobia='frontend bundlephobia' 24 | alias github='frontend github' 25 | alias flowtype='frontend flowtype' 26 | alias typescript='frontend typescript' 27 | alias vuejs='frontend vuejs' 28 | alias nodejs='frontend nodejs' 29 | 30 | function frontend() { 31 | emulate -L zsh 32 | 33 | # define search context URLS 34 | typeset -A urls 35 | urls=( 36 | angular 'https://angular.io/docs/ts/latest/api/#!?query=' 37 | angularjs 'https://google.com/search?as_sitesearch=angularjs.org&as_q=' 38 | bem 'https://google.com/search?as_sitesearch=bem.info&as_q=' 39 | bootsnipp 'http://bootsnipp.com/search?q=' 40 | caniuse 'http://caniuse.com/#search=' 41 | codepen 'http://codepen.io/search?q=' 42 | compassdoc 'http://compass-style.org/search?q=' 43 | cssflow 'http://www.cssflow.com/search?q=' 44 | dartlang 'https://api.dartlang.org/apidocs/channels/stable/dartdoc-viewer/dart:' 45 | emberjs 'http://emberjs.com/api/#stp=1&stq=' 46 | fontello 'http://fontello.com/#search=' 47 | flowtype 'https://google.com/search?as_sitesearch=flow.org/en/docs/&as_q=' 48 | html5please 'http://html5please.com/#' 49 | jquery 'https://api.jquery.com/?s=' 50 | lodash 'https://devdocs.io/lodash/index#' 51 | mdn 'https://developer.mozilla.org/search?q=' 52 | npmjs 'https://www.npmjs.com/search?q=' 53 | nodejs 'https://www.google.com/search?as_sitesearch=nodejs.org/en/docs/&as_q=' 54 | qunit 'https://api.qunitjs.com/?s=' 55 | reactjs 'https://google.com/search?as_sitesearch=facebook.github.io/react&as_q=' 56 | smacss 'https://google.com/search?as_sitesearch=smacss.com&as_q=' 57 | stackoverflow 'http://stackoverflow.com/search?q=' 58 | typescript 'https://google.com/search?as_sitesearch=www.typescriptlang.org/docs&as_q=' 59 | unheap 'http://www.unheap.com/?s=' 60 | bundlephobia 'https://bundlephobia.com/result?p=' 61 | github 'https://github.com/search?q=' 62 | vuejs 'https://www.google.com/search?as_sitesearch=vuejs.org&as_q=' 63 | jestjs 'https://www.google.com/search?as_sitesearch=jestjs.io&as_q=' 64 | ) 65 | 66 | # show help for command list 67 | if [[ $# -lt 2 ]] 68 | then 69 | print -P "Usage: frontend %Ucontext%u %Uterm%u [...%Umore%u] (or just: %Ucontext%u %Uterm%u [...%Umore%u])" 70 | print -P "" 71 | print -P "%Uterm%u and what follows is what will be searched for in the %Ucontext%u website," 72 | print -P "and %Ucontext%u is one of the following:" 73 | print -P "" 74 | print -P " angular, angularjs, bem, bootsnipp, caniuse, codepen, compassdoc, cssflow," 75 | print -P " dartlang, emberjs, fontello, flowtype, github, html5please, jestjs, jquery, lodash," 76 | print -P " mdn, npmjs, nodejs, qunit, reactjs, smacss, stackoverflow, unheap, vuejs, bundlephobia" 77 | print -P "" 78 | print -P "For example: frontend npmjs mocha (or just: npmjs mocha)." 79 | print -P "" 80 | return 1 81 | fi 82 | 83 | # check whether the search context is supported 84 | if [[ -z "$urls[$1]" ]] 85 | then 86 | echo "Search context \"$1\" currently not supported." 87 | echo "" 88 | echo "Valid contexts are:" 89 | echo "" 90 | echo " angular, angularjs, bem, bootsnipp, caniuse, codepen, compassdoc, cssflow," 91 | echo " dartlang, emberjs, fontello, github, html5please, jest, jquery, lodash," 92 | echo " mdn, npmjs, nodejs, qunit, reactjs, smacss, stackoverflow, unheap, vuejs, bundlephobia" 93 | echo "" 94 | return 1 95 | fi 96 | 97 | # build search url: 98 | # join arguments passed with '+', then append to search context URL 99 | # TODO substitute for proper urlencode method 100 | url="${urls[$1]}${(j:+:)@[2,-1]}" 101 | 102 | echo "Opening $url ..." 103 | 104 | open_command "$url" 105 | } --------------------------------------------------------------------------------