diff --git a/COLLABORATING.md b/COLLABORATING.md
new file mode 100644
index 000000000..86677db56
--- /dev/null
+++ b/COLLABORATING.md
@@ -0,0 +1,23 @@
+# Collaborator team rules and guidelines for community moderation
+
+**As a contributor/member of the community, remember that you can always open issues about moderation and problems with how community moderation is done. We are always open to constructive criticism and feedback!**
+
+## Responsibilities of a collaborator
+
+As a member of the team that manages **30 seconds of python code**, you have the following responsibilities:
+
+- **Be part of the conversation in the issue tracker.** That includes (but is not limited to) helping out new members, discussing new features and explaining decisions to people.
+- **Review pull requests.** You do not have to read through all of the pull requests and review them, but taking the time each day to review a few can help a great deal.
+- **Be civil and polite.** If you are about to lose your temper, take a step back and do something else. We want our interactions with the community to be polite so that more people can join the project and contribute in any way they can. Remember to always thank contributors for their help, even if it's minor changes or changes that did not make it into the project. This way we can reward and encourage people to keep being part of the community.
+- **Contribute when you want, moderate when you can.** If you have a lot on your plate outside of this project, it's alright. It's better to take a break for a few days rather than hastily deal with issues and pull requests that might break things.
+
+## Guidelines for merging pull requests and making changes to the project
+
+- **[Usual guidelines](https://github.com/30-seconds/30-seconds-of-python-code/blob/master/CONTRIBUTING.md) apply.** Make sure to follow them, like everybody else.
+- **For a pull request to be considered ready to merge, there should be at least 2 (preferably 3) reviews approving it for merge.** There are, however, certain exceptions:
+ - **If a pull request only fixes typos**, there is no need to wait for a second reviewer (unless you are not certain these were not typos in the first place).
+ - **If a pull request only clarifies a snippet's description or enforces the style guide for an existing snippet**, you might be able to merge it without getting a second reviewer to review it, but only if you are certain about it.
+ - **Make sure pull requests pass the Travis CI build**, otherwise try and find out what's wrong and inform the author of the pull request.
+ - **Changes to build scripts, guidelines and things that might break the processes we have in place need to be reviewed by [@Chalarangelo](https://github.com/Chalarangelo) or [@fejes713](https://github.com/fejes713)**.
+- **If you make changes or additions to existing snippets or if you want to add your own snippets, you will go through the pull request process that everyone else goes.** Exceptions apply similarly to the ones mentioned above about merging pull requests (i.e. typos, description clarification and the way script and build process changes are handled). Pull requests suggested by collaborators should be reviewed by at least two other collaborators to be considered ready to merge.
+- **Pull requests that are inactive for over a week should be closed or put on hold.**
\ No newline at end of file
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 1fcc4b30c..72d5df377 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -4,11 +4,11 @@
Here's what you can do to help:
-- [Open issues](https://github.com/kriadmin/30-seconds-of-python-code/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/kriadmin/30-seconds-of-python-code/issues) or talking on our [gitter channel](https://gitter.im/30-seconds-of-python-code/Lobby).
-- Submit [pull requests](https://github.com/kriadmin/30-seconds-of-python-code/pulls) with snippets you have created (see below for guidelines).
+- [Open issues](https://github.com/30-seconds/30-seconds-of-python-code/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-python-code/issues) or talking on our [gitter channel](https://gitter.im/30-seconds-of-python-code/Lobby).
+- Submit [pull requests](https://github.com/30-seconds/30-seconds-of-python-code/pulls) with snippets you have created (see below for guidelines).
- Fix typos in existing snippets, improve snippet descriptions and explanations or provide better examples.
-- Before submitting a PR for any new snippets go through [this](https://github.com/kriadmin/30-seconds-of-python-code/projects/1) project. If your snippet is not there, then go ahead and submit a PR. Else if it is in the done column, sorry it has been already implemented. If it is in any other column submit a PR and give the card's link in the description section of PR.
+- Before submitting a PR for any new snippets go through [this](https://github.com/30-seconds/30-seconds-of-python-code/projects/1) project. If your snippet is not there, then go ahead and submit a PR. Else if it is in the done column, sorry it has been already implemented. If it is in any other column submit a PR and give the card's link in the description section of PR.
- **Working on your first Pull Request?** You can learn how from this *free* series [How to Contribute to an Open Source Project on GitHub](https://egghead.io/series/how-to-contribute-to-an-open-source-project-on-github)
### Snippet submission and Pull request guidelines
@@ -25,7 +25,7 @@ Here's what you can do to help:
- **Snippet descriptions** must be short and to the point. Try to explain *what* the snippet does and *how* the snippet works and what **inbuilt** features/modules are used. Remember to include what functions you are using and why.
- Follow snippet descriptions with an empty line.
- **Snippets _CAN NOT_ use any external modules**. Only the modules and function inbuilt in `python 3.6` shall be used.
-- **Snippet code** must be enclosed inside ` ```python ` and ` ``` `.
+- **Snippet code** must be enclosed inside ` ```py ` and ` ``` `.
- Remember to start your snippet's code on a new line below the opening backticks.
- You can write the code in any style you like but eventually it will be formated by our prettifier so the formatting will change. Just make sure to have consistent spacing.
- Try to keep your snippets' code short and to the point. Use modern techniques and features. Make sure to test your code before submitting.
@@ -37,33 +37,4 @@ Here's what you can do to help:
- Snippets *should* be abstract enough to be applied to different scenarios.
- It is not mandatory but highly appreciated if you provide **test cases** and/or performance tests.
- You can start creating a new snippet, by using the [snippet template](snippet_template.md) to format your snippets.
-- Updating the README.md file should only be done by altering the scripts in the **scripts** folder or altering their relative static parts in the **static-parts** folder.
-- You may tag your snippet in tag_databse although it is _not_ necessary.
-- You may add your name as `[Name][@github_username]` to the contributor database. If the snippet already exists and you are making changes to it you can add your name at the last seperated by a comma.
-
+- Updating the README.md file should only be done by altering the scripts in the **scripts** folder or altering their relative static parts in the **static-parts** folder.
\ No newline at end of file
diff --git a/website/Procfile b/website/Procfile
deleted file mode 100644
index 80a980e84..000000000
--- a/website/Procfile
+++ /dev/null
@@ -1 +0,0 @@
-web: gunicorn run:app
\ No newline at end of file
diff --git a/website/app/__init__.py b/website/app/__init__.py
deleted file mode 100644
index 6c5009aa4..000000000
--- a/website/app/__init__.py
+++ /dev/null
@@ -1,5 +0,0 @@
-from flask import Flask
-
-app = Flask(__name__)
-
-from app import routes,vote
\ No newline at end of file
diff --git a/website/app/etc/hosts b/website/app/etc/hosts
deleted file mode 100644
index 62a8cca88..000000000
--- a/website/app/etc/hosts
+++ /dev/null
@@ -1,2 +0,0 @@
-127.0.0.1 localwebsite
-127.0.0.1 blog.localwebsite
\ No newline at end of file
diff --git a/website/app/prism.css b/website/app/prism.css
deleted file mode 100644
index 5bf332cb8..000000000
--- a/website/app/prism.css
+++ /dev/null
@@ -1,124 +0,0 @@
-/* PrismJS 1.10.0
-http://prismjs.com/download.html?themes=prism-okaidia&languages=python */
-/**
- * okaidia theme for JavaScript, CSS and HTML
- * Loosely based on Monokai textmate theme by http://www.monokai.nl/
- * @author ocodia
- */
-
-code[class*="language-"],
-pre[class*="language-"] {
- color: #f8f8f2;
- background: none;
- text-shadow: 0 1px rgba(0, 0, 0, 0.3);
- font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
- text-align: left;
- white-space: pre;
- word-spacing: normal;
- word-break: normal;
- word-wrap: normal;
- line-height: 1.5;
-
- -moz-tab-size: 4;
- -o-tab-size: 4;
- tab-size: 4;
-
- -webkit-hyphens: none;
- -moz-hyphens: none;
- -ms-hyphens: none;
- hyphens: none;
-}
-
-/* Code blocks */
-pre[class*="language-"] {
- padding: 1em;
- margin: .5em 0;
- overflow: auto;
- border-radius: 0.3em;
-}
-
-:not(pre) > code[class*="language-"],
-pre[class*="language-"] {
- background: #272822;
-}
-
-/* Inline code */
-:not(pre) > code[class*="language-"] {
- padding: .1em;
- border-radius: .3em;
- white-space: normal;
-}
-
-.token.comment,
-.token.prolog,
-.token.doctype,
-.token.cdata {
- color: slategray;
-}
-
-.token.punctuation {
- color: #f8f8f2;
-}
-
-.namespace {
- opacity: .7;
-}
-
-.token.property,
-.token.tag,
-.token.constant,
-.token.symbol,
-.token.deleted {
- color: #f92672;
-}
-
-.token.boolean,
-.token.number {
- color: #ae81ff;
-}
-
-.token.selector,
-.token.attr-name,
-.token.string,
-.token.char,
-.token.builtin,
-.token.inserted {
- color: #a6e22e;
-}
-
-.token.operator,
-.token.entity,
-.token.url,
-.language-css .token.string,
-.style .token.string,
-.token.variable {
- color: #f8f8f2;
-}
-
-.token.atrule,
-.token.attr-value,
-.token.function {
- color: #e6db74;
-}
-
-.token.keyword {
- color: #66d9ef;
-}
-
-.token.regex,
-.token.important {
- color: #fd971f;
-}
-
-.token.important,
-.token.bold {
- font-weight: bold;
-}
-.token.italic {
- font-style: italic;
-}
-
-.token.entity {
- cursor: help;
-}
-
diff --git a/website/app/prism.js b/website/app/prism.js
deleted file mode 100644
index b94bbedde..000000000
--- a/website/app/prism.js
+++ /dev/null
@@ -1,4 +0,0 @@
-/* PrismJS 1.10.0
-http://prismjs.com/download.html?themes=prism-okaidia&languages=python */
-var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\blang(?:uage)?-(\w+)\b/i,t=0,n=_self.Prism={manual:_self.Prism&&_self.Prism.manual,disableWorkerMessageHandler:_self.Prism&&_self.Prism.disableWorkerMessageHandler,util:{encode:function(e){return e instanceof r?new r(e.type,n.util.encode(e.content),e.alias):"Array"===n.util.type(e)?e.map(n.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(!(w instanceof s)){h.lastIndex=0;var _=h.exec(w),P=1;if(!_&&m&&b!=t.length-1){if(h.lastIndex=k,_=h.exec(e),!_)break;for(var A=_.index+(d?_[1].length:0),j=_.index+_[0].length,x=b,O=k,N=t.length;N>x&&(j>O||!t[x].type&&!t[x-1].greedy);++x)O+=t[x].length,A>=O&&(++b,k=O);if(t[b]instanceof s||t[x-1].greedy)continue;P=x-b,w=e.slice(k,O),_.index-=k}if(_){d&&(p=_[1].length);var A=_.index+p,_=_[0].slice(p),j=A+_.length,S=w.slice(0,A),C=w.slice(j),M=[b,P];S&&(++b,k+=S.length,M.push(S));var E=new s(g,f?n.tokenize(_,f):_,y,_,m);if(M.push(E),C&&M.push(C),Array.prototype.splice.apply(t,M),1!=P&&n.matchGrammar(e,t,r,b,k,!0,g),i)break}else if(i)break}}}}},tokenize:function(e,t){var r=[e],a=t.rest;if(a){for(var l in a)t[l]=a[l];delete t.rest}return n.matchGrammar(e,r,t,0,0,!1),r},hooks:{all:{},add:function(e,t){var r=n.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){var r=n.hooks.all[e];if(r&&r.length)for(var a,l=0;a=r[l++];)a(t)}}},r=n.Token=function(e,t,n,r,a){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length,this.greedy=!!a};if(r.stringify=function(e,t,a){if("string"==typeof e)return e;if("Array"===n.util.type(e))return e.map(function(n){return r.stringify(n,t,e)}).join("");var l={type:e.type,content:r.stringify(e.content,t,a),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:a};if(e.alias){var i="Array"===n.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(l.classes,i)}n.hooks.run("wrap",l);var o=Object.keys(l.attributes).map(function(e){return e+'="'+(l.attributes[e]||"").replace(/"/g,""")+'"'}).join(" ");return"<"+l.tag+' class="'+l.classes.join(" ")+'"'+(o?" "+o:"")+">"+l.content+""+l.tag+">"},!_self.document)return _self.addEventListener?(n.disableWorkerMessageHandler||_self.addEventListener("message",function(e){var t=JSON.parse(e.data),r=t.language,a=t.code,l=t.immediateClose;_self.postMessage(n.highlight(a,n.languages[r],r)),l&&_self.close()},!1),_self.Prism):_self.Prism;var a=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return a&&(n.filename=a.src,n.manual||a.hasAttribute("data-manual")||("loading"!==document.readyState?window.requestAnimationFrame?window.requestAnimationFrame(n.highlightAll):window.setTimeout(n.highlightAll,16):document.addEventListener("DOMContentLoaded",n.highlightAll))),_self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism);
-Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},"triple-quoted-string":{pattern:/("""|''')[\s\S]+?\1/,greedy:!0,alias:"string"},string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"function":{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},keyword:/\b(?:as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|nonlocal|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,"boolean":/\b(?:True|False|None)\b/,number:/\b-?(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not)\b/,punctuation:/[{}[\];(),.:]/};
diff --git a/website/app/routes.py b/website/app/routes.py
deleted file mode 100644
index 44bc4f1a0..000000000
--- a/website/app/routes.py
+++ /dev/null
@@ -1,23 +0,0 @@
-from flask import render_template, redirect ,request, url_for
-from app import app, vote, vote_data
-
-@app.route('/')
-@app.route('/index')
-@app.route('/index/')
-def index():
- return render_template('index.html',vote={})
-'''
-For future when we have logins
-@app.route('/',methods=['POST'])
-@app.route('/index',methods=['POST'])
-@app.route('/index/',methods=['POST'])
-def post():
- try:
- vote.vote(request.form['submit'])
- except Exception as e:
- return render_template('index.html', vote=vote_data.vote_data(),err_400=True,message=e)
- return redirect(f"/#{request.form['submit']}",code=302)
-'''
-
-
-
diff --git a/website/app/snippets b/website/app/snippets
deleted file mode 100644
index 9b16aa4f6..000000000
--- a/website/app/snippets
+++ /dev/null
@@ -1,3 +0,0 @@
-keys_only
-values_only
-all_unique
\ No newline at end of file
diff --git a/website/app/static/css/prism.css b/website/app/static/css/prism.css
deleted file mode 100644
index 2a173aeee..000000000
--- a/website/app/static/css/prism.css
+++ /dev/null
@@ -1,1229 +0,0 @@
-:root {
- --f-col:#111;
- --f-col2:#444;
- --b-col:#f8f8f8;
- --b-col2:#f0f0f0;
- --blq-col:#f57c00;
- --pre-col:#1565c0;
- --br-col:#aaa;
- --br-col2:#ddd;
- --h-ratio:1.19;
- --u-m:.5rem;
- --u-p:.5rem;
- --u-br-r:.125rem;
- --a-l-col:#0277bd;
- --a-v-col:#01579b
- }
- html {
- font-size:16px
- }
- a,b,del,em,i,ins,q,span,strong,u {
- font-size:1em
- }
- html,* {
- font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Ubuntu,"Helvetica Neue",Helvetica,sans-serif;
- line-height:1.5;
- -webkit-text-size-adjust:100%
- }
- * {
- font-size:1rem
- }
- body {
- margin:0;
- color:var(--f-col);
- background:var(--b-col)
- }
- details {
- display:block
- }
- summary {
- display:list-item
- }
- abbr[title] {
- border-bottom:none;
- text-decoration:underline dotted
- }
- input {
- overflow:visible
- }
- img {
- max-width:100%;
- height:auto
- }
- h1,h2,h3,h4,h5,h6 {
- line-height:1.2;
- margin:calc(1.5 * var(--u-m)) var(--u-m);
- font-weight:500
- }
- h1 small,h2 small,h3 small,h4 small,h5 small,h6 small {
- color:var(--f-col2);
- display:block;
- margin-top:-.25rem
- }
- h1 {
- font-size:calc(1rem * var(--h-ratio) * var(--h-ratio) * var(--h-ratio) * var(--h-ratio))
- }
- h2 {
- font-size:calc(1rem * var(--h-ratio) * var(--h-ratio) * var(--h-ratio))
- }
- h3 {
- font-size:calc(1rem * var(--h-ratio) * var(--h-ratio))
- }
- h4 {
- font-size:calc(1rem * var(--h-ratio))
- }
- h5 {
- font-size:1rem
- }
- h6 {
- font-size:calc(1rem/ var(--h-ratio))
- }
- p {
- margin:var(--u-m)
- }
- ol,ul {
- margin:var(--u-m);
- padding-left:calc(2 * var(--u-m))
- }
- b,strong {
- font-weight:700
- }
- hr {
- box-sizing:content-box;
- border:0;
- line-height:1.25em;
- margin:var(--u-m);
- height:.0625rem;
- background:linear-gradient(to right,transparent,var(--br-col) 20%,var(--br-col) 80%,transparent)
- }
- blockquote {
- display:block;
- position:relative;
- font-style:italic;
- color:var(--f-col2);
- margin:var(--u-m);
- padding:calc(3 * var(--u-p));
- border:.0625rem solid var(--br-col2);
- border-left:.375rem solid var(--blq-col);
- border-radius:0 var(--u-br-r) var(--u-br-r) 0
- }
- blockquote:before {
- position:absolute;
- top:calc(0rem - var(--u-p));
- left:0;
- font-family:sans-serif;
- font-size:3rem;
- font-weight:700;
- content:"\201c";
- color:var(--blq-col)
- }
- blockquote[cite]:after {
- font-style:normal;
- font-size:.75em;
- font-weight:700;
- content:"\a— " attr(cite);
- white-space:pre
- }
- code,kbd,pre,samp {
- font-family:Menlo,Consolas,monospace;
- font-size:.85em
- }
- code {
- background:var(--b-col2);
- border-radius:var(--u-br-r);
- padding:calc(var(--u-p)/ 4) calc(var(--u-p)/ 2)
- }
- kbd {
- background:var(--f-col);
- color:var(--b-col);
- border-radius:var(--u-br-r);
- padding:calc(var(--u-p)/ 4) calc(var(--u-p)/ 2)
- }
- pre {
- overflow:auto;
- background:var(--b-col2);
- padding:calc(1.5 * var(--u-p));
- margin:var(--u-m);
- border:.0625rem solid var(--br-col2);
- border-left:.25rem solid var(--pre-col);
- border-radius:0 var(--u-br-r) var(--u-br-r) 0
- }
- sup,sub,code,kbd {
- line-height:0;
- position:relative;
- vertical-align:baseline
- }
- small,sup,sub,figcaption {
- font-size:.75em
- }
- sup {
- top:-.5em
- }
- sub {
- bottom:-.25em
- }
- figure {
- margin:var(--u-m)
- }
- figcaption {
- color:var(--f-col2)
- }
- a {
- text-decoration:none
- }
- a:link {
- color:var(--a-l-col)
- }
- a:visited {
- color:var(--a-v-col)
- }
- a:hover,a:focus {
- text-decoration:underline
- }
- .container {
- margin:0 auto;
- padding:0 calc(1.5 * var(--u-p))
- }
- .row {
- box-sizing:border-box;
- display:flex;
- flex:0 1 auto;
- flex-flow:row wrap
- }
- .col-sm,[class^='col-sm-'],[class^='col-sm-o-'] {
- flex:0 0 auto;
- padding:0 calc(var(--u-p)/ 2)
- }
- .col-sm {
- max-width:100%;
- flex-grow:1;
- flex-basis:0
- }
- .col-sm-1 {
- max-width:8.33333%;
- flex-basis:8.33333%
- }
- .col-sm-o-0 {
- margin-left:0
- }
- .col-sm-2 {
- max-width:16.66667%;
- flex-basis:16.66667%
- }
- .col-sm-o-1 {
- margin-left:8.33333%
- }
- .col-sm-3 {
- max-width:25%;
- flex-basis:25%
- }
- .col-sm-o-2 {
- margin-left:16.66667%
- }
- .col-sm-4 {
- max-width:33.33333%;
- flex-basis:33.33333%
- }
- .col-sm-o-3 {
- margin-left:25%
- }
- .col-sm-5 {
- max-width:41.66667%;
- flex-basis:41.66667%
- }
- .col-sm-o-4 {
- margin-left:33.33333%
- }
- .col-sm-6 {
- max-width:50%;
- flex-basis:50%
- }
- .col-sm-o-5 {
- margin-left:41.66667%
- }
- .col-sm-7 {
- max-width:58.33333%;
- flex-basis:58.33333%
- }
- .col-sm-o-6 {
- margin-left:50%
- }
- .col-sm-8 {
- max-width:66.66667%;
- flex-basis:66.66667%
- }
- .col-sm-o-7 {
- margin-left:58.33333%
- }
- .col-sm-9 {
- max-width:75%;
- flex-basis:75%
- }
- .col-sm-o-8 {
- margin-left:66.66667%
- }
- .col-sm-10 {
- max-width:83.33333%;
- flex-basis:83.33333%
- }
- .col-sm-o-9 {
- margin-left:75%
- }
- .col-sm-11 {
- max-width:91.66667%;
- flex-basis:91.66667%
- }
- .col-sm-o-10 {
- margin-left:83.33333%
- }
- .col-sm-12 {
- max-width:100%;
- flex-basis:100%
- }
- .col-sm-o-11 {
- margin-left:91.66667%
- }
- .col-sm-n {
- order:initial
- }
- .col-sm-f {
- order:-999
- }
- .col-sm-l {
- order:999
- }
- @media screen and (min-width: 768px) {
- .col-md,[class^='col-md-'],[class^='col-md-o-'] {
- flex:0 0 auto;
- padding:0 calc(var(--u-p)/ 2)
- }
- .col-md {
- max-width:100%;
- flex-grow:1;
- flex-basis:0
- }
- .col-md-1 {
- max-width:8.33333%;
- flex-basis:8.33333%
- }
- .col-md-o-0 {
- margin-left:0
- }
- .col-md-2 {
- max-width:16.66667%;
- flex-basis:16.66667%
- }
- .col-md-o-1 {
- margin-left:8.33333%
- }
- .col-md-3 {
- max-width:25%;
- flex-basis:25%
- }
- .col-md-o-2 {
- margin-left:16.66667%
- }
- .col-md-4 {
- max-width:33.33333%;
- flex-basis:33.33333%
- }
- .col-md-o-3 {
- margin-left:25%
- }
- .col-md-5 {
- max-width:41.66667%;
- flex-basis:41.66667%
- }
- .col-md-o-4 {
- margin-left:33.33333%
- }
- .col-md-6 {
- max-width:50%;
- flex-basis:50%
- }
- .col-md-o-5 {
- margin-left:41.66667%
- }
- .col-md-7 {
- max-width:58.33333%;
- flex-basis:58.33333%
- }
- .col-md-o-6 {
- margin-left:50%
- }
- .col-md-8 {
- max-width:66.66667%;
- flex-basis:66.66667%
- }
- .col-md-o-7 {
- margin-left:58.33333%
- }
- .col-md-9 {
- max-width:75%;
- flex-basis:75%
- }
- .col-md-o-8 {
- margin-left:66.66667%
- }
- .col-md-10 {
- max-width:83.33333%;
- flex-basis:83.33333%
- }
- .col-md-o-9 {
- margin-left:75%
- }
- .col-md-11 {
- max-width:91.66667%;
- flex-basis:91.66667%
- }
- .col-md-o-10 {
- margin-left:83.33333%
- }
- .col-md-12 {
- max-width:100%;
- flex-basis:100%
- }
- .col-md-o-11 {
- margin-left:91.66667%
- }
- .col-md-n {
- order:initial
- }
- .col-md-f {
- order:-999
- }
- .col-md-l {
- order:999
- }
- }
- @media screen and (min-width: 1280px) {
- .col-lg,[class^='col-lg-'],[class^='col-lg-o-'] {
- flex:0 0 auto;
- padding:0 calc(var(--u-p)/ 2)
- }
- .col-lg {
- max-width:100%;
- flex-grow:1;
- flex-basis:0
- }
- .col-lg-1 {
- max-width:8.33333%;
- flex-basis:8.33333%
- }
- .col-lg-o-0 {
- margin-left:0
- }
- .col-lg-2 {
- max-width:16.66667%;
- flex-basis:16.66667%
- }
- .col-lg-o-1 {
- margin-left:8.33333%
- }
- .col-lg-3 {
- max-width:25%;
- flex-basis:25%
- }
- .col-lg-o-2 {
- margin-left:16.66667%
- }
- .col-lg-4 {
- max-width:33.33333%;
- flex-basis:33.33333%
- }
- .col-lg-o-3 {
- margin-left:25%
- }
- .col-lg-5 {
- max-width:41.66667%;
- flex-basis:41.66667%
- }
- .col-lg-o-4 {
- margin-left:33.33333%
- }
- .col-lg-6 {
- max-width:50%;
- flex-basis:50%
- }
- .col-lg-o-5 {
- margin-left:41.66667%
- }
- .col-lg-7 {
- max-width:58.33333%;
- flex-basis:58.33333%
- }
- .col-lg-o-6 {
- margin-left:50%
- }
- .col-lg-8 {
- max-width:66.66667%;
- flex-basis:66.66667%
- }
- .col-lg-o-7 {
- margin-left:58.33333%
- }
- .col-lg-9 {
- max-width:75%;
- flex-basis:75%
- }
- .col-lg-o-8 {
- margin-left:66.66667%
- }
- .col-lg-10 {
- max-width:83.33333%;
- flex-basis:83.33333%
- }
- .col-lg-o-9 {
- margin-left:75%
- }
- .col-lg-11 {
- max-width:91.66667%;
- flex-basis:91.66667%
- }
- .col-lg-o-10 {
- margin-left:83.33333%
- }
- .col-lg-12 {
- max-width:100%;
- flex-basis:100%
- }
- .col-lg-o-11 {
- margin-left:91.66667%
- }
- .col-lg-n {
- order:initial
- }
- .col-lg-f {
- order:-999
- }
- .col-lg-l {
- order:999
- }
- }
- :root {
- --cd-b-col:#f8f8f8;
- --cd-f-col:#111;
- --cd-br-col:#ddd
- }
- .card {
- display:flex;
- flex-direction:column;
- justify-content:space-between;
- align-self:center;
- position:relative;
- width:100%;
- background:var(--cd-b-col);
- color:var(--cd-f-col);
- border:.0625rem solid var(--cd-br-col);
- border-radius:var(--u-br-r);
- margin:var(--u-m);
- overflow:hidden
- }
- @media screen and (min-width: 320px) {
- .card {
- max-width:320px
- }
- }
- .card>.section {
- background:var(--cd-b-col);
- color:var(--cd-f-col);
- box-sizing:border-box;
- margin:0;
- border:0;
- border-radius:0;
- border-bottom:.0625rem solid var(--cd-br-col);
- padding:var(--u-p);
- width:100%
- }
- .card>.section.media {
- height:200px;
- padding:0;
- -o-object-fit:cover;
- object-fit:cover
- }
- .card>.section:last-child {
- border-bottom:0
- }
- .card.fluid {
- max-width:100%;
- width:auto
- }
- .card>.section.double-padded {
- padding:calc(1.5 * var(--u-p))
- }
- .card {
- box-shadow:0 1.25rem 2.5rem -0.625rem rgba(0,32,64,0.1)
- }
- .card>h3.section.double-padded {
- padding:calc(3 * var(--u-p))
- }
- .card>.section.double-padded>p {
- margin:var(--u-m) calc(var(--u-m)/ 2)
- }
- .card+.card {
- margin-top:calc(5 * var(--u-m))
- }
- :root {
- --frm-b-col:#f0f0f0;
- --frm-f-col:#111;
- --frm-br-col:#ddd;
- --in-b-col:#f8f8f8;
- --in-f-col:#111;
- --in-br-col:#ddd;
- --in-fc-col:#0288d1;
- --in-inv-col:#d32f2f;
- --btn-b-col:#e2e2e2;
- --btn-h-b-col:#dcdcdc;
- --btn-f-col:#212121;
- --btn-br-col:transparent;
- --btn-h-br-col:transparent;
- --btn-grp-br-col:rgba(124,124,124,0.54)
- }
- form {
- background:var(--frm-b-col);
- color:var(--frm-f-col);
- border:.0625rem solid var(--frm-br-col);
- border-radius:var(--u-br-r);
- margin:var(--u-m);
- padding:calc(2 * var(--u-p)) var(--u-p)
- }
- fieldset {
- border:.0625rem solid var(--frm-br-col);
- border-radius:var(--u-br-r);
- margin:calc(var(--u-m)/ 4);
- padding:var(--u-p)
- }
- legend {
- box-sizing:border-box;
- display:table;
- max-width:100%;
- white-space:normal;
- font-weight:700;
- padding:calc(var(--u-p)/ 2)
- }
- label {
- padding:calc(var(--u-p)/ 2) var(--u-p)
- }
- .input-group {
- display:inline-block
- }
- [type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button {
- height:auto
- }
- [type="search"] {
- -webkit-appearance:textfield;
- outline-offset:-2px
- }
- [type="search"]::-webkit-search-cancel-button,[type="search"]::-webkit-search-decoration {
- -webkit-appearance:none
- }
- input:not([type]),[type="text"],[type="email"],[type="number"],[type="search"],[type="password"],[type="url"],[type="tel"],[type="checkbox"],[type="radio"],textarea,select {
- box-sizing:border-box;
- background:var(--in-b-col);
- color:var(--in-f-col);
- border:.0625rem solid var(--in-br-col);
- border-radius:var(--u-br-r);
- margin:calc(var(--u-m)/ 2);
- padding:var(--u-p) calc(1.5 * var(--u-p))
- }
- input:not([type="button"]):not([type="submit"]):not([type="reset"]):hover,input:not([type="button"]):not([type="submit"]):not([type="reset"]):focus,textarea:hover,textarea:focus,select:hover,select:focus {
- border-color:var(--in-fc-col);
- box-shadow:none
- }
- input:not([type="button"]):not([type="submit"]):not([type="reset"]):invalid,input:not([type="button"]):not([type="submit"]):not([type="reset"]):focus:invalid,textarea:invalid,textarea:focus:invalid,select:invalid,select:focus:invalid {
- border-color:var(--in-inv-col);
- box-shadow:none
- }
- input:not([type="button"]):not([type="submit"]):not([type="reset"])[readonly],textarea[readonly],select[readonly] {
- background:var(--b-col2)
- }
- select {
- max-width:100%
- }
- option {
- overflow:hidden;
- text-overflow:ellipsis
- }
- [type="checkbox"],[type="radio"] {
- -webkit-appearance:none;
- -moz-appearance:none;
- appearance:none;
- position:relative;
- height:calc(1rem + var(--u-p) / 2);
- width:calc(1rem + var(--u-p) / 2);
- vertical-align:text-bottom;
- padding:0;
- flex-basis:calc(1rem + var(--u-p) / 2)!important;
- flex-grow:0!important
- }
- [type="checkbox"]:checked:before,[type="radio"]:checked:before {
- position:absolute
- }
- [type="checkbox"]:checked:before {
- content:'\2713';
- font-family:sans-serif;
- font-size:calc(1rem + var(--u-p) / 2);
- top:calc(0rem - var(--u-p));
- left:calc(var(--u-p)/ 4)
- }
- [type="radio"] {
- border-radius:100%
- }
- [type="radio"]:checked:before {
- border-radius:100%;
- content:'';
- top:calc(.0625rem + var(--u-p) / 2);
- left:calc(.0625rem + var(--u-p) / 2);
- background:var(--in-f-col);
- width:0.5rem;
- height:0.5rem
- }
- :placeholder-shown {
- color:var(--in-f-col)
- }
- ::-ms-placeholder {
- color:var(--in-f-col);
- opacity:0.54
- }
- button::-moz-focus-inner,[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner {
- border-style:none;
- padding:0
- }
- button,html [type="button"],[type="reset"],[type="submit"] {
- -webkit-appearance:button
- }
- button {
- overflow:visible;
- text-transform:none
- }
- button,[type="button"],[type="submit"],[type="reset"],a.button,label.button,.button,a[role="button"],label[role="button"],[role="button"] {
- display:inline-block;
- background:var(--btn-b-col);
- color:var(--btn-f-col);
- border:.0625rem solid var(--btn-br-col);
- border-radius:var(--u-br-r);
- padding:var(--u-p) calc(1.5 * var(--u-p));
- margin:var(--u-m);
- text-decoration:none;
- cursor:pointer;
- transition:background 0.3s
- }
- button:hover,button:focus,[type="button"]:hover,[type="button"]:focus,[type="submit"]:hover,[type="submit"]:focus,[type="reset"]:hover,[type="reset"]:focus,a.button:hover,a.button:focus,label.button:hover,label.button:focus,.button:hover,.button:focus,a[role="button"]:hover,a[role="button"]:focus,label[role="button"]:hover,label[role="button"]:focus,[role="button"]:hover,[role="button"]:focus {
- background:var(--btn-h-b-col);
- border-color:var(--btn-h-br-col)
- }
- input:disabled,input[disabled],textarea:disabled,textarea[disabled],select:disabled,select[disabled],button:disabled,button[disabled],.button:disabled,.button[disabled],[role="button"]:disabled,[role="button"][disabled] {
- cursor:not-allowed;
- opacity:.75
- }
- .button-group {
- display:flex;
- border:.0625rem solid var(--btn-grp-br-col);
- border-radius:var(--u-br-r);
- margin:var(--u-m)
- }
- .button-group>button,.button-group [type="button"],.button-group>[type="submit"],.button-group>[type="reset"],.button-group>.button,.button-group>[role="button"] {
- margin:0;
- max-width:100%;
- flex:1 1 auto;
- text-align:center;
- border:0;
- border-radius:0;
- box-shadow:none
- }
- .button-group>:not(:first-child) {
- border-left:.0625rem solid var(--btn-grp-br-col)
- }
- @media screen and (max-width: 767px) {
- .button-group {
- flex-direction:column
- }
- .button-group>:not(:first-child) {
- border:0;
- border-top:.0625rem solid var(--btn-grp-br-col)
- }
- }
- button.primary,[type="button"].primary,[type="submit"].primary,[type="reset"].primary,.button.primary,[role="button"].primary {
- --btn-b-col:#1976d2;
- --btn-f-col:#f8f8f8
- }
- button.primary:hover,button.primary:focus,[type="button"].primary:hover,[type="button"].primary:focus,[type="submit"].primary:hover,[type="submit"].primary:focus,[type="reset"].primary:hover,[type="reset"].primary:focus,.button.primary:hover,.button.primary:focus,[role="button"].primary:hover,[role="button"].primary:focus {
- --btn-h-b-col:#1565c0
- }
- :root {
- --hd-b-col:#f8f8f8;
- --hd-hv-b-col:#f0f0f0;
- --hd-f-col:#444;
- --hd-br-col:#ddd;
- --nv-b-col:#f8f8f8;
- --nv-hv-b-col:#f0f0f0;
- --nv-f-col:#444;
- --nv-br-col:#ddd;
- --nv-ln-col:#0277bd;
- --ft-f-col:#444;
- --ft-b-col:#f8f8f8;
- --ft-br-col:#ddd;
- --ft-ln-col:#0277bd;
- --dr-b-col:#f8f8f8;
- --dr-hv-b-col:#f0f0f0;
- --dr-br-col:#ddd;
- --dr-cl-col:#444
- }
- header {
- height:3.1875rem;
- background:var(--hd-b-col);
- color:var(--hd-f-col);
- border-bottom:.0625rem solid var(--hd-br-col);
- padding:calc(var(--u-p)/ 4) 0;
- white-space:nowrap;
- overflow-x:auto;
- overflow-y:hidden
- }
- header.row {
- box-sizing:content-box
- }
- header .logo {
- color:var(--hd-f-col);
- font-size:1.75rem;
- padding:var(--u-p) calc(2 * var(--u-p));
- text-decoration:none
- }
- header button,header [type="button"],header .button,header [role="button"] {
- box-sizing:border-box;
- position:relative;
- top:calc(0rem - var(--u-p) / 4);
- height:calc(3.1875rem + var(--u-p) / 2);
- background:var(--hd-b-col);
- line-height:calc(3.1875rem - var(--u-p) * 1.5);
- text-align:center;
- color:var(--hd-f-col);
- border:0;
- border-radius:0;
- margin:0;
- text-transform:uppercase
- }
- header button:hover,header button:focus,header [type="button"]:hover,header [type="button"]:focus,header .button:hover,header .button:focus,header [role="button"]:hover,header [role="button"]:focus {
- background:var(--hd-hv-b-col)
- }
- nav {
- background:var(--nv-b-col);
- color:var(--nv-f-col);
- border:.0625rem solid var(--nv-br-col);
- border-radius:var(--u-br-r);
- margin:var(--u-m)
- }
- nav * {
- padding:var(--u-p) calc(1.5 * var(--u-p))
- }
- nav a,nav a:visited {
- display:block;
- color:var(--nv-ln-col);
- border-radius:var(--u-br-r);
- transition:background 0.3s
- }
- nav a:hover,nav a:focus,nav a:visited:hover,nav a:visited:focus {
- text-decoration:none;
- background:var(--nv-hv-b-col)
- }
- nav .sublink-1 {
- position:relative;
- margin-left:calc(2 * var(--u-p))
- }
- nav .sublink-1:before {
- position:absolute;
- left:calc(var(--u-p) - 1 * var(--u-p));
- top:-.0625rem;
- content:'';
- height:100%;
- border:.0625rem solid var(--nv-br-col);
- border-left:0
- }
- footer {
- background:var(--ft-b-col);
- color:var(--ft-f-col);
- border-top:.0625rem solid var(--ft-br-col);
- padding:calc(2 * var(--u-p)) var(--u-p);
- font-size:.875rem
- }
- footer a,footer a:visited {
- color:var(--ft-ln-col)
- }
- header.sticky {
- position:-webkit-sticky;
- position:sticky;
- z-index:1101;
- top:0
- }
- footer.sticky {
- position:-webkit-sticky;
- position:sticky;
- z-index:1101;
- bottom:0
- }
- .drawer-toggle:before {
- display:inline-block;
- position:relative;
- vertical-align:bottom;
- content:'\00a0\2261\00a0';
- font-family:sans-serif;
- font-size:1.5em
- }
- @media screen and (min-width: 768px) {
- .drawer-toggle:not(.persistent) {
- display:none
- }
- }
- [type="checkbox"].drawer {
- height:1px;
- width:1px;
- margin:-1px;
- overflow:hidden;
- position:absolute;
- clip:rect(0 0 0 0);
- -webkit-clip-path:inset(100%);
- clip-path:inset(100%)
- }
- [type="checkbox"].drawer+* {
- display:block;
- box-sizing:border-box;
- position:fixed;
- top:0;
- width:320px;
- height:100vh;
- overflow-y:auto;
- background:var(--dr-b-col);
- border:.0625rem solid var(--dr-br-col);
- border-radius:0;
- margin:0;
- z-index:1110;
- left:-320px;
- transition:left 0.3s
- }
- [type="checkbox"].drawer+* .drawer-close {
- position:absolute;
- top:var(--u-m);
- right:var(--u-m);
- z-index:1111;
- width:2rem;
- height:2rem;
- border-radius:var(--u-br-r);
- padding:var(--u-p);
- margin:0;
- cursor:pointer;
- transition:background 0.3s
- }
- [type="checkbox"].drawer+* .drawer-close:before {
- display:block;
- content:'\00D7';
- color:var(--dr-cl-col);
- position:relative;
- font-family:sans-serif;
- font-size:2rem;
- line-height:1;
- text-align:center
- }
- [type="checkbox"].drawer+* .drawer-close:hover,[type="checkbox"].drawer+* .drawer-close:focus {
- background:var(--dr-hv-b-col)
- }
- @media screen and (max-width: 320px) {
- [type="checkbox"].drawer+* {
- width:100%
- }
- }
- [type="checkbox"].drawer:checked+* {
- left:0
- }
- @media screen and (min-width: 768px) {
- [type="checkbox"].drawer:not(.persistent)+* {
- position:static;
- height:100%;
- z-index:1100
- }
- [type="checkbox"].drawer:not(.persistent)+* .drawer-close {
- display:none
- }
- }
- :root {
- --mrk-b-col:#424242;
- --mrk-f-col:#fafafa
- }
- mark {
- background:var(--mrk-b-col);
- color:var(--mrk-f-col);
- font-size:.5em;
- line-height:1em;
- border-radius:var(--u-br-r);
- padding:calc(var(--u-p)/ 4) calc(var(--u-p)/ 2)
- }
- mark.inline-block {
- display:inline-block;
- font-size:1em;
- line-height:1.5;
- padding:calc(var(--u-p)/ 2) var(--u-p)
- }
- :root {
- --tst-b-col:#212121;
- --tst-f-col:#fafafa
- }
- .toast {
- position:fixed;
- bottom:calc(var(--u-m) * 3);
- left:50%;
- transform:translate(-50%,-50%);
- z-index:1111;
- color:var(--tst-f-col);
- background:var(--tst-b-col);
- border-radius:calc(var(--u-br-r) * 16);
- padding:var(--u-p) calc(var(--u-p) * 3)
- }
- .toast {
- bottom:calc(var(--u-m)/ 2);
- opacity:1;
- transition:opacity 0.3s ease-in-out
- }
- mark {
- position:relative;
- top:-0.25rem;
- left:0.25rem
- }
- mark.secondary {
- --mrk-b-col:#d32f2f
- }
- mark.tertiary {
- --mrk-b-col:#308732
- }
- mark.tag {
- padding:calc(var(--u-p)/2) var(--u-p);
- border-radius:1em
- }
- code,pre,kbd,code *,pre *,kbd *,code[class*="language-"],pre[class*="language-"] {
- font-family:Menlo,Consolas,monospace!important
- }
- pre {
- border:0.0625rem solid var(--br-col2);
- border-radius:var(--u-br-r)
- }
- .group {
- position:relative;
- margin-top:2em;
- margin-bottom:1em
- }
- .search {
- font-size:0.875rem;
- margin-top:-0.1em;
- display:block;
- width:100%;
- border:none;
- border-bottom:.0625rem solid var(--nv-ln-col)
- }
- .search:focus {
- outline:none
- }
- label#search-label {
- color:var(--nv-ln-col);
- font-size:1.125rem;
- font-weight:400;
- position:absolute;
- left:0.3125rem;
- top:0.625rem
- }
- .search:focus~label#search-label,.search:valid~label#search-label {
- top:-1.25rem;
- font-size:0.875rem;
- color:var(--nv-ln-col)
- }
- label#menu-toggle {
- width:3.4375rem
- }
- header h1.logo {
- margin-top:-0.8rem;
- text-align:center
- }
- header h1.logo a {
- text-decoration:none;
- color:#111
- }
- header #title {
- position:relative;
- top:-1rem
- }
- @media screen and (max-width: 500px) {
- header #title {
- font-size:1rem;
- display:block
- }
- }
- header h1 small {
- display:block;
- font-size:0.875rem;
- color:#888;
- margin-top:-0.8rem
- }
- @media screen and (max-width: 768px) {
- header h1 small {
- font-size:0.75rem
- }
- }
- @media screen and (max-width: 600px) {
- header h1 small {
- font-size:0.625rem
- }
- }
- @media screen and (max-width: 500px) {
- header h1 small {
- font-size:0.5rem;
- margin-top:-1.2rem
- }
- }
- label#menu-toggle {
- position:absolute;
- left:0.5rem;
- top:0.5rem;
- width:3.4375rem
- }
- main {
- padding:0
- }
- :root {
- --clps-lbl-b-col:#e8e8e8;
- --clps-lbl-f-col:#212121;
- --clps-lbl-h-b-col:#f0f0f0;
- --clps-sel-lbl-b-col:#ececec;
- --clps-br-col:#ddd;
- --clps-cnt-b-col:#fafafa;
- --clps-sel-lbl-br-col:#0277bd
- }
- label.collapse {
- width:100%;
- display:inline-block;
- cursor:pointer;
- box-sizing:border-box;
- transition:background 0.3s;
- color:var(--clps-lbl-f-col);
- background:var(--clps-lbl-b-col);
- border:.0625rem solid var(--clps-br-col);
- padding:calc(1.5 * var(--u-p));
- border-radius:var(--u-br-r)
- }
- label.collapse:hover,label.collapse:focus {
- background:var(--clps-lbl-h-b-col)
- }
- label.collapse+pre {
- box-sizing:border-box;
- height:0;
- max-height:1px;
- overflow:auto;
- margin:0;
- border:0;
- padding:0;
- transition:max-height 0.3s
- }
- label.collapse.toggled {
- background:var(--clps-sel-lbl-b-col);
- border-bottom-color:var(--clps-sel-lbl-br-col);
- border-bottom-left-radius:0;
- border-bottom-right-radius:0
- }
- label.collapse.toggled+pre {
- border-top-left-radius:0;
- border-top-right-radius:0;
- position:relative;
- width:100%;
- height:auto;
- border:.0625rem solid var(--clps-br-col);
- border-top:0;
- padding:calc(2 * var(--u-p));
- max-height:400px
- }
- button.primary.clipboard-copy {
- width:100%;
- margin-left:0
- }
- button.primary.clipboard-copy>img {
- vertical-align:bottom
- }
- code[class*="language-"],pre[class*="language-"] {
- color:#222;
- text-align:left;
- white-space:pre;
- word-spacing:normal;
- word-break:normal;
- word-wrap:normal;
- line-height:1.8;
- -moz-tab-size:2;
- -o-tab-size:2;
- tab-size:2;
- -webkit-hypens:none;
- -moz-hyphens:none;
- -ms-hyphens:none;
- hyphens:none
- }
- pre[class*="language-"] {
- padding:calc(2 * var(--u-p));
- overflow:auto;
- margin:var(--u-m) 0
- }
- pre[class*="language-"]::-moz-selection,pre[class*="language-"] ::-moz-selection,code[class*="language-"]::-moz-selection,code[class*="language-"] ::-moz-selection {
- background:#b3d4fc
- }
- pre[class*="language-"]::selection,pre[class*="language-"] ::selection,code[class*="language-"]::selection,code[class*="language-"] ::selection {
- background:#b3d4fc
- }
- :not(pre)>code[class*="language-"] {
- padding:.1em;
- border-radius:.3em;
- white-space:normal
- }
- .token.comment,.token.prolog,.token.doctype,.token.cdata {
- color:#7a8490
- }
- .token.punctuation {
- color:#666
- }
- .namespace {
- opacity:.7
- }
- .token.property,.token.tag,.token.boolean,.token.constant,.token.symbol,.token.deleted,.token.function {
- color:#005cc5
- }
- .token.number,.token.class-name {
- color:#832ed2
- }
- .token.selector,.token.attr-name,.token.string,.token.char,.token.builtin,.token.inserted {
- color:#067e36
- }
- .token.operator,.token.entity,.token.url,.language-css .token.string,.style .token.string,.token.atrule,.token.attr-value,.token.keyword {
- color:#d73a49
- }
- .token.regex {
- color:#097cab
- }
- .token.important,.token.variable {
- color:#e90
- }
- .token.important,.token.bold {
- font-weight:bold
- }
- .token.italic {
- font-style:italic
- }
- .token.entity {
- cursor:help
- }
- button.scroll-to-top {
- border-radius:100%;
- font-size:1.5rem;
- line-height:1;
- box-sizing:border-box;
- width:2.75rem;
- height:2.75rem;
- position:fixed;
- bottom:1rem;
- right:2rem;
- background:var(--b-col);
- box-shadow:0 0.25rem 0.25rem 0 rgba(0,0,0,0.125),0 0.125rem 0.125rem -0.125rem rgba(0,0,0,0.25)
- }
- button.scroll-to-top:hover,button.scroll-to-top:focus {
- background:var(--b-col2)
- }
-
\ No newline at end of file
diff --git a/website/app/static/favicon.1png b/website/app/static/favicon.1png
deleted file mode 100644
index b84672d14..000000000
Binary files a/website/app/static/favicon.1png and /dev/null differ
diff --git a/website/app/static/favicon.ico b/website/app/static/favicon.ico
deleted file mode 100644
index 30fcc5df0..000000000
Binary files a/website/app/static/favicon.ico and /dev/null differ
diff --git a/website/app/static/favicon.png b/website/app/static/favicon.png
deleted file mode 100644
index f98e25b17..000000000
Binary files a/website/app/static/favicon.png and /dev/null differ
diff --git a/website/app/static/js/prism.js b/website/app/static/js/prism.js
deleted file mode 100644
index 6ee9187a2..000000000
--- a/website/app/static/js/prism.js
+++ /dev/null
@@ -1,4 +0,0 @@
-/* PrismJS 1.10.0
-http://prismjs.com/download.html?themes=prism-okaidia&languages=python */
-var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\blang(?:uage)?-(\w+)\b/i,t=0,n=_self.Prism={manual:_self.Prism&&_self.Prism.manual,disableWorkerMessageHandler:_self.Prism&&_self.Prism.disableWorkerMessageHandler,util:{encode:function(e){return e instanceof r?new r(e.type,n.util.encode(e.content),e.alias):"Array"===n.util.type(e)?e.map(n.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(!(w instanceof s)){h.lastIndex=0;var _=h.exec(w),P=1;if(!_&&m&&b!=t.length-1){if(h.lastIndex=k,_=h.exec(e),!_)break;for(var A=_.index+(d?_[1].length:0),j=_.index+_[0].length,x=b,O=k,N=t.length;N>x&&(j>O||!t[x].type&&!t[x-1].greedy);++x)O+=t[x].length,A>=O&&(++b,k=O);if(t[b]instanceof s||t[x-1].greedy)continue;P=x-b,w=e.slice(k,O),_.index-=k}if(_){d&&(p=_[1].length);var A=_.index+p,_=_[0].slice(p),j=A+_.length,S=w.slice(0,A),C=w.slice(j),M=[b,P];S&&(++b,k+=S.length,M.push(S));var E=new s(g,f?n.tokenize(_,f):_,y,_,m);if(M.push(E),C&&M.push(C),Array.prototype.splice.apply(t,M),1!=P&&n.matchGrammar(e,t,r,b,k,!0,g),i)break}else if(i)break}}}}},tokenize:function(e,t){var r=[e],a=t.rest;if(a){for(var l in a)t[l]=a[l];delete t.rest}return n.matchGrammar(e,r,t,0,0,!1),r},hooks:{all:{},add:function(e,t){var r=n.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){var r=n.hooks.all[e];if(r&&r.length)for(var a,l=0;a=r[l++];)a(t)}}},r=n.Token=function(e,t,n,r,a){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length,this.greedy=!!a};if(r.stringify=function(e,t,a){if("string"==typeof e)return e;if("Array"===n.util.type(e))return e.map(function(n){return r.stringify(n,t,e)}).join("");var l={type:e.type,content:r.stringify(e.content,t,a),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:a};if(e.alias){var i="Array"===n.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(l.classes,i)}n.hooks.run("wrap",l);var o=Object.keys(l.attributes).map(function(e){return e+'="'+(l.attributes[e]||"").replace(/"/g,""")+'"'}).join(" ");return"<"+l.tag+' class="'+l.classes.join(" ")+'"'+(o?" "+o:"")+">"+l.content+""+l.tag+">"},!_self.document)return _self.addEventListener?(n.disableWorkerMessageHandler||_self.addEventListener("message",function(e){var t=JSON.parse(e.data),r=t.language,a=t.code,l=t.immediateClose;_self.postMessage(n.highlight(a,n.languages[r],r)),l&&_self.close()},!1),_self.Prism):_self.Prism;var a=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return a&&(n.filename=a.src,n.manual||a.hasAttribute("data-manual")||("loading"!==document.readyState?window.requestAnimationFrame?window.requestAnimationFrame(n.highlightAll):window.setTimeout(n.highlightAll,16):document.addEventListener("DOMContentLoaded",n.highlightAll))),_self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism);
-Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},"triple-quoted-string":{pattern:/("""|''')[\s\S]+?\1/,greedy:!0,alias:"string"},string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"malfunction":{pattern:/[a-z0-9_]+(?=\()/i,number:/\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i,alias:"function"},"function":{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},keyword:/\b(?:as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|nonlocal|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,"boolean":/\b(?:True|False|None)\b/,number:/\b-?(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not)\b/,punctuation:/[{}[\];(),.:]/};
diff --git a/website/app/templates/base.html b/website/app/templates/base.html
deleted file mode 100644
index 9f96496f3..000000000
--- a/website/app/templates/base.html
+++ /dev/null
@@ -1,74 +0,0 @@
-
-
-
-
-
-30 seconds of python code
-
-
-
- {% if err_400 %}
- {{ message }}
- {% endif %}
- 30 seconds of python code Python Implementation of 30 seconds of code
- {% block content %}{% endblock %}
-
-
-
-
diff --git a/website/app/templates/index.html b/website/app/templates/index.html
deleted file mode 100644
index bb18cd40d..000000000
--- a/website/app/templates/index.html
+++ /dev/null
@@ -1,466 +0,0 @@
-{% extends "base.html" %}
-
-{% block content %}Search for snippet...
Math average factorial gcd lcm max_n min_n List chunk compact count_occurences deep_flatten difference shuffle spread zip count_by difference_by insertion_sort bubble_sort has_duplicates String count_vowels byte_size capitalize capitalize_every_word decapitalize palindrome is_upper_case is_lower_case Object keys_only values_only all_unique Math average
-
ℹ Already implemented via statistics.mean. statistics.mean takes an array as an argument whereas this function takes variadic arguments.
-
Returns the average of two or more numbers.
-
Takes the sum of all the args and divides it by len(args). The second argument 0.0 in sum is to handle floating point division in python3.
-
-
def average(*args):
- return sum(args, 0.0) / len(args)
-
Show examples
-
average(*[1, 2, 3]) # 2.0
-average(1, 2, 3) # 2.0
-
📋 Copy to clipboard
-
-
factorial
-
Calculates the factorial of a number.
-
Use recursion. If num is less than or equal to 1, return 1. Otherwise, return the product of num and the factorial of num - 1. Throws an exception if num is a negative or a floating point number.
-
-
def factorial(num):
- if not ((num >= 0) & (num % 1 == 0)):
- raise Exception(
- f"Number( {num} ) can't be floating point or negative ")
- return 1 if num == 0 else num * factorial(num - 1)
-
Show examples
-
factorial(6) # 720
-
📋 Copy to clipboard
-
-
gcd
-
ℹ math.gcd works with only two numbers
-
Calculates the greatest common divisor between two or more numbers/lists.
-
The helperGcdfunction uses recursion. Base case is when y equals 0. In this case, return x. Otherwise, return the GCD of y and the remainder of the division x/y.
-
Uses the reduce function from the inbuilt module functools. Also defines a method spread for javascript like spreading of lists.
-
-
from functools import reduce
-
-
-def spread(arg):
- ret = []
- for i in arg:
- if isinstance(i, list):
- ret.extend(i)
- else:
- ret.append(i)
- return ret
-
-
-def gcd(*args):
- numbers = []
- numbers.extend(spread(list(args)))
-
- def _gcd(x, y):
- return x if not y else gcd(y, x % y)
-
- return reduce((lambda x, y: _gcd(x, y)), numbers)
-
Show examples
-
gcd(8,36) # 4
-
📋 Copy to clipboard
-
-
lcm
-
Returns the least common multiple of two or more numbers.
-
Use the greatest common divisor (GCD) formula and the fact that lcm(x,y) = x * y / gcd(x,y) to determine the least common multiple. The GCD formula uses recursion.
-
Uses reduce function from the inbuilt module functools. Also defines a method spread for javascript like spreading of lists.
-
-
from functools import reduce
-
-
-def spread(arg):
- ret = []
- for i in arg:
- if isinstance(i, list):
- ret.extend(i)
- else:
- ret.append(i)
- return ret
-
-
-def lcm(*args):
- numbers = []
- numbers.extend(spread(list(args)))
-
- def _gcd(x, y):
- return x if not y else _gcd(y, x % y)
-
- def _lcm(x, y):
- return x * y / _gcd(x, y)
-
- return reduce((lambda x, y: _lcm(x, y)), numbers)
-
Show examples
-
lcm(12, 7) # 84
-lcm([1, 3, 4], 5) # 60
-
📋 Copy to clipboard
-
-
max_n
-
Returns the n maximum elements from the provided list. If n is greater than or equal to the provided list's length, then return the original list(sorted in descending order).
-
Use list.sort() combined with the deepcopy function from the inbuilt copy module to create a shallow clone of the list and sort it in ascending order and then use list.reverse() reverse it to make it descending order. Use [:n] to get the specified number of elements. Omit the second argument, n, to get a one-element list
-
-
def max_n(lst, n=1, reverse=True):
- return sorted(lst, reverse=reverse)[:n]
-
Show examples
-
max_n([1, 2, 3]) # [3]
-max_n([1, 2, 3], 2) # [3,2]
-
📋 Copy to clipboard
-
-
min_n
-
Returns the n minimum elements from the provided list. If n is greater than or equal to the provided list's length, then return the original list(sorted in ascending order).
-
Use list.sort() combined with the deepcopy function from the inbuilt copy module to create a shallow clone of the list and sort it in ascending order. Use [:n] to get the specified number of elements. Omit the second argument, n, to get a one-element list
-
-
from copy import deepcopy
-
-
-def min_n(lst, n=1):
- numbers = deepcopy(lst)
- numbers.sort()
- return numbers[:n]
-
Show examples
-
min_n([1, 2, 3]) # [1]
-min_n([1, 2, 3], 2) # [1,2]
-
📋 Copy to clipboard
-
-
List chunk
-
Chunks an list into smaller lists of a specified size.
-
Uses range to create a list of desired size. Then use map on this list and fill it with splices of lst.
-
-
from math import ceil
-
-
-def chunk(lst, size):
- return list(
- map(lambda x: lst[x * size:x * size + size],
- list(range(0, ceil(len(lst) / size)))))
-
Show examples
-
chunk([1,2,3,4,5],2) # [[1,2],[3,4],5]
-
📋 Copy to clipboard
-
-
compact
-
Removes falsey values from a list.
-
Use filter() to filter out falsey values (False, None, 0, and "").
-
-
def compact(lst):
- return list(filter(bool, lst))
-
Show examples
-
compact([0, 1, False, 2, '', 3, 'a', 's', 34]) # [ 1, 2, 3, 'a', 's', 34 ]
-
📋 Copy to clipboard
-
-
count_occurences
-
ℹ Already implemented via list.count().
-
Counts the occurrences of a value in an list.
-
Uses the list comprehension to increment a counter each time you encounter the specific value inside the list.
-
-
def count_occurrences(lst, val):
- return len([x for x in lst if x == val and type(x) == type(val)])
-
Show examples
-
count_occurrences([1, 1, 2, 1, 2, 3], 1) # 3
-
📋 Copy to clipboard
-
-
deep_flatten
-
Deep flattens a list.
-
Use recursion. Use list.extend() with an empty list (result) and the spread function to flatten a list. Recursively flatten each element that is a list.
-
-
def spread(arg):
- ret = []
- for i in arg:
- if isinstance(i, list):
- ret.extend(i)
- else:
- ret.append(i)
- return ret
-
-
-def deep_flatten(lst):
- result = []
- result.extend(
- spread(list(map(lambda x: deep_flatten(x) if type(x) == list else x, lst))))
- return result
-
Show examples
-
deep_flatten([1, [2], [[3], 4], 5]) # [1,2,3,4,5]
-
📋 Copy to clipboard
-
-
difference
-
Returns the difference between two iterables.
-
Use list comprehension to only keep values not contained in b
-
-
def difference(a, b):
- return [item for item in a if item not in b]
-
Show examples
-
difference([1, 2, 3], [1, 2, 4]) # [3]
-
📋 Copy to clipboard
-
-
shuffle
-
ℹ The same algorithm is already implemented via random.shuffle.
-
Randomizes the order of the values of an list, returning a new list.
-
Uses the Fisher-Yates algorithm to reorder the elements of the list.
-
-
from copy import deepcopy
-from random import randint
-
-
-def shuffle(lst):
- temp_lst = deepcopy(lst)
- m = len(temp_lst)
- while (m):
- m -= 1
- i = randint(0, m)
- temp_lst[m], temp_lst[i] = temp_lst[i], temp_lst[m]
- return temp_lst
-
Show examples
-
foo = [1,2,3]
-shuffle(foo) # [2,3,1] , foo = [1,2,3]
-
📋 Copy to clipboard
-
-
spread
-
Implements javascript's [].concat(...arr). Flattens the list(non-deep) and returns an list.
-
-
def spread(arg):
- ret = []
- for i in arg:
- if isinstance(i, list):
- ret.extend(i)
- else:
- ret.append(i)
- return ret
-
Show examples
-
spread([1,2,3,[4,5,6],[7],8,9]) # [1,2,3,4,5,6,7,8,9]
-
📋 Copy to clipboard
-
-
zip
-
ℹ Already implemented via itertools.zip_longest()
-
Creates a list of elements, grouped based on the position in the original lists.
-
Use max combined with list comprehension to get the length of the longest list in the arguments. Loops for max_length times grouping elements. If lengths of lists vary fill_value is used. By default fill_value is None.
-
-
def zip(*args, fillvalue=None):
- max_length = max([len(lst) for lst in args])
- result = []
- for i in range(max_length):
- result.append([
- args[k][i] if i < len(args[k]) else None for k in range(len(args))
- ])
- return result
-
Show examples
-
zip(['a', 'b'], [1, 2], [True, False]) # [['a', 1, True], ['b', 2, False]]
-zip(['a'], [1, 2], [True, False]) # [['a', 1, True], [None, 2, False]]
-zip(['a'], [1, 2], [True, False], fill_value = '_') # [['a', 1, True], ['_', 2, False]]
-
📋 Copy to clipboard
-
-
count_by
-
ℹ Already implemented via collections.Counter
-
Groups the elements of a list based on the given function and returns the count of elements in each group.
-
Use map() to map the values of the list using the given function. Iterate over the map and increase the the elements count each time it occurs.
-
-
def count_by(arr, fn=lambda x: x):
- key = {}
- for el in map(fn, arr):
- key[el] = 0 if el not in key else key[el]
- key[el] += 1
- return key
-
Show examples
-
from math import floor
-count_by([6.1, 4.2, 6.3], floor) # {4: 1, 6: 2}
-count_by(['one', 'two', 'three'], len) # {3: 2, 5: 1}
-
📋 Copy to clipboard
-
-
difference_by
-
Returns the difference between two list, after applying the provided function to each list element of both.
-
Create a set by applying fn to each element in b, then use list comprehension in combination with fn on a to only keep values not contained in the previously created set.
-
-
def difference_by(a, b, fn):
- b = set(map(fn, b))
- return [item for item in a if fn(item) not in b]
-
Show examples
-
from math import floor
-difference_by([2.1, 1.2], [2.3, 3.4],floor) # [1.2]
-difference_by([{ 'x': 2 }, { 'x': 1 }], [{ 'x': 1 }], lambda v : v['x']) # [ { x: 2 } ]
-
📋 Copy to clipboard
-
-
insertion_sort
-
On a very basic level, an insertion sort algorithm contains the logic of shifting around and inserting elements in order to sort an unordered list of any size. The way that it goes about inserting elements, however, is what makes insertion sort so very interesting!
-
-
def insertion_sort(lst):
-
- for i in range(1, len(lst)):
- key = lst[i]
- j = i - 1
- while j >= 0 and key < lst[j]:
- lst[j + 1] = lst[j]
- j -= 1
- lst[j + 1] = key
-
Show examples
-
lst = [7,4,9,2,6,3]
-insertionsort(lst)
-print('Sorted %s' %lst) # sorted [2, 3, 4, 6, 7, 9]
-
📋 Copy to clipboard
-
-
bubble_sort
-
Bubble_sort uses the technique of comparing and swapping
-
-
def bubble_sort(lst):
- for passnum in range(len(lst) - 1, 0, -1):
- for i in range(passnum):
- if lst[i] > lst[i + 1]:
- temp = lst[i]
- lst[i] = lst[i + 1]
- lst[i + 1] = temp
-
Show examples
-
lst = [54,26,93,17,77,31,44,55,20]
-bubble_sort(lst)
-print("sorted %s" %lst) # [17,20,26,31,44,54,55,77,91]
-
📋 Copy to clipboard
-
-
has_duplicates
-
Checks a flat list for duplicate values. Returns True if duplicate values exist and False if values are all unique.
-
This function compares the length of the list with length of the set() of the list. set() removes duplicate values from the list.
-
-
def has_duplicates(lst):
- return len(lst) != len(set(lst))
-
Show examples
-
x = [1,2,3,4,5,5]
-y = [1,2,3,4,5]
-has_duplicates(x) # True
-has_duplicates(y) # False
-
📋 Copy to clipboard
-
-
String count_vowels
-
Retuns number of vowels in provided string.
-
Use a regular expression to count the number of vowels (A, E, I, O, U) in a string.
-
-
import re
-
-
-def count_vowels(str):
- return len(len(re.findall(r'[aeiou]', str, re.IGNORECASE)))
-
Show examples
-
count_vowels('foobar') # 3
-count_vowels('gym') # 0
-
📋 Copy to clipboard
-
-
byte_size
-
Returns the length of a string in bytes.
-
utf-8 encodes a given string and find its length.
-
-
def byte_size(string):
- return(len(string.encode('utf-8')))
-
Show examples
-
byte_size('😀') # 4
-byte_size('Hello World') # 11
-
📋 Copy to clipboard
-
-
capitalize
-
Capitalizes the first letter of a string.
-
Capitalizes the fist letter of the sring and then adds it with rest of the string. Omit the lower_rest parameter to keep the rest of the string intact, or set it to true to convert to lowercase.
-
-
def capitalize(string, lower_rest=False):
- return string[:1].upper() + (string[1:].lower() if lower_rest else string[1:])
-
Show examples
-
capitalize('fooBar') # 'FooBar'
-capitalize('fooBar', True) # 'Foobar'
-
📋 Copy to clipboard
-
-
capitalize_every_word
-
Capitalizes the first letter of every word in a string.
-
Uses str.title to capitalize first letter of evry word in the string.
-
-
def capitalize_every_word(string):
- return string.title()
-
Show examples
-
capitalize_every_word('hello world!') # 'Hello World!'
-
📋 Copy to clipboard
-
-
decapitalize
-
Decapitalizes the first letter of a string.
-
Decapitalizes the fist letter of the sring and then adds it with rest of the string. Omit the upper_rest parameter to keep the rest of the string intact, or set it to true to convert to uppercase.
-
-
def decapitalize(string, upper_rest=False):
- return str[:1].lower() + (str[1:].upper() if upper_rest else str[1:])
-
Show examples
-
decapitalize('FooBar') # 'fooBar'
-decapitalize('FooBar', True) # 'fOOBAR'
-
📋 Copy to clipboard
-
-
palindrome
-
Returns True if the given string is a palindrome, False otherwise.
-
Convert string str.lower() and use re.sub to remove non-alphanumeric characters from it. Then compare the new string to the reversed.
-
-
def palindrome(string):
- from re import sub
- s = sub('[\W_]', '', string.lower())
- return s == s[::-1]
-
Show examples
-
palindrome('taco cat') # True
-
📋 Copy to clipboard
-
-
is_upper_case
-
Checks if a string is upper case.
-
Convert the given string to upper case, using str.upper() method and compare it to the original.
-
-
def is_upper_case(string):
- return string == string.upper()
-
Show examples
-
is_upper_case('ABC') # True
-is_upper_case('a3@$') # True
-is_upper_case('aB4') # False
-
📋 Copy to clipboard
-
-
is_lower_case
-
Checks if a string is lower case.
-
Convert the given string to lower case, using str.lower() method and compare it to the original.
-
-
def is_lower_case(string):
- return string == string.lower()
-
Show examples
-
is_lower_case('abc') # True
-is_lower_case('a3@$') # True
-is_lower_case('Ab4') # False
-
📋 Copy to clipboard
-
-
Object keys_only
-
Function which accepts a dictionary of key value pairs and returns a new flat list of only the keys.
-
Uses the .items() function with a for loop on the dictionary to track both the key and value and returns a new list by appending the keys to it. Best used on 1 level-deep key:value pair dictionaries (a flat dictionary) and not nested data-structures which are also commonly used with dictionaries. (a flat dictionary resembles a json and a flat list an array for javascript people).
-
-
def keys_only(flat_dict):
- lst = []
- for k, v in flat_dict.items():
- lst.append(k)
- return lst
-
Show examples
-
ages = {
- "Peter": 10,
- "Isabel": 11,
- "Anna": 9,
-}
-keys_only(ages) # ['Peter', 'Isabel', 'Anna']
-
📋 Copy to clipboard
-
-
values_only
-
Function which accepts a dictionary of key value pairs and returns a new flat list of only the values.
-
Uses the .items() function with a for loop on the dictionary to track both the key and value of the iteration and returns a new list by appending the values to it. Best used on 1 level-deep key:value pair dictionaries and not nested data-structures.
-
-
def values_only(dict):
- lst = []
- for k, v in dict.items():
- lst.append(v)
- return lst
-
Show examples
-
ages = {
- "Peter": 10,
- "Isabel": 11,
- "Anna": 9,
-}
-values_only(ages) # [10, 11, 9]
-
📋 Copy to clipboard
-
-
all_unique
-
Checks a flat list for all unique values. Returns True if list values are all unique and False if list values aren't all unique.
-
This function compares the length of the list with length of the set() of the list. set() removes duplicate values from the list.
-
-
def all_unique(lst):
- return len(lst) == len(set(lst))
-
Show examples
-
x = [1,2,3,4,5,6]
-y = [1,2,2,3,4,5]
-all_unique(x) # True
-all_unique(y) # False
-
📋 Copy to clipboard
-
-
↑
-
- {% endblock %}
\ No newline at end of file
diff --git a/website/app/templates/prism.css b/website/app/templates/prism.css
deleted file mode 100644
index 5bf332cb8..000000000
--- a/website/app/templates/prism.css
+++ /dev/null
@@ -1,124 +0,0 @@
-/* PrismJS 1.10.0
-http://prismjs.com/download.html?themes=prism-okaidia&languages=python */
-/**
- * okaidia theme for JavaScript, CSS and HTML
- * Loosely based on Monokai textmate theme by http://www.monokai.nl/
- * @author ocodia
- */
-
-code[class*="language-"],
-pre[class*="language-"] {
- color: #f8f8f2;
- background: none;
- text-shadow: 0 1px rgba(0, 0, 0, 0.3);
- font-family: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
- text-align: left;
- white-space: pre;
- word-spacing: normal;
- word-break: normal;
- word-wrap: normal;
- line-height: 1.5;
-
- -moz-tab-size: 4;
- -o-tab-size: 4;
- tab-size: 4;
-
- -webkit-hyphens: none;
- -moz-hyphens: none;
- -ms-hyphens: none;
- hyphens: none;
-}
-
-/* Code blocks */
-pre[class*="language-"] {
- padding: 1em;
- margin: .5em 0;
- overflow: auto;
- border-radius: 0.3em;
-}
-
-:not(pre) > code[class*="language-"],
-pre[class*="language-"] {
- background: #272822;
-}
-
-/* Inline code */
-:not(pre) > code[class*="language-"] {
- padding: .1em;
- border-radius: .3em;
- white-space: normal;
-}
-
-.token.comment,
-.token.prolog,
-.token.doctype,
-.token.cdata {
- color: slategray;
-}
-
-.token.punctuation {
- color: #f8f8f2;
-}
-
-.namespace {
- opacity: .7;
-}
-
-.token.property,
-.token.tag,
-.token.constant,
-.token.symbol,
-.token.deleted {
- color: #f92672;
-}
-
-.token.boolean,
-.token.number {
- color: #ae81ff;
-}
-
-.token.selector,
-.token.attr-name,
-.token.string,
-.token.char,
-.token.builtin,
-.token.inserted {
- color: #a6e22e;
-}
-
-.token.operator,
-.token.entity,
-.token.url,
-.language-css .token.string,
-.style .token.string,
-.token.variable {
- color: #f8f8f2;
-}
-
-.token.atrule,
-.token.attr-value,
-.token.function {
- color: #e6db74;
-}
-
-.token.keyword {
- color: #66d9ef;
-}
-
-.token.regex,
-.token.important {
- color: #fd971f;
-}
-
-.token.important,
-.token.bold {
- font-weight: bold;
-}
-.token.italic {
- font-style: italic;
-}
-
-.token.entity {
- cursor: help;
-}
-
diff --git a/website/app/templates/prism.js b/website/app/templates/prism.js
deleted file mode 100644
index 982420588..000000000
--- a/website/app/templates/prism.js
+++ /dev/null
@@ -1,2 +0,0 @@
-var _self="undefined"!=typeof window?window:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:{},Prism=function(){var e=/\blang(?:uage)?-(\w+)\b/i,t=0,n=_self.Prism={manual:_self.Prism&&_self.Prism.manual,disableWorkerMessageHandler:_self.Prism&&_self.Prism.disableWorkerMessageHandler,util:{encode:function(e){return e instanceof r?new r(e.type,n.util.encode(e.content),e.alias):"Array"===n.util.type(e)?e.map(n.util.encode):e.replace(/&/g,"&").replace(/e.length)return;if(!(w instanceof s)){h.lastIndex=0;var _=h.exec(w),P=1;if(!_&&m&&b!=t.length-1){if(h.lastIndex=k,_=h.exec(e),!_)break;for(var A=_.index+(d?_[1].length:0),j=_.index+_[0].length,x=b,O=k,N=t.length;N>x&&(j>O||!t[x].type&&!t[x-1].greedy);++x)O+=t[x].length,A>=O&&(++b,k=O);if(t[b]instanceof s||t[x-1].greedy)continue;P=x-b,w=e.slice(k,O),_.index-=k}if(_){d&&(p=_[1].length);var A=_.index+p,_=_[0].slice(p),j=A+_.length,S=w.slice(0,A),C=w.slice(j),M=[b,P];S&&(++b,k+=S.length,M.push(S));var E=new s(g,f?n.tokenize(_,f):_,y,_,m);if(M.push(E),C&&M.push(C),Array.prototype.splice.apply(t,M),1!=P&&n.matchGrammar(e,t,r,b,k,!0,g),i)break}else if(i)break}}}}},tokenize:function(e,t){var r=[e],a=t.rest;if(a){for(var l in a)t[l]=a[l];delete t.rest}return n.matchGrammar(e,r,t,0,0,!1),r},hooks:{all:{},add:function(e,t){var r=n.hooks.all;r[e]=r[e]||[],r[e].push(t)},run:function(e,t){var r=n.hooks.all[e];if(r&&r.length)for(var a,l=0;a=r[l++];)a(t)}}},r=n.Token=function(e,t,n,r,a){this.type=e,this.content=t,this.alias=n,this.length=0|(r||"").length,this.greedy=!!a};if(r.stringify=function(e,t,a){if("string"==typeof e)return e;if("Array"===n.util.type(e))return e.map(function(n){return r.stringify(n,t,e)}).join("");var l={type:e.type,content:r.stringify(e.content,t,a),tag:"span",classes:["token",e.type],attributes:{},language:t,parent:a};if(e.alias){var i="Array"===n.util.type(e.alias)?e.alias:[e.alias];Array.prototype.push.apply(l.classes,i)}n.hooks.run("wrap",l);var o=Object.keys(l.attributes).map(function(e){return e+'="'+(l.attributes[e]||"").replace(/"/g,""")+'"'}).join(" ");return"<"+l.tag+' class="'+l.classes.join(" ")+'"'+(o?" "+o:"")+">"+l.content+""+l.tag+">"},!_self.document)return _self.addEventListener?(n.disableWorkerMessageHandler||_self.addEventListener("message",function(e){var t=JSON.parse(e.data),r=t.language,a=t.code,l=t.immediateClose;_self.postMessage(n.highlight(a,n.languages[r],r)),l&&_self.close()},!1),_self.Prism):_self.Prism;var a=document.currentScript||[].slice.call(document.getElementsByTagName("script")).pop();return a&&(n.filename=a.src,n.manual||a.hasAttribute("data-manual")||("loading"!==document.readyState?window.requestAnimationFrame?window.requestAnimationFrame(n.highlightAll):window.setTimeout(n.highlightAll,16):document.addEventListener("DOMContentLoaded",n.highlightAll))),_self.Prism}();"undefined"!=typeof module&&module.exports&&(module.exports=Prism),"undefined"!=typeof global&&(global.Prism=Prism);
-Prism.languages.python={comment:{pattern:/(^|[^\\])#.*/,lookbehind:!0},"triple-quoted-string":{pattern:/("""|''')[\s\S]+?\1/,greedy:!0,alias:"string"},string:{pattern:/("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},"callable":{pattern:/\S+\([\s\S]*\)/g},"function":{pattern:/((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,lookbehind:!0},"class-name":{pattern:/(\bclass\s+)\w+/i,lookbehind:!0},keyword:/\b(?:as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|nonlocal|pass|print|raise|return|try|while|with|yield)\b/,builtin:/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,"boolean":/\b(?:True|False|None)\b/,number:/\b-?(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i,operator:/[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not)\b/,punctuation:/[{}[\];(),.:]/};
diff --git a/website/app/vote.py b/website/app/vote.py
deleted file mode 100644
index 7132c5487..000000000
--- a/website/app/vote.py
+++ /dev/null
@@ -1,16 +0,0 @@
-import json
-
-
-def vote(snippet):
- snippets = open('website/app/snippets').read().split('\n')
- with open('website/app/votes.json', 'r') as f:
- if snippet in snippets:
- data = json.load(f)
- try:
- data[snippet]
- except KeyError:
- data[snippet] = 0
- data[snippet] += 1
- open('website/app/votes.json','w').write(str(data).replace("'",'"'))
- else:
- raise Exception(f'{snippet} does not exists ')
diff --git a/website/app/vote_data.py b/website/app/vote_data.py
deleted file mode 100644
index 64b01507a..000000000
--- a/website/app/vote_data.py
+++ /dev/null
@@ -1,16 +0,0 @@
-import json
-
-def vote_data():
- f = open('website/app/snippets')
- snippets = f.read().split('\n')
- f.close()
-
- f = open('website/app/votes.json')
- votes_data = json.load(f)
- votes = {}
- for snippet in snippets:
- try:
- votes[snippet] = votes_data[snippet]
- except KeyError:
- votes[snippet] = 0
- return votes
diff --git a/website/app/votes.json b/website/app/votes.json
deleted file mode 100644
index 9e26dfeeb..000000000
--- a/website/app/votes.json
+++ /dev/null
@@ -1 +0,0 @@
-{}
\ No newline at end of file
diff --git a/website/main.py b/website/main.py
deleted file mode 100644
index 9409634fa..000000000
--- a/website/main.py
+++ /dev/null
@@ -1,69 +0,0 @@
-import os
-import re
-
-import emoji
-import mistune
-
-codeRe = "```\s*python([\s\S]*?)```"
-def tagger():
- tag_data = open('tag_database').read()
- tag_dict = {}
- tag_list = filter(lambda x:x.strip() != '',tag_data.split('\n'))
- for tag in tag_list:
- category = tag.split(':')[1]
- snippet = tag.split(':')[0]
- if category in tag_dict:
- tag_dict[category].append(snippet)
- else:
- tag_dict[category] = [snippet]
- return tag_dict
-
-class MyRenderer(mistune.Renderer):
- def block_code(self, code, lang):
- if not lang:
- return f'\n{mistune.escape(code.strip())} \n'
- else:
- return f'\n{mistune.escape(code.strip())} \n'
-
-
-renderer = MyRenderer()
-md = mistune.Markdown(renderer=renderer,escape=True)
-def title_case(str):
- return str[:1].upper() + str[1:].lower()
-
-rendered = ''
-
-tag_dict = tagger()
-
-for category in tag_dict:
- rendered += f'{title_case(category)} '
- snippets = tag_dict[category]
- for file in snippets:
- content = open('snippets/'+file+'.md').read()
- content = re.sub(':(\S+):',r':\1: ',content)
- codeParts = re.split(codeRe,content)
- codeParts[3] = f'\n\nShow examples \n\n```python\n{codeParts[3].strip()}\n```\n'
- content = codeParts[0] + '``` python' + codeParts[1] + '```' + codeParts[2] + codeParts[3]
- content = f'{emoji.emojize(md.render(content),use_aliases=True)}📋 Copy to clipboard
'+'\n\n'
- rendered += re.sub('(\S+) ',r'\1 ',content) + '
'
- rendered = re.sub('(\S+) ',r'\1 ',rendered)
-nav_string = 'Search for snippet...
'
-for category in tag_dict:
- nav_string += f'{title_case(category)} '
- for file in tag_dict[category]:
- nav_string += f'{file} '
-nav_string += ' '
-start = '''{% extends "base.html" %}
-
-{% block content %}'''
-
-end = '{% endblock %}'
-
-footer = '''
-
- '''
-rendered = f'{nav_string}
' + rendered + f'↑ {footer} '
-rendered = re.sub('','',rendered)
-open('website/app/templates/index.html','w',encoding='utf-8').write(start + rendered + end)
-snippets = [snippet.replace('.md','') for snippet in snippets]
-open('website/app/snippets','w').write('\n'.join(snippets))
diff --git a/website/requirements.txt b/website/requirements.txt
deleted file mode 100644
index d588895dc..000000000
--- a/website/requirements.txt
+++ /dev/null
@@ -1,16 +0,0 @@
-cffi==1.11.4
-click==6.7
-emoji==0.4.5
-flake8==3.5.0
-Flask==1.0
-Flask-OAuth==0.12
-gunicorn==19.7.1
-httplib2==0.10.3
-itsdangerous==0.24
-Jinja2==2.10
-MarkupSafe==1.0
-misaka==2.1.0
-mistune==0.8.3
-oauth2==1.9.0.post1
-pycparser==2.18
-Werkzeug==0.14.1
\ No newline at end of file
diff --git a/website/run.py b/website/run.py
deleted file mode 100644
index 9d4666819..000000000
--- a/website/run.py
+++ /dev/null
@@ -1,6 +0,0 @@
-from app import app
-
-if __name__ == '__main__':
- app.jinja_env.auto_reload = True
- app.config['TEMPLATES_AUTO_RELOAD'] = True
- app.run(debug=True, host='0.0.0.0',port=80)
\ No newline at end of file