├── static ├── .nojekyll ├── CNAME ├── _redirects ├── ads.txt ├── img │ ├── favicon.ico │ ├── custom-data-image.png │ ├── courses │ │ ├── placeholder.png │ │ ├── html-language.png │ │ ├── jquery-language.png │ │ ├── kotlin-language.png │ │ └── python-language.png │ ├── tutorial │ │ ├── localeDropdown.png │ │ └── docsVersionDropdown.png │ └── docs │ │ └── visual-studio │ │ ├── vs-home.png │ │ └── vs-download.png └── robots.txt ├── .vscode └── settings.json ├── babel.config.js ├── src ├── components │ ├── Courses │ │ ├── Courses.module.css │ │ └── Courses.jsx │ ├── HomePageFeatures │ │ ├── HomepageFeatures.module.css │ │ └── HomepageFeatures.js │ ├── Adsence │ │ ├── DisplayAd.js │ │ └── InArticleAd.js │ ├── BrowserWindow │ │ ├── index.tsx │ │ └── styles.index.css │ ├── Card │ │ ├── Card.jsx │ │ └── Card.css │ └── SocialShare │ │ └── index.js ├── pages │ ├── markdown-page.md │ ├── courses.js │ ├── index.module.css │ └── index.js └── css │ └── custom.css ├── .gitignore ├── blog └── authors.yml ├── docs ├── languages │ ├── html │ │ ├── doctypes │ │ │ ├── introduction.md │ │ │ ├── remarks.md │ │ │ ├── adding-the-doctype.md │ │ │ └── html-5-doctype.md │ │ ├── headings │ │ │ ├── introduction.md │ │ │ ├── using-headings.md │ │ │ ├── correct-structure-matters.md │ │ │ └── remarks.md │ │ ├── lists │ │ │ ├── unordered-list.mdx │ │ │ ├── remarks.mdx │ │ │ ├── introduction.mdx │ │ │ ├── ordered-list.mdx │ │ │ └── nested-list.mdx │ │ └── getting-started │ │ │ ├── element-insight.md │ │ │ ├── remarks.md │ │ │ ├── creating-page.md │ │ │ ├── introduction.md │ │ │ └── breakdown-page.md │ ├── jquery │ │ ├── README.md │ │ ├── each-function.md │ │ ├── getting-and-setting-width-and-height-of-an-element.md │ │ ├── prepend.md │ │ ├── checkbox-select-all-with-automatic-check-uncheck-on-other-checkbox-change.md │ │ ├── contributors.md │ │ ├── element-visibility.md │ │ ├── attributes.md │ │ ├── jquery-deferred-objects-and-promises.md │ │ ├── jquery-animate-method.md │ │ └── plugins.md │ ├── kotlin │ │ ├── README.md │ │ ├── kotlin-caveats.md │ │ ├── junit.md │ │ ├── logging-in-kotlin.md │ │ ├── class-delegation.md │ │ ├── visibility-modifiers.md │ │ ├── coroutines.md │ │ ├── exceptions.md │ │ ├── type-aliases.md │ │ ├── contributors.md │ │ ├── ranges.md │ │ ├── collections.md │ │ ├── annotations.md │ │ ├── vararg-parameters-in-functions.md │ │ ├── singleton-objects.md │ │ ├── dsl-building.md │ │ ├── type-safe-builders.md │ │ ├── enum.md │ │ ├── basics-of-kotlin.md │ │ ├── basic-lambdas.md │ │ ├── delegated-properties.md │ │ ├── recyclerview-in-kotlin.md │ │ ├── strings.md │ │ ├── arrays.md │ │ ├── generics.md │ │ ├── kotlin-for-java-developers.md │ │ ├── class-inheritance.md │ │ ├── kotlin-android-extensions.md │ │ ├── loops-in-kotlin.md │ │ ├── null-safety.md │ │ ├── configuring-kotlin-build.md │ │ └── interfaces.md │ └── javascript │ │ ├── README.md │ │ ├── date-comparison.md │ │ ├── comments.md │ │ └── datatypes-in-javascript.md └── cards-data │ └── cards-data.js ├── LICENSE ├── package.json ├── README.md └── sidebars.js /static/.nojekyll: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /static/CNAME: -------------------------------------------------------------------------------- 1 | geekyweb.eu.org -------------------------------------------------------------------------------- /static/_redirects: -------------------------------------------------------------------------------- 1 | /sitemap.xml/ /sitemap.xml 2 | -------------------------------------------------------------------------------- /static/ads.txt: -------------------------------------------------------------------------------- 1 | google.com, pub-1497260367342842, DIRECT, f08c47fec0942fa0 -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "cSpell.words": ["anguage", "arkup", "yper"] 3 | } 4 | -------------------------------------------------------------------------------- /static/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NamanGarg2075/GeekyWeb/HEAD/static/img/favicon.ico -------------------------------------------------------------------------------- /static/robots.txt: -------------------------------------------------------------------------------- 1 | User-agent: * 2 | Disallow: /search 3 | Sitemap: https://geekyweb.eu.org/sitemap.xml/ -------------------------------------------------------------------------------- /babel.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | presets: [require.resolve('@docusaurus/core/lib/babel/preset')], 3 | }; 4 | -------------------------------------------------------------------------------- /static/img/custom-data-image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NamanGarg2075/GeekyWeb/HEAD/static/img/custom-data-image.png -------------------------------------------------------------------------------- /static/img/courses/placeholder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NamanGarg2075/GeekyWeb/HEAD/static/img/courses/placeholder.png -------------------------------------------------------------------------------- /static/img/courses/html-language.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NamanGarg2075/GeekyWeb/HEAD/static/img/courses/html-language.png -------------------------------------------------------------------------------- /static/img/courses/jquery-language.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NamanGarg2075/GeekyWeb/HEAD/static/img/courses/jquery-language.png -------------------------------------------------------------------------------- /static/img/courses/kotlin-language.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NamanGarg2075/GeekyWeb/HEAD/static/img/courses/kotlin-language.png -------------------------------------------------------------------------------- /static/img/courses/python-language.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NamanGarg2075/GeekyWeb/HEAD/static/img/courses/python-language.png -------------------------------------------------------------------------------- /static/img/tutorial/localeDropdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NamanGarg2075/GeekyWeb/HEAD/static/img/tutorial/localeDropdown.png -------------------------------------------------------------------------------- /static/img/docs/visual-studio/vs-home.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NamanGarg2075/GeekyWeb/HEAD/static/img/docs/visual-studio/vs-home.png -------------------------------------------------------------------------------- /static/img/docs/visual-studio/vs-download.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NamanGarg2075/GeekyWeb/HEAD/static/img/docs/visual-studio/vs-download.png -------------------------------------------------------------------------------- /static/img/tutorial/docsVersionDropdown.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NamanGarg2075/GeekyWeb/HEAD/static/img/tutorial/docsVersionDropdown.png -------------------------------------------------------------------------------- /src/components/Courses/Courses.module.css: -------------------------------------------------------------------------------- 1 | .cards{ 2 | display: flex; 3 | flex-wrap: wrap; 4 | gap: 20px; 5 | justify-content: center; 6 | } -------------------------------------------------------------------------------- /src/pages/markdown-page.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Markdown page example 3 | --- 4 | 5 | # Markdown page example 6 | 7 | You don't need React to write simple standalone pages. 8 | -------------------------------------------------------------------------------- /src/components/HomePageFeatures/HomepageFeatures.module.css: -------------------------------------------------------------------------------- 1 | .features { 2 | display: flex; 3 | align-items: center; 4 | padding: 2rem 0; 5 | width: 100%; 6 | } 7 | 8 | .featureSvg { 9 | height: 200px; 10 | width: 200px; 11 | } 12 | -------------------------------------------------------------------------------- /src/pages/courses.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Layout from '@theme/Layout'; 3 | import Courses from '../components/Courses/Courses'; 4 | 5 | const introduction = () => { 6 | return ( 7 | 8 | 9 | 10 | ) 11 | } 12 | 13 | export default introduction; -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Dependencies 2 | /node_modules 3 | 4 | # Production 5 | /build 6 | 7 | # Generated files 8 | .docusaurus 9 | .cache-loader 10 | 11 | # Misc 12 | .DS_Store 13 | .env.local 14 | .env.development.local 15 | .env.test.local 16 | .env.production.local 17 | 18 | npm-debug.log* 19 | yarn-debug.log* 20 | yarn-error.log* 21 | 22 | demo.txt 23 | -------------------------------------------------------------------------------- /src/components/Courses/Courses.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Card from '../Card/Card'; 3 | import sytles from './Courses.module.css'; 4 | import cardsData from '../../../docs/cards-data/cards-data'; 5 | 6 | const Courses = () => { 7 | return ( 8 |
9 | {cardsData.map((card) => ( 10 | 11 | ))} 12 |
13 | ) 14 | } 15 | 16 | export default Courses; -------------------------------------------------------------------------------- /src/pages/index.module.css: -------------------------------------------------------------------------------- 1 | /** 2 | * CSS files with the .module.css suffix will be treated as CSS modules 3 | * and scoped locally. 4 | */ 5 | 6 | .heroBanner { 7 | padding: 4rem 0; 8 | text-align: center; 9 | position: relative; 10 | overflow: hidden; 11 | } 12 | 13 | @media screen and (max-width: 966px) { 14 | .heroBanner { 15 | padding: 2rem; 16 | } 17 | } 18 | 19 | .buttons { 20 | display: flex; 21 | align-items: center; 22 | justify-content: center; 23 | } 24 | -------------------------------------------------------------------------------- /blog/authors.yml: -------------------------------------------------------------------------------- 1 | endi: 2 | name: Endilie Yacop Sucipto 3 | title: Maintainer of Docusaurus 4 | url: https://github.com/endiliey 5 | image_url: https://github.com/endiliey.png 6 | 7 | yangshun: 8 | name: Yangshun Tay 9 | title: Front End Engineer @ Facebook 10 | url: https://github.com/yangshun 11 | image_url: https://github.com/yangshun.png 12 | 13 | slorber: 14 | name: Sébastien Lorber 15 | title: Docusaurus maintainer 16 | url: https://sebastienlorber.com 17 | image_url: https://github.com/slorber.png 18 | -------------------------------------------------------------------------------- /src/components/Adsence/DisplayAd.js: -------------------------------------------------------------------------------- 1 | import React, { useEffect } from 'react'; 2 | 3 | function DisplayAd() { 4 | useEffect(() => { 5 | (window.adsbygoogle = window.adsbygoogle || []).push({}); 6 | }, []); 7 | 8 | return ( 9 | 17 | ); 18 | } 19 | 20 | export default DisplayAd; 21 | -------------------------------------------------------------------------------- /src/components/Adsence/InArticleAd.js: -------------------------------------------------------------------------------- 1 | import React, { useEffect } from 'react'; 2 | 3 | function InArticleAd() { 4 | useEffect(() => { 5 | (window.adsbygoogle = window.adsbygoogle || []).push({}); 6 | }, []); 7 | 8 | return ( 9 | 18 | ); 19 | } 20 | 21 | export default InArticleAd; 22 | -------------------------------------------------------------------------------- /docs/languages/html/doctypes/introduction.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Introduction to Doctypes. 3 | keywords: [coding, web development, html] 4 | sidebar_position: 1 5 | sidebar_label: Doctypes 6 | slug: /html/doctypes 7 | --- 8 | 9 | import DocCardList from '@theme/DocCardList'; 10 | import {useCurrentSidebarCategory} from '@docusaurus/theme-common'; 11 | 12 | Doctypes - short for 'document type' - help browsers to understand the version of HTML the document is written in for better interpretability. Doctype declarations are not HTML tags and belong at the very top of a document. This topic explains the structure and declaration of various doctypes in HTML. 13 | 14 |
15 | -------------------------------------------------------------------------------- /docs/languages/html/headings/introduction.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Introduction to Headings. 3 | keywords: [coding, web development, html] 4 | sidebar_position: 1 5 | sidebar_label: Headings 6 | slug: /html/headings 7 | --- 8 | 9 | import DocCardList from '@theme/DocCardList'; 10 | import {useCurrentSidebarCategory} from '@docusaurus/theme-common'; 11 | 12 | HTML provides not only plain paragraph tags, but six separate header tags to indicate headings of various sizes and thicknesses. Enumerated as heading 1 through heading 6, heading 1 has the largest and thickest text while heading 6 is the smallest and thinnest, down to the paragraph level. This topic details proper usage of these tags. 13 | 14 |
15 | 16 | -------------------------------------------------------------------------------- /docs/languages/html/headings/using-headings.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Using Headings. 3 | keywords: [coding, web development, html] 4 | sidebar_position: 2 5 | sidebar_label: Using Headings 6 | slug: /html/headings/using-headings 7 | --- 8 | 9 | Headings can be used to describe the topic they precede and they are defined with the `

` to `

` tags. Headings support all the [global attributes](http://stackoverflow.com/documentation/html/2811/global-attributes). 10 | 11 | - `

` defines the most important heading. 12 | - `

` defines the least important heading. 13 | 14 | **Defining a heading:** 15 | 16 | ```html 17 |

Heading 1

18 |

Heading 2

19 |

Heading 3

20 |

Heading 4

21 |
Heading 5
22 |
Heading 6
23 | ``` 24 | -------------------------------------------------------------------------------- /docs/cards-data/cards-data.js: -------------------------------------------------------------------------------- 1 | const cardsData = [ 2 | { 3 | id: 1, 4 | imgSrc: '/img/courses/html-language.png', 5 | title: 'HTML - Hypertext Markup Language', 6 | category: 'Web Development,', 7 | path: 'html' 8 | }, 9 | { 10 | id: 2, 11 | imgSrc: '/img/courses/kotlin-language.png', 12 | title: 'Kotlin - Modern Programming Language', 13 | category: 'Mobile Development', 14 | path: 'kotlin/getting-started-with-kotlin', 15 | }, 16 | { 17 | id: 3, 18 | imgSrc: '/img/courses/jquery-language.png', 19 | title: 'jQuery - Write Less, Do More', 20 | category: 'Web Development', 21 | path: 'jquery/getting-started-with-jquery', 22 | }, 23 | ] 24 | 25 | export default cardsData; 26 | -------------------------------------------------------------------------------- /docs/languages/jquery/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Disclaimer - JQuery Docs 3 | sidebar_position: 1 4 | sidebar_label: Disclaimer 5 | slug: /jquery 6 | --- 7 | 8 | # Disclaimer - JQuery Docs 9 | 10 | This Tutorial is compiled from StackOverflow Documentation, the content is written by the brilliant people at Stack Overflow. Text content is released under Creative Commons BY-SA, see [contribution credits](./contributors) at the end of tutorial. Images may be copyright of their respective owners unless otherwise specified. 11 | 12 | This is an unofficial tutorial is created for educational purposes and is not affiliated with official jQuery® group(s) or company(s) nor Stack Overflow. All trademarks and registered trademarks are the property of their respective company owners. 13 | 14 | :::tip Enough Talk 15 | Enjoy!! 🥳 16 | ::: 17 | -------------------------------------------------------------------------------- /docs/languages/kotlin/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Disclaimer - Kotlin Docs 3 | sidebar_position: 1 4 | sidebar_label: Disclaimer 5 | slug: /kotlin 6 | --- 7 | 8 | # Disclaimer - Kotlin Docs 9 | 10 | This Tutorial is compiled from StackOverflow Documentation, the content is written by the brilliant people at Stack Overflow. Text content is released under Creative Commons BY-SA, see [contribution credits](./contributors) at the end of tutorial. Images may be copyright of their respective owners unless otherwise specified. 11 | 12 | This is an unofficial tutorial is created for educational purposes and is not affiliated with official Kotlin® group(s) or company(s) nor Stack Overflow. All trademarks and registered trademarks are the property of their respective company owners. 13 | 14 | :::tip Enough Talk 15 | Enjoy!! 🥳 16 | ::: 17 | -------------------------------------------------------------------------------- /docs/languages/javascript/README.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Disclaimer - JavaScript Docs 3 | sidebar_position: 1 4 | sidebar_label: Disclaimer 5 | slug: /javascript 6 | --- 7 | 8 | # Disclaimer - JavaScript Docs 9 | 10 | 11 | 12 | This is an unofficial tutorial is created for educational purposes and is not affiliated with official JavaScript® group(s) or company(s) nor Stack Overflow. All trademarks and registered trademarks are the property of their respective company owners. 13 | 14 | :::tip Enough Talk 15 | Enjoy!! 🥳 16 | ::: 17 | -------------------------------------------------------------------------------- /docs/languages/html/doctypes/remarks.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Remarks. 3 | keywords: [coding, web development, html] 4 | sidebar_position: 4 5 | sidebar_label: Remarks 6 | slug: /html/doctypes/remarks 7 | --- 8 | 9 | :::success Remarks 10 | The `` declaration is not an HTML tag. It is used for specifying which version of HTML the document is using. This is referred to as the document type declaration (DTD). 11 | 12 | The `` declaration is NOT case sensitive. To check if the HTML of your Web pages is valid, go to [W3C's validation service](http://validator.w3.org/). 13 | 14 | - Some old versions of IE don't support some HTML tags unless a proper doctype is available. 15 | - It's **vital** that a doctype is declared as to make sure the browser doesn't use quirks mode. [More info on MDN.](https://developer.mozilla.org/en-US/docs/Quirks_Mode_and_Standards_Mode) 16 | ::: 17 | -------------------------------------------------------------------------------- /docs/languages/html/lists/unordered-list.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Unordered Lists. 3 | keywords: [coding, web development, html, lists] 4 | sidebar_position: 3 5 | sidebar_label: Unordered Lists 6 | slug: /html/lists/unordered-list 7 | --- 8 | 9 | import BrowserWindow from "@site/src/components/BrowserWindow"; 10 | 11 | Unordered lists are used when the order of items is not important. Similar to ordered lists, each item in an unordered list is represented by the `
  • ` tag. However, unordered lists are wrapped within the `
      ` tags. By default, unordered lists are displayed with bullet points as markers. Here's an example: 12 | 13 | ```html 14 |
        15 |
      • First item
      • 16 |
      • Second item
      • 17 |
      • Third item
      • 18 |
      19 | ``` 20 | 21 | 22 |
        23 |
      • First item
      • 24 |
      • Second item
      • 25 |
      • Third item
      • 26 |
      27 |
      28 | -------------------------------------------------------------------------------- /docs/languages/html/getting-started/element-insight.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Element Insight 3 | # description: HTML stands for hypertext markup language used to create web pages using a markup language. HTML is the root language.... 4 | # image: "/img/docs/html/introduction-to-html.png" 5 | keywords: [coding, web development, html, introduction to html, what is html] 6 | sidebar_position: 2 7 | sidebar_label: Elements Insight 8 | slug: /html/intro/elements-insight 9 | --- 10 | 11 | Let's break down a tag... 12 | 13 | The `

      ` tag represents a common paragraph. 14 | 15 | Elements commonly have an opening tag and a closing tag. The opening tag contains the element's name in angle brackets (`

      `). The closing tag is identical to the opening tag with the addition of a forward slash (`/`) between the opening bracket and the element's name (`

      `). 16 | 17 | Content can then go between these two tags: `

      This is a simple paragraph.

      `. 18 | -------------------------------------------------------------------------------- /docs/languages/html/getting-started/remarks.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Remarks 3 | # description: HTML stands for hypertext markup language used to create web pages using a markup language. HTML is the root language.... 4 | # image: "/img/docs/html/introduction-to-html.png" 5 | keywords: [coding, web development, html, introduction to html, what is html] 6 | sidebar_position: 5 7 | sidebar_label: Remarks 8 | slug: /html/intro/remarks 9 | --- 10 | 11 | :::success Remarks 12 | [HTML](https://en.wikipedia.org/wiki/HTML) (**H**yper**t**ext **M**arkup **L**anguage) is an [XML](http://stackoverflow.com/documentation/xml/882/introduction-to-xml#t=201608040152247808936)-compliant system of annotating documents with 'tags'. It is used specifically to create content for web pages and web applications, which can then be shared over a network. 13 | ::: 14 | Apart from text, the current version of HTML supports many different [types of media](https://en.wikipedia.org/wiki/Media_type), including images and videos. 15 | -------------------------------------------------------------------------------- /docs/languages/html/lists/remarks.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Remarks. 3 | keywords: [coding, web development, html] 4 | sidebar_position: 4 5 | sidebar_label: Remarks 6 | slug: /html/lists/remarks 7 | --- 8 | 9 | import BrowserWindow from "@site/src/components/BrowserWindow"; 10 | 11 | :::success Remarks 12 | HTML lists, such as ordered and unordered lists, are valuable for organizing information on web pages. They allow you to present items in a logical and structured manner. Whether you need to create a simple list or a nested hierarchy, HTML lists offer flexibility and readability. By using the `
        `, `
          `, and `
        1. ` tags, you can easily create lists that enhance the organization and presentation of your content. For example: 13 | 14 | ```html 15 |
            16 |
          • First item
          • 17 |
          • Second item
          • 18 |
          • Third item
          • 19 |
          20 | ``` 21 | 22 | This code will generate an unordered list with three items: 23 | 24 | - First item 25 | - Second item 26 | - Third item 27 | 28 | Remember that you can also customize the appearance of your lists using CSS to match your desired style and design. 29 | 30 | ::: 31 | -------------------------------------------------------------------------------- /docs/languages/html/lists/introduction.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Introduction to Lists. 3 | keywords: [coding, web development, html, lists] 4 | sidebar_position: 1 5 | sidebar_label: Lists 6 | slug: /html/lists 7 | --- 8 | 9 | import DocCardList from "@theme/DocCardList"; 10 | import { useCurrentSidebarCategory } from "@docusaurus/theme-common"; 11 | 12 | HTML lists are an integral part of web development, serving as a powerful tool for organizing and structuring content on web pages. Whether you need to present a collection of items, create a set of instructions, or highlight key points, HTML lists provide a flexible and intuitive way to present information. By utilizing ordered lists `
            `, unordered lists `
              `, list items `
            • `, and nesting capabilities, developers can create visually appealing and well-organized content that enhances readability and user experience. In this article, we will explore the different types of HTML lists, their usage, and provide examples to demonstrate their effectiveness in creating structured and easily digestible web content. 13 | 14 |
              15 | 16 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 NamanGarg2075 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /docs/languages/html/getting-started/creating-page.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Creating a Page 3 | # description: HTML stands for hypertext markup language used to create web pages using a markup language. HTML is the root language.... 4 | # image: "/img/docs/html/introduction-to-html.png" 5 | keywords: [coding, web development, html, introduction to html, what is html] 6 | sidebar_position: 3 7 | sidebar_label: Creating a Page 8 | slug: /html/intro/creating-a-page 9 | --- 10 | 11 | The following HTML example creates a simple ["Hello World"](https://en.wikipedia.org/wiki/%22Hello,_World!%22_program) web page. 12 | 13 | HTML files can be created using any [text editor](https://en.wikipedia.org/wiki/Text_editor). The files must be saved with a `.html` or `.htm` extension in order to be recognized as HTML files. 14 | 15 | Once created, this file can be opened in any web browser. 16 | 17 | ```html 18 | 19 | 20 | 21 | 22 | Hello! 23 | 24 | 25 | 26 |

              Hello World!

              27 |

              This is a simple paragraph.

              28 | 29 | 30 | ``` 31 | -------------------------------------------------------------------------------- /docs/languages/html/doctypes/adding-the-doctype.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Adding the Doctype. 3 | keywords: [coding, web development, html] 4 | sidebar_position: 2 5 | sidebar_label: Adding the Doctype 6 | slug: /html/doctypes/adding-the-doctypes 7 | --- 8 | 9 | The `` declaration should always be included at the top of the HTML document, before the `` tag. 10 | 11 | See [HTML 5 Doctype](http://stackoverflow.com/documentation/html/806/doctypes/16623/html-5-doctype) for details on the HTML 5 Doctype. 12 | 13 | ```html 14 | 15 | ``` 16 | 17 | See [HTML 4.01 Doctypes](http://stackoverflow.com/documentation/html/806/doctypes/3148/html-4-01-doctypes) for details on how these types differ from each other. 18 | 19 | **Strict** 20 | 21 | ```html 22 | 23 | ``` 24 | 25 | **Transitional** 26 | 27 | ```html 28 | 29 | ``` 30 | 31 | **Frameset** 32 | 33 | ```html 34 | 35 | ``` -------------------------------------------------------------------------------- /docs/languages/html/headings/correct-structure-matters.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Correct Structure. 3 | keywords: [coding, web development, html] 4 | sidebar_position: 3 5 | sidebar_label: Correct Structure Matters 6 | slug: /html/headings/correct-structure-matters 7 | --- 8 | 9 | **Search engines** and other **user agents** usually index page content based on heading elements, for example to create a table of contents, so using the correct structure for headings is important. 10 | 11 | In general, an article should have one `h1` element for the main title followed by `h2` subtitles – going down a layer if necessary. If there are `h1` elements on a higher level they shoudn't be used to describe any lower level content. 12 | 13 | **Example document (extra intendation to illustrate hierarchy):** 14 | 15 | ```html 16 |

              Main title

              17 |

              Introduction

              18 | 19 |

              Reasons

              20 | 21 |

              Reason 1

              22 |

              Paragraph

              23 | 24 |

              Reason 2

              25 |

              Paragraph

              26 | 27 |

              In conclusion

              28 |

              Paragraph

              29 | ``` 30 | 31 | ## Syntax 32 | 33 | - `

              ...

              ` 34 | - `

              ...

              ` 35 | - `

              ...

              ` 36 | - `

              ...

              ` 37 | - `
              ...
              ` 38 | - `
              ...
              ` 39 | -------------------------------------------------------------------------------- /src/components/BrowserWindow/index.tsx: -------------------------------------------------------------------------------- 1 | import React, { type ReactNode } from 'react'; 2 | 3 | import './styles.index.css'; 4 | 5 | interface Props { 6 | children: ReactNode; 7 | minHeight: number; 8 | url: string; 9 | } 10 | 11 | function BrowserWindow({ 12 | children, 13 | minHeight, 14 | url = 'GeekyWeb', 15 | }: Props): JSX.Element { 16 | return ( 17 |
              18 |
              19 |
              20 | 21 | 22 | 23 |
              24 |
              {url}
              25 |
              26 |
              27 | 28 | 29 | 30 |
              31 |
              32 |
              33 | 34 |
              {children}
              35 |
              36 | ); 37 | } 38 | 39 | export default BrowserWindow; -------------------------------------------------------------------------------- /src/components/Card/Card.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import Link from '@docusaurus/Link'; 3 | 4 | import './Card.css'; 5 | 6 | const Card = ({ data }) => { 7 | return ( 8 | <> 9 |
              10 |
              11 |
              12 | {data.title} 13 |
              14 |
              15 | {data.category} 16 |

              {data.title}

              17 | {/*

              course paragraph here

              */} 18 |
              19 |
              20 | 23 | Start Course → 24 | 25 |
              26 |
              27 |
              28 | 29 | ) 30 | }; 31 | 32 | export default Card; 33 | -------------------------------------------------------------------------------- /docs/languages/kotlin/kotlin-caveats.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Kotlin Caveats 3 | description: Explore the key caveats and considerations when working with Kotlin, a popular programming language for Android development and beyond. Discover potential challenges, limitations, and important factors to be aware of to enhance your Kotlin coding experience and optimize your projects 4 | # image: "#" 5 | keywords: 6 | [ 7 | Kotlin, 8 | programming language, 9 | Android development, 10 | caveats, 11 | considerations, 12 | challenges, 13 | limitations, 14 | best practices, 15 | tips, 16 | optimization, 17 | coding experience, 18 | Android apps, 19 | Kotlin development, 20 | ] 21 | sidebar_position: 38 22 | sidebar_label: Kotlin Caveats 23 | slug: /kotlin/kotlin-caveats 24 | --- 25 | 26 | ## Calling a toString() on a nullable type 27 | 28 | A thing to look out for when using the `toString` method in Kotlin is the handling of null in combination with the `String?`. 29 | 30 | For example you want to get text from an `EditText` in Android. 31 | 32 | You would have a piece of code like: 33 | 34 | ```kotlin 35 | // Correct: 36 | val text = view.textField?.text?.toString() ?: "" 37 | ``` 38 | -------------------------------------------------------------------------------- /docs/languages/html/headings/remarks.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Remarks. 3 | keywords: [coding, web development, html] 4 | sidebar_position: 4 5 | sidebar_label: Remarks 6 | slug: /html/headings/remarks 7 | --- 8 | 9 | :::success Remarks 10 | 11 | - An `h1`–`h6` element must have both a start tag and an end tag.[**1**](https://www.w3.org/TR/html-markup/h1.html) 12 | - `h1`–`h6` elements are block level elements by default (CSS style: `display: block`).[**2**](https://www.w3.org/TR/html401/struct/global.html#h-7.5.3) 13 | - `h1`–`h6` elements should not be confused with the [section element](http://stackoverflow.com/documentation/html/311/sectioning-elements#t=201607262130086028708) 14 | - Heading tags (`h1`–`h6`) are not related to the `head` tag. 15 | - Permitted Content: [phrasing content](https://www.w3.org/TR/html-markup/terminology.html#phrasing-content) 16 | - The different CSS-styles for headings differ usually in `font-size` and `margin`. The following CSS-settings for `h1`–`h6` elements can serve as an orientation (characterized as 'informative' by the [W3C](https://www.w3.org/TR/CSS21/sample.html)) 17 | - Search engine spiders (the code that adds a page to a search engine) automatically pays more attention to higher importance (h1 has most, h2 has less, h3 has even less, ...) headings to discern what a page is about. 18 | ::: 19 | -------------------------------------------------------------------------------- /docs/languages/html/lists/ordered-list.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Ordered Lists. 3 | keywords: [coding, web development, html, lists] 4 | sidebar_position: 2 5 | sidebar_label: Ordered Lists 6 | slug: /html/lists/ordered-list 7 | --- 8 | 9 | import BrowserWindow from "@site/src/components/BrowserWindow"; 10 | 11 | Ordered lists are used when the order of items is important. Each item in an ordered list is represented by the `
            • ` "list item" tag. The ordered list itself is wrapped within the `
                ` tags. By default, ordered lists are displayed with numbers or letters as markers. Here's an example of an ordered list: 12 | 13 | ```html 14 |
                  15 |
                1. First item
                2. 16 |
                3. Second item
                4. 17 |
                5. Third item
                6. 18 |
                19 | ``` 20 | 21 | 22 |
                  23 |
                1. First item
                2. 24 |
                3. Second item
                4. 25 |
                5. Third item
                6. 26 |
                27 |
                28 | 29 | You can also customize the type of markers in an ordered list by using the type attribute within the `
                  ` tag. For example, using the attribute `type="A"` will display capital letters [A, B, C] as markers: 30 | 31 | ```html 32 |
                    33 |
                  1. Item A
                  2. 34 |
                  3. Item B
                  4. 35 |
                  5. Item C
                  6. 36 |
                  37 | ``` 38 | 39 | 40 |
                    41 |
                  1. Item A
                  2. 42 |
                  3. Item B
                  4. 43 |
                  5. Item C
                  6. 44 |
                  45 |
                  46 | -------------------------------------------------------------------------------- /docs/languages/html/lists/nested-list.mdx: -------------------------------------------------------------------------------- 1 | --- 2 | title: Nested Lists. 3 | keywords: [coding, web development, html, lists] 4 | sidebar_position: 3 5 | sidebar_label: Nested Lists 6 | slug: /html/lists/nested-list 7 | --- 8 | 9 | import BrowserWindow from "@site/src/components/BrowserWindow"; 10 | 11 | HTML allows the nesting of lists within other lists, creating a hierarchical structure. This is achieved by placing a new `
                    ` or `
                      ` within an `
                    • ` tag. Here's an example of a nested list: 12 | 13 | ```html 14 |
                        15 |
                      1. First item
                      2. 16 |
                      3. 17 | Second item 18 |
                          19 |
                        1. Nested item 1
                        2. 20 |
                        3. Nested item 2
                        4. 21 |
                        22 |
                      4. 23 |
                      5. Third item
                      6. 24 |
                      25 | ``` 26 | 27 | 28 |
                        29 |
                      1. First item
                      2. 30 |
                      3. 31 | Second item 32 |
                          33 |
                        1. Nested item 1
                        2. 34 |
                        3. Nested item 2
                        4. 35 |
                        36 |
                      4. 37 |
                      5. Third item
                      6. 38 |
                      39 |
                      40 | 41 | Nested lists can have any level of depth, allowing you to create complex and organized structures within your web pages. 42 | 43 | In conclusion, HTML lists, including ordered lists and unordered lists, are powerful tools for structuring and organizing content. By using `
                        `, `
                          `, and `
                        • ` tags, combined with nesting, developers can create well-formatted and easy-to-read lists in their web pages. 44 | -------------------------------------------------------------------------------- /docs/languages/kotlin/junit.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: JUnit in Kotlin 3 | description: Explore the powerful combination of JUnit and Kotlin to enhance your software testing capabilities. This comprehensive guide dives into the seamless integration of JUnit, a widely-used testing framework, with Kotlin, a modern and concise programming language. Discover how to write clean and efficient unit tests, leverage Kotlin's expressive syntax, and harness the full potential of JUnit's extensive features. Boost your development workflow and ensure the quality and reliability of your Kotlin applications with JUnit 4 | # image: "#" 5 | keywords: 6 | [ 7 | JUnit, 8 | Kotlin, 9 | software testing, 10 | testing framework, 11 | unit tests, 12 | programming language, 13 | Kotlin syntax, 14 | test automation, 15 | testing capabilities, 16 | reliable applications, 17 | development workflow, 18 | JUnit features, 19 | Kotlin applications, 20 | ] 21 | sidebar_position: 34 22 | sidebar_label: JUnit 23 | slug: /kotlin/junit 24 | --- 25 | 26 | ## Rules 27 | 28 | To add a JUnit [rule](https://github.com/junit-team/junit4/wiki/rules) to a test fixture: 29 | 30 | ```kotlin 31 | @Rule @JvmField val myRule = TemporaryFolder() 32 | ``` 33 | 34 | The `@JvmField` annotation is necessary to expose the backing field with the same visibility (public) as the `myRule` property (see [answer](http://stackoverflow.com/questions/32899947/kotlin-junit-rules)). JUnit rules require the annotated rule field to be public. 35 | -------------------------------------------------------------------------------- /docs/languages/kotlin/logging-in-kotlin.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Logging in kotlin 3 | description: Learn how to implement robust and efficient logging in Kotlin to enhance the reliability, maintainability, and performance of your applications. This guide provides step-by-step instructions and best practices for leveraging Kotlin's logging capabilities, including logging frameworks, log levels, structured logging, exception handling, and integration with popular logging libraries. Improve debugging and troubleshooting processes while optimizing SEO visibility with proper logging practices in Kotlin 4 | # image: "#" 5 | keywords: 6 | [ 7 | Kotlin logging, 8 | application logging, 9 | logging frameworks, 10 | log levels, 11 | structured logging, 12 | exception handling, 13 | logging best practices, 14 | Kotlin logging libraries, 15 | debugging, 16 | troubleshooting, 17 | SEO visibility, 18 | efficient logging, 19 | maintainability, 20 | reliability, 21 | performance enhancement, 22 | ] 23 | sidebar_position: 32 24 | sidebar_label: Logging 25 | slug: /kotlin/logging 26 | --- 27 | 28 | ## kotlin.logging 29 | 30 | ```kotlin 31 | class FooWithLogging { 32 | companion object: KLogging() 33 | 34 | fun bar() { 35 | logger.info { "hello $name" } 36 | } 37 | 38 | fun logException(e: Exception) { 39 | logger.error(e) { "Error occured" } 40 | } 41 | } 42 | ``` 43 | 44 | Using [kotlin.logging](https://github.com/MicroUtils/kotlin.logging) framework 45 | 46 | ## Remarks 47 | 48 | Related question: [Idiomatic way of logging in Kotlin](http://stackoverflow.com/q/34416869/986533) 49 | -------------------------------------------------------------------------------- /src/pages/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import clsx from 'clsx'; 3 | import Layout from '@theme/Layout'; 4 | import Link from '@docusaurus/Link'; 5 | import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; 6 | import styles from './index.module.css'; 7 | import './index.module.css'; 8 | import HomepageFeatures from '../components/HomePageFeatures/HomepageFeatures'; 9 | // import "@fontsource/josefin-sans"; 10 | // import "@fontsource/fredoka-one"; 11 | // import "@fontsource/patrick-hand"; 12 | import "@fontsource/cascadia-code"; 13 | import "@fontsource/balsamiq-sans"; 14 | 15 | 16 | function HomepageHeader() { 17 | const { siteConfig } = useDocusaurusContext(); 18 | return ( 19 |
                          20 |
                          21 |

                          {siteConfig.title}

                          22 |

                          {siteConfig.tagline}

                          23 |
                          24 | 27 | Start Learning 28 | 29 |
                          30 |
                          31 |
                          32 | ); 33 | } 34 | 35 | export default function Features() { 36 | const { siteConfig } = useDocusaurusContext(); 37 | return ( 38 | 42 | 43 |
                          44 | 45 |
                          46 |
                          47 | ); 48 | } 49 | -------------------------------------------------------------------------------- /docs/languages/kotlin/class-delegation.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Class Deliegation in Kotlin 3 | description: Learn how to leverage class delegation in Kotlin to enhance code reusability and maintainability. Class delegation allows you to delegate the implementation of certain functionalities to other classes, reducing boilerplate code and promoting cleaner, more modular designs. Discover the power of delegation patterns and how they can help you write more concise and scalable Kotlin code. Whether you're a beginner or an experienced Kotlin developer, this comprehensive guide will provide you with practical examples and insights to effectively utilize class delegation in your projects 4 | # image: "#" 5 | keywords: 6 | [ 7 | Kotlin class delegation, 8 | code reusability, 9 | maintainability, 10 | delegation patterns, 11 | Kotlin programming, 12 | Kotlin developer, 13 | modular design, 14 | Kotlin code examples, 15 | clean code, 16 | scalable code, 17 | Kotlin tutorials, 18 | ] 19 | sidebar_position: 16 20 | sidebar_label: Class Delegation 21 | slug: /kotlin/class-delegation 22 | --- 23 | 24 | A Kotlin class may implement an interface by delegating its methods and properties to another object that implements that interface. This provides a way to compose behavior using association rather than inheritance. 25 | 26 | ## Delegate a method to another class 27 | 28 | ```kotlin 29 | interface Foo { 30 | fun example() 31 | } 32 | 33 | class Bar { 34 | fun example() { 35 | println("Hello, world!") 36 | } 37 | } 38 | 39 | class Baz(b : Bar) : Foo by b 40 | 41 | Baz(Bar()).example() 42 | ``` 43 | 44 | The example prints `Hello, world!` 45 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "geekyweb", 3 | "version": "0.0.0", 4 | "private": true, 5 | "scripts": { 6 | "docusaurus": "docusaurus", 7 | "start": "docusaurus start", 8 | "build": "docusaurus build", 9 | "swizzle": "docusaurus swizzle", 10 | "deploy": "docusaurus deploy", 11 | "clear": "docusaurus clear", 12 | "serve": "docusaurus serve", 13 | "write-translations": "docusaurus write-translations", 14 | "write-heading-ids": "docusaurus write-heading-ids" 15 | }, 16 | "dependencies": { 17 | "@algolia/client-search": "^5.0.0-alpha.108", 18 | "@docusaurus/core": "^2.4.1", 19 | "@docusaurus/plugin-client-redirects": "^2.4.1", 20 | "@docusaurus/plugin-google-gtag": "^2.4.1", 21 | "@docusaurus/plugin-sitemap": "^2.4.1", 22 | "@docusaurus/preset-classic": "^2.4.1", 23 | "@easyops-cn/docusaurus-search-local": "^0.21.4", 24 | "@fontsource/balsamiq-sans": "^4.5.9", 25 | "@fontsource/cascadia-code": "^4.2.1", 26 | "@fontsource/fredoka-one": "^4.5.1", 27 | "@fontsource/josefin-sans": "^4.5.3", 28 | "@fontsource/patrick-hand": "^4.5.1", 29 | "@mdx-js/react": "^1.6.21", 30 | "browser-window": "^0.4.0", 31 | "clsx": "^1.1.1", 32 | "prism-react-renderer": "^1.2.1", 33 | "react": "^17.0.1", 34 | "react-dom": "^17.0.1", 35 | "react-loadable": "^5.5.0", 36 | "react-to-print": "^2.14.4", 37 | "sharethis-reactjs": "^1.6.0", 38 | "typescript": ">=2.7" 39 | }, 40 | "browserslist": { 41 | "production": [ 42 | ">0.5%", 43 | "not dead", 44 | "not op_mini all" 45 | ], 46 | "development": [ 47 | "last 1 chrome version", 48 | "last 1 firefox version", 49 | "last 1 safari version" 50 | ] 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /docs/languages/kotlin/visibility-modifiers.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Visibility Modifiers in Kotlin 3 | description: Learn all about visibility modifiers in Kotlin and how they enhance code organization and encapsulation. Discover the significance of public, private, protected, and internal modifiers, and gain insights into their practical usage. Gain a deeper understanding of Kotlin's visibility modifiers to improve the maintainability, readability, and security of your Kotlin projects 4 | # image: "#" 5 | keywords: 6 | [ 7 | Kotlin visibility modifiers, 8 | public modifier, 9 | private modifier, 10 | protected modifier, 11 | internal modifier, 12 | code organization, 13 | encapsulation, 14 | Kotlin code readability, 15 | Kotlin code maintainability, 16 | Kotlin project security, 17 | Kotlin programming language, 18 | Kotlin tutorials, 19 | Kotlin development, 20 | Kotlin best practices, 21 | ] 22 | sidebar_position: 18 23 | sidebar_label: Visibility Modifiers 24 | slug: /kotlin/visibility-modifiers 25 | --- 26 | 27 | In Kotlin, there are 4 types of visibility modifiers are available. 28 | 29 | - **Public:** This can be accessed from anywhere. 30 | - **Private:** This can only be accessed from the module code. 31 | - **Protected:** This can only be accessed from the class defining it and any derived classes. 32 | - **Internal:** This can only be accessed from the scope of the class defining it. 33 | 34 | ## Code Sample 35 | 36 | - **Public:** `public val name = "Avijit"` 37 | - **Private:** `private val name = "Avijit"` 38 | - **Protected:** `protected val name = "Avijit"` 39 | - **Internal:** `internal val name = "Avijit"` 40 | 41 | ## Syntax 42 | 43 | - ` val/var = ` 44 | -------------------------------------------------------------------------------- /docs/languages/jquery/each-function.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Each Function in jQuery 3 | description: jQuery is a popular JavaScript library that simplifies HTML document traversal, event handling, and animation. It provides a wide range of functions and methods to manipulate and interact with web pages. This documentation provides detailed information about each function in jQuery, including its purpose, parameters, and usage examples. Whether you're a beginner or an experienced developer, this comprehensive guide will help you harness the power of jQuery and enhance your web development projects 4 | # image: "#" 5 | keywords: 6 | [ 7 | jQuery functions, 8 | jQuery methods, 9 | JavaScript library, 10 | HTML document traversal, 11 | event handling, 12 | animation, 13 | web page manipulation, 14 | web development, 15 | usage examples, 16 | jQuery documentation, 17 | beginner-friendly guide, 18 | experienced developers, 19 | jQuery tutorial, 20 | JavaScript framework, 21 | ] 22 | sidebar_position: 4 23 | sidebar_label: Each Function 24 | slug: /jquery/each-function 25 | --- 26 | 27 | ## jQuery each function 28 | 29 | HTML: 30 | 31 | ```html 32 |
                            33 |
                          • Mango
                          • 34 |
                          • Book
                          • 35 |
                          36 | ``` 37 | 38 | Script: 39 | 40 | ```js 41 | $("li").each(function (index) { 42 | console.log(index + ": " + $(this).text()); 43 | }); 44 | ``` 45 | 46 | A message is thus logged for each item in the list: 47 | 48 | 0: Mango 49 | 50 | 1: Book 51 | 52 | ## Basic use 53 | 54 | ```js 55 | // array 56 | var arr = ["one", "two", "three", "four"]; 57 | $.each(arr, function (index, value) { 58 | console.log(value); 59 | 60 | // Will stop running after "three" 61 | return value !== "three"; 62 | }); 63 | // Outputs: one two three 64 | ``` 65 | -------------------------------------------------------------------------------- /src/components/BrowserWindow/styles.index.css: -------------------------------------------------------------------------------- 1 | .browserWindow { 2 | border: 3px solid var(--ifm-color-emphasis-200); 3 | border-top-left-radius: var(--ifm-global-radius); 4 | border-top-right-radius: var(--ifm-global-radius); 5 | box-shadow: var(--ifm-global-shadow-lw); 6 | margin-bottom: var(--ifm-leading); 7 | } 8 | 9 | .browserWindowHeader { 10 | align-items: center; 11 | background: var(--ifm-color-emphasis-200); 12 | display: flex; 13 | padding: 0.5rem 1rem; 14 | } 15 | 16 | .row::after { 17 | content: ''; 18 | display: table; 19 | clear: both; 20 | } 21 | 22 | .buttons { 23 | white-space: nowrap; 24 | } 25 | 26 | .right { 27 | align-self: center; 28 | width: 10%; 29 | } 30 | 31 | html[data-theme='light'] { 32 | --ifm-background-color: #fff; 33 | } 34 | 35 | .browserWindowAddressBar { 36 | flex: 1 0; 37 | margin: 0 1rem 0 0.5rem; 38 | border-radius: 12.5px; 39 | background-color: var(--ifm-background-color); 40 | color: var(--ifm-color-gray-800); 41 | padding: 5px 15px; 42 | font: 400 13px Arial, sans-serif; 43 | user-select: none; 44 | } 45 | 46 | html[data-theme='dark'] .browserWindowAddressBar { 47 | color: var(--ifm-color-gray-300); 48 | } 49 | 50 | .dot { 51 | margin-right: 6px; 52 | margin-top: 4px; 53 | height: 12px; 54 | width: 12px; 55 | background-color: #bbb; 56 | border-radius: 50%; 57 | display: inline-block; 58 | } 59 | 60 | .browserWindowMenuIcon { 61 | margin-left: auto; 62 | } 63 | 64 | .bar { 65 | width: 17px; 66 | height: 3px; 67 | background-color: #aaa; 68 | margin: 3px 0; 69 | display: block; 70 | } 71 | 72 | .browserWindowBody { 73 | padding: 1rem; 74 | } -------------------------------------------------------------------------------- /src/components/Card/Card.css: -------------------------------------------------------------------------------- 1 | .card-container { 2 | display: flex; 3 | flex-wrap: wrap; 4 | justify-content: center; 5 | max-width: 1200px; 6 | margin-block: 2rem; 7 | gap: 2rem; 8 | } 9 | .card-container img { 10 | max-width: 100%; 11 | display: block; 12 | object-fit: cover; 13 | } 14 | .card-container .card { 15 | display: flex; 16 | flex-direction: column; 17 | width: clamp(20rem, calc(20rem + 2vw), 22rem); 18 | overflow: hidden; 19 | box-shadow: 0 0.1rem 1rem rgba(0, 0, 0, 0.1); 20 | border-radius: 1em; 21 | /* background: #ece9e6; */ 22 | /* background: linear-gradient(to right, #fff, #ece9e6); */ 23 | } 24 | .card-container .card__body { 25 | padding: 1rem; 26 | display: flex; 27 | flex-direction: column; 28 | gap: 0.5rem; 29 | } 30 | .card-container .tag { 31 | align-self: flex-start; 32 | padding: 0.25em 0.75em; 33 | border-radius: 5px; 34 | font-size: 0.75rem; 35 | } 36 | 37 | .card-container .tag-blue { 38 | background: #00B0FF; 39 | /* background: linear-gradient(to bottom, #2f80ed, #56ccf2); */ 40 | color: #fafafa; 41 | } 42 | .card-container .card__body h4 { 43 | font-size: 1.5rem; 44 | text-transform: capitalize; 45 | } 46 | .card-container .card__footer { 47 | display: flex; 48 | padding: 1rem; 49 | margin-top: auto; 50 | } 51 | 52 | .card-container .card__footer .card__btn{ 53 | width:100%; 54 | padding: 10px 20px; 55 | background-color: var(--ifm-color-primary); 56 | border: 1px solid var(--ifm-color-primary); 57 | border-radius: 5px; 58 | cursor: pointer; 59 | transition: 0.3s; 60 | font-size: 15px; 61 | font-family:'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif 62 | } 63 | 64 | .card-container .card__footer .card__btn:hover{ 65 | background-color: transparent; 66 | color: var(--btn-color-course); 67 | } -------------------------------------------------------------------------------- /docs/languages/kotlin/coroutines.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Coroutines in Kotlin 3 | description: Master the power of coroutines in Kotlin and unlock the potential of asynchronous programming. This comprehensive guide provides a deep dive into coroutines, covering their fundamentals, benefits, and practical implementations in Kotlin. Learn how to write efficient and scalable code using suspend functions, async/await, and structured concurrency. Harness the full potential of Kotlin's coroutines to create responsive and concurrent applications. Whether you're a beginner or an experienced developer, this guide will equip you with the knowledge and tools to leverage coroutines effectively, improving the performance and responsiveness of your Kotlin projects 4 | # image: "#" 5 | keywords: 6 | [ 7 | coroutines, 8 | Kotlin, 9 | asynchronous programming, 10 | suspend functions, 11 | async/await, 12 | structured concurrency, 13 | concurrent applications, 14 | responsive applications, 15 | efficient code, 16 | scalable code, 17 | Kotlin development, 18 | asynchronous tasks, 19 | parallel execution, 20 | Kotlin coroutines guide, 21 | ] 22 | sidebar_position: 22 23 | sidebar_label: Coroutunes 24 | slug: /kotlin/coroutunes 25 | --- 26 | 27 | Examples of Kotlin's experimental(yet) implementation of coroutines 28 | 29 | ## Simple coroutine which delay's 1 second but not blocks 30 | 31 | (from official [doc](https://github.com/Kotlin/kotlinx.coroutines/blob/master/coroutines-guide.md#your-first-coroutine)) 32 | 33 | ```kotlin 34 | fun main(args: Array) { 35 | launch(CommonPool) { // create new coroutine in common thread pool 36 | delay(1000L) // non-blocking delay for 1 second (default time unit is ms) 37 | println("World!") // print after delay 38 | } 39 | println("Hello,") // main function continues while coroutine is delayed 40 | Thread.sleep(2000L) // block main thread for 2 seconds to keep JVM alive 41 | } 42 | ``` 43 | 44 | result 45 | 46 | ```kotlin 47 | Hello, 48 | World! 49 | ``` 50 | -------------------------------------------------------------------------------- /docs/languages/kotlin/exceptions.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Exceptions in Kotlin 3 | description: Gain a comprehensive understanding of exceptions in Kotlin through this informative guide. Learn about the importance of handling exceptions, explore the different types of exceptions in Kotlin, and discover best practices for effective exception handling. Whether you're a beginner or an experienced Kotlin developer, this guide will equip you with the knowledge and skills to write robust and error-free code 4 | # image: "#" 5 | keywords: 6 | [ 7 | Kotlin exceptions, 8 | exception handling in Kotlin, 9 | Kotlin error handling, 10 | types of exceptions in Kotlin, 11 | Kotlin exception handling best practices, 12 | Kotlin try-catch, 13 | exception propagation in Kotlin, 14 | Kotlin throw keyword, 15 | Kotlin custom exceptions, 16 | Kotlin exception handling techniques, 17 | ] 18 | sidebar_position: 33 19 | sidebar_label: Exceptions 20 | slug: /kotlin/exceptions 21 | --- 22 | 23 | ## Catching exception with try-catch-finally 24 | 25 | Catching exceptions in Kotlin looks very similar to Java 26 | 27 | ```kotlin 28 | try { 29 | doSomething() 30 | } 31 | catch(e: MyException) { 32 | handle(e) 33 | } 34 | finally { 35 | cleanup() 36 | } 37 | ``` 38 | 39 | You can also catch multiple exceptions 40 | 41 | ```kotlin 42 | try { 43 | doSomething() 44 | } 45 | catch(e: FileSystemException) { 46 | handle(e) 47 | } 48 | catch(e: NetworkException) { 49 | handle(e) 50 | } 51 | catch(e: MemoryException) { 52 | handle(e) 53 | } 54 | finally { 55 | cleanup() 56 | } 57 | ``` 58 | 59 | `try` is also an expression and may return value 60 | 61 | ```kotlin 62 | val s: String? = try { getString() } catch (e: Exception) { null } 63 | ``` 64 | 65 | Kotlin doesn't have checked exceptions, so you don't have to catch any exceptions. 66 | 67 | ```kotlin 68 | fun fileToString(file: File) : String { 69 | //readAllBytes throws IOException, but we can omit catching it 70 | fileContent = Files.readAllBytes(file) 71 | return String(fileContent) 72 | } 73 | ``` 74 | -------------------------------------------------------------------------------- /docs/languages/jquery/getting-and-setting-width-and-height-of-an-element.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Getting and setting width and height of an element 3 | description: Learn how to dynamically manipulate the dimensions of HTML elements using jQuery. Discover how to retrieve and modify the width and height of an element to achieve responsive design and create engaging user interfaces 4 | # image: "#" 5 | keywords: 6 | [ 7 | jQuery, 8 | element dimensions, 9 | width, 10 | height, 11 | responsive design, 12 | jQuery width(), 13 | jQuery height(), 14 | jQuery CSS(), 15 | dynamic element sizing, 16 | ] 17 | sidebar_position: 14 18 | sidebar_label: Getting and setting width and height of an element 19 | slug: /jquery/getting-setting-width-height 20 | --- 21 | 22 | ## Getting and setting width and height (ignoring border) 23 | 24 | Get width and height: 25 | 26 | ```js 27 | var width = $("#target-element").width(); 28 | var height = $("#target-element").height(); 29 | ``` 30 | 31 | Set width and height: 32 | 33 | ```js 34 | $("#target-element").width(50); 35 | $("#target-element").height(100); 36 | ``` 37 | 38 | ## Getting and setting innerWidth and innerHeight (ignoring padding and border) 39 | 40 | Get width and height: 41 | 42 | ```js 43 | var width = $("#target-element").innerWidth(); 44 | var height = $("#target-element").innerHeight(); 45 | ``` 46 | 47 | Set width and height: 48 | 49 | ```js 50 | $("#target-element").innerWidth(50); 51 | $("#target-element").innerHeight(100); 52 | ``` 53 | 54 | ## Getting and setting outerWidth and outerHeight (including padding and border) 55 | 56 | Get width and height (excluding margin): 57 | 58 | ```js 59 | var width = $("#target-element").outerWidth(); 60 | var height = $("#target-element").outerHeight(); 61 | ``` 62 | 63 | Get width and height (including margin): 64 | 65 | ```js 66 | var width = $("#target-element").outerWidth(true); 67 | var height = $("#target-element").outerHeight(true); 68 | ``` 69 | 70 | Set width and height: 71 | 72 | ```js 73 | $("#target-element").outerWidth(50); 74 | $("#target-element").outerHeight(100); 75 | ``` 76 | -------------------------------------------------------------------------------- /docs/languages/kotlin/type-aliases.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Type aliases in Kotlin 3 | description: Discover the power of type aliases in Kotlin and learn how they can simplify your code and enhance its readability. Type aliases allow you to create custom names for existing types, making your code more expressive and self-documenting. Whether you're working with complex data structures, external libraries, or repetitive type declarations, type aliases provide a concise way to define and reuse types throughout your codebase. Explore real-world examples, best practices, and practical use cases that demonstrate how type aliases can improve your Kotlin development workflow. Stay ahead of the game by leveraging this feature to create clean, maintainable code that is both efficient and SEO friendly 4 | # image: "#" 5 | keywords: 6 | [ 7 | Kotlin type aliases, 8 | type aliases in Kotlin, 9 | Kotlin code readability, 10 | Kotlin code simplification, 11 | Kotlin type declarations, 12 | custom type names, 13 | expressive code in Kotlin, 14 | Kotlin development workflow, 15 | Kotlin best practices, 16 | maintainable Kotlin code, 17 | clean code in Kotlin, 18 | reusable types in Kotlin, 19 | SEO-friendly Kotlin code, 20 | ] 21 | sidebar_position: 24 22 | sidebar_label: Type aliases 23 | slug: /kotlin/type-aliases 24 | --- 25 | 26 | With type aliases, we can give a alias to other type. It's ideal for giving a name to function types like `(String) -> Boolean` or generic type like `Pair`. 27 | 28 | Type aliases support generics. An alias can replace a type with generics and an alias can be generics. 29 | 30 | ## Function type 31 | 32 | ```kotlin 33 | typealias StringValidator = (String) -> Boolean 34 | typealias Reductor = (T, U) -> V 35 | ``` 36 | 37 | ## Generic type 38 | 39 | ```kotlin 40 | typealias Parents = Pair 41 | typealias Accounts = List 42 | ``` 43 | 44 | ## Syntax 45 | 46 | - **typealias** **alias-name** **=** **existing-type** 47 | 48 | ## Remarks 49 | 50 | Type aliases is a feature of the compiler. Nothing is added in the generated code for the JVM. All aliases will be replaced by the real type. 51 | -------------------------------------------------------------------------------- /docs/languages/kotlin/contributors.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Contributors - Kotlin Docs 3 | sidebar_position: 40 4 | sidebar_label: Contributors 5 | slug: /kotlin/contributors 6 | --- 7 | 8 | # Contributors - Kotlin Docs 9 | 10 | :::tip Thanks 11 | Thanks to the great people behind the beautiful Stackoverflow Documentation :innocent:. All of you are good souls :100: 12 | ::: 13 | 14 | [hotkey](https://stackoverflow.com/users/2196460/hotkey) | 15 | [Jayson Minard](https://stackoverflow.com/users/3679676/jayson-minard) | 16 | [Kirill Rakhman](https://stackoverflow.com/users/615306/kirill-rakhman) | 17 | [Adam Arold](https://stackoverflow.com/users/485337/adam-arold) | 18 | [madhead](https://stackoverflow.com/users/750510/madhead) | 19 | [Sean Reilly](https://stackoverflow.com/users/8313/sean-reilly) | 20 | [Héctor](https://stackoverflow.com/users/3026283/h%c3%a9ctor) | 21 | [Brad](https://stackoverflow.com/users/713106/brad) | 22 | [technerd](https://stackoverflow.com/users/3045336/technerd) | 23 | [oshai](https://stackoverflow.com/users/411965/oshai) | 24 | [Espen](https://stackoverflow.com/users/148608/espen) | 25 | [Jan Vladimir Mostert](https://stackoverflow.com/users/527533/jan-vladimir-mostert) | 26 | [Aaron Christiansen](https://stackoverflow.com/users/2626000/aaron-christiansen) | 27 | [razzledazzle](https://stackoverflow.com/users/4803633/razzledazzle) | 28 | [Abdullah](https://stackoverflow.com/users/4094366/abdullah) | 29 | [Avijit Karmakar](https://stackoverflow.com/users/5294091/avijit-karmakar) | 30 | [Kevin Robatel](https://stackoverflow.com/users/244702/kevin-robatel) | 31 | [David Soroko](https://stackoverflow.com/users/239101/david-soroko) | 32 | [Mohit Suthar](https://stackoverflow.com/users/4951663/mohit-suthar) | 33 | [Spidfire](https://stackoverflow.com/users/333291/spidfire) | 34 | [atok](https://stackoverflow.com/users/1356130/atok) | 35 | [elect](https://stackoverflow.com/users/1047713/elect) | 36 | [glee8e](https://stackoverflow.com/users/5818889/glee8e) | 37 | [ice1000](https://stackoverflow.com/users/7083401/ice1000) | 38 | [SerCe](https://stackoverflow.com/users/1542319/serce) | 39 | [egor.zhdan](https://stackoverflow.com/users/1796907/egor-zhdan) | 40 | [byxor](https://stackoverflow.com/users/5601284/byxor) | 41 | [Jemo Mgebrishvili](https://stackoverflow.com/users/6882303/jemo-mgebrishvili) | 42 | [Januson](https://stackoverflow.com/users/2392960/januson) | 43 | [Sam](https://stackoverflow.com/users/4618331/sam) 44 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

                          2 | 3 | Geekyweb logo 4 | 5 | 6 |

                          7 | 8 |

                          Geekyweb

                          9 | 10 |

                          11 | GeekyWeb was designed from the ground up to be easy to use and learn different programming languages.You will well organize content on GeekyWeb so that you can learn anything from GeekyWeb in a very systematic way. 12 | 13 |
                          Explore GeekyWeb docs »
                          14 |
                          15 | 16 | [![GitHub issues](https://img.shields.io/github/issues/NamanGarg2075/geekyweb?style=plastic)](https://github.com/NamanGarg2075/geekyweb/issues) 17 | [![GitHub forks](https://img.shields.io/github/forks/NamanGarg2075/geekyweb)](https://github.com/NamanGarg2075/geekyweb/network) 18 | [![GitHub stars](https://img.shields.io/github/stars/NamanGarg2075/geekyweb)](https://github.com/NamanGarg2075/geekyweb/stargazers) 19 | [![GitHub license](https://img.shields.io/github/license/NamanGarg2075/geekyweb)](https://github.com/NamanGarg2075/GeekyWeb/blob/main/LICENSE) 20 | [![Netlify Status](https://api.netlify.com/api/v1/badges/eea5f7ad-0840-4df2-b5d1-2a11930b9adf/deploy-status?branch=main)](https://geekyweb.eu.org/) 21 | 22 |

                          23 | 24 | ## GeekyWeb 25 | 26 | GeekyWeb was designed from the ground up to be easy to use and learn different programming languages.You will well organize content on GeekyWeb so that you can learn anything from GeekyWeb in a very systematic way. 27 | 28 | ## Running documentation locally 29 | 30 | - Run `yarn install` to install the Node.js dependencies. 31 | - From the root directory, run `yarn start` in the command line. 32 | - Open `http://localhost:3000/` in your browser. 33 | 34 | To contribute please [readme](https://geekyweb.eu.org/docs/legal/contributing) 35 | 36 | ## Contributing 37 | 38 | Please read through our [contributing guidelines](https://geekyweb.eu.org/docs/legal/contributing). Included are directions for opening issues, coding standards, and notes on development. 39 | 40 | ## Creators 41 | 42 | **Naman Garg** 43 | 44 | - 45 | 46 | ## Copyright and license 47 | 48 | Code and documentation copyright 2023 Code released under the [MIT License](https://github.com/NamanGarg2075/geekyweb/LICENSE). Released under [Creative Commons](https://creativecommons.org/licenses/by/3.0/). 49 | -------------------------------------------------------------------------------- /sidebars.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Creating a sidebar enables you to: 3 | - create an ordered group of docs 4 | - render a sidebar for each doc of that group 5 | - provide next/previous navigation 6 | 7 | The sidebars can be generated from the filesystem, or explicitly defined here. 8 | 9 | Create as many sidebars as you want. 10 | */ 11 | 12 | // @ts-check 13 | 14 | /** @type {import('@docusaurus/plugin-content-docs').SidebarsConfig} */ 15 | const sidebars = { 16 | // By default, Docusaurus generates a sidebar from the docs folder structure 17 | tutorialSidebar: [{ type: 'autogenerated', dirName: '.' }], 18 | 19 | // But you can create a sidebar manually 20 | 21 | HTML: [ 22 | { 23 | type: 'category', 24 | label: 'Getting Started with HTML', 25 | link: { type: 'doc', id: 'languages/html/getting-started/introduction' }, 26 | items: [ 27 | 28 | 'languages/html/getting-started/element-insight', 29 | 'languages/html/getting-started/creating-page', 30 | 'languages/html/getting-started/breakdown-page', 31 | 'languages/html/getting-started/remarks', 32 | ], 33 | }, 34 | 35 | { 36 | type: 'category', 37 | label: 'Doctypes', 38 | link: { type: 'doc', id: 'languages/html/doctypes/introduction' }, 39 | items: [ 40 | 'languages/html/doctypes/adding-the-doctype', 41 | 'languages/html/doctypes/html-5-doctype', 42 | 'languages/html/doctypes/remarks', 43 | ], 44 | }, 45 | { 46 | type: 'category', 47 | label: 'Headings', 48 | link: { type: 'doc', id: 'languages/html/headings/introduction' }, 49 | items: [ 50 | 'languages/html/headings/using-headings', 51 | 'languages/html/headings/correct-structure-matters', 52 | 'languages/html/headings/remarks', 53 | ], 54 | }, 55 | { 56 | type: 'category', 57 | label: 'Lists', 58 | link: { type: 'doc', id: 'languages/html/lists/introduction' }, 59 | items: [ 60 | 'languages/html/lists/ordered-list', 61 | 'languages/html/lists/unordered-list', 62 | 'languages/html/lists/nested-list', 63 | 'languages/html/lists/remarks', 64 | ], 65 | }, 66 | ], 67 | 68 | KOTLIN: [{ type: 'autogenerated', dirName: 'languages/kotlin' }], 69 | JQUERY: [{ type: 'autogenerated', dirName: 'languages/jquery' }], 70 | JAVASCRIPT: [{ type: 'autogenerated', dirName: 'languages/javascript' }], 71 | }; 72 | 73 | module.exports = sidebars; 74 | -------------------------------------------------------------------------------- /docs/languages/kotlin/ranges.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Ranges in Kotlin 3 | description: Explore the power of ranges in Kotlin and enhance your programming skills with this comprehensive guide. Discover how to effectively use ranges to iterate, filter, and manipulate data in your Kotlin projects. From basic range syntax to advanced techniques, this article provides valuable insights and practical examples to help you leverage the full potential of ranges in Kotlin. Whether you're a beginner or an experienced Kotlin developer, this guide will equip you with the knowledge and techniques to optimize your code and improve your productivity 4 | # image: "#" 5 | keywords: 6 | [ 7 | Kotlin ranges, 8 | range syntax, 9 | range operators, 10 | range iteration, 11 | range filtering, 12 | range manipulation, 13 | Kotlin programming, 14 | Kotlin projects, 15 | Kotlin development, 16 | Kotlin beginners, 17 | Kotlin developers, 18 | optimizing Kotlin code, 19 | productive Kotlin programming, 20 | ] 21 | sidebar_position: 12 22 | sidebar_label: Ranges 23 | slug: /kotlin/ranges 24 | --- 25 | 26 | Range expressions are formed with rangeTo functions that have the operator form .. which is complemented by in and !in. 27 | Range is defined for any comparable type, but for integral primitive types it has an optimized implementation 28 | 29 | ## Integral Type Ranges 30 | 31 | Integral type ranges ( IntRange , LongRange , CharRange ) have an extra feature: they can be iterated over. The compiler takes 32 | care of converting this analogously to Java's indexed for-loop, without extra overhead 33 | 34 | ```kotlin 35 | for (i in 1..4) print(i) // prints "1234" 36 | for (i in 4..1) print(i) // prints nothing 37 | ``` 38 | 39 | ## downTo() function 40 | 41 | if you want to iterate over numbers in reverse order? It's simple. You can use the downTo() function defined in the 42 | standard library 43 | 44 | ```kotlin 45 | for (i in 4 downTo 1) print(i) // prints "4321" 46 | ``` 47 | 48 | ## step() function 49 | 50 | Is it possible to iterate over numbers with arbitrary step, not equal to 1? Sure, the step() function will help you 51 | 52 | ```kotlin 53 | for (i in 1..4 step 2) print(i) // prints "13" 54 | for (i in 4 downTo 1 step 2) print(i) // prints "42" 55 | ``` 56 | 57 | ## until function 58 | 59 | To create a range which does not include its end element, you can use the until function: 60 | 61 | ```kotlin 62 | for (i in 1 until 10) { // i in [1, 10), 10 is excluded 63 | println(i) 64 | } 65 | ``` 66 | -------------------------------------------------------------------------------- /docs/languages/kotlin/collections.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Collections in Kotlin 3 | description: Explore the power and versatility of collections in Kotlin, a modern programming language. Discover how collections enable efficient storage, retrieval, and manipulation of data, while leveraging Kotlin's expressive syntax and functional programming features. Learn about lists, sets, maps, and other data structures, and master essential operations such as filtering, mapping, and sorting. Whether you're a beginner or an experienced developer, this comprehensive guide to collections in Kotlin will enhance your ability to write clean, concise, and high-performing code 4 | # image: "#" 5 | keywords: 6 | [ 7 | Kotlin collections, 8 | data structures, 9 | list operations, 10 | set manipulation, 11 | map functions, 12 | functional programming, 13 | Kotlin syntax, 14 | data retrieval, 15 | data manipulation, 16 | efficient storage, 17 | filtering data, 18 | mapping data, 19 | sorting collections, 20 | clean code, 21 | high-performing code, 22 | ] 23 | sidebar_position: 6 24 | sidebar_label: Collections 25 | slug: /kotlin/collections 26 | --- 27 | 28 | Unlike many languages, Kotlin distinguishes between mutable and immutable collections (lists, sets, maps, etc). Precise control over exactly when collections can be edited is useful for eliminating bugs, and for designing good APIs. 29 | 30 | ## Using list 31 | 32 | ```kotlin 33 | // Create a new read-only List 34 | val list = listOf("Item 1", "Item 2", "Item 3") 35 | println(list) // prints "[Item 1, Item 2, Item 3]" 36 | ``` 37 | 38 | ## Using map 39 | 40 | ```kotlin 41 | // Create a new read-only Map 42 | val map = mapOf(Pair(1, "Item 1"), Pair(2, "Item 2"), Pair(3, "Item 3")) 43 | println(map) // prints "{1=Item 1, 2=Item 2, 3=Item 3}" 44 | ``` 45 | 46 | ## Using set 47 | 48 | ```kotlin 49 | // Create a new read-only Set 50 | val set = setOf(1, 3, 5) 51 | println(set) // prints "[1, 3, 5]" 52 | ``` 53 | 54 | ## Syntax 55 | 56 | - listOf, mapOf and setOf returns read-only objects that you cannot add or remove items. 57 | - If you want to add or remove items you have to use arrayListOf, hashMapOf, hashSetOf, linkedMapOf (LinkedHashMap), linkedSetOf (LinkedHashSet), mutableListOf (The Kotlin MultableList collection), mutableMapOf (The Kotlin MultableMap collection), mutableSetOf (The Kotlin MultableSet collection), sortedMapOf or sortedSetOf 58 | - Each collection has methods like first(), last(), get() and lambda functions like filter, map, join, reduce and many others. 59 | -------------------------------------------------------------------------------- /docs/languages/jquery/prepend.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Prepend in jQuery 3 | description: Learn how to effectively use the prepend method in jQuery to dynamically insert content at the beginning of HTML elements. Enhance your web development skills with this comprehensive guide, which covers the syntax, parameters, and practical examples of using prepend. Stay up-to-date with the latest jQuery techniques and leverage the power of prepend to create dynamic and interactive web pages 4 | # image: "#" 5 | keywords: 6 | [ 7 | prepend in jQuery, 8 | prepend method, 9 | jQuery prepend tutorial, 10 | dynamic content insertion, 11 | manipulating HTML elements, 12 | web development, 13 | jQuery techniques, 14 | prepend examples, 15 | jQuery prepend syntax, 16 | interactive web pages, 17 | ] 18 | sidebar_position: 13 19 | sidebar_label: Prepend 20 | slug: /jquery/prepend 21 | --- 22 | 23 | ## Prepending an element to a container 24 | 25 | **Solution 1:** 26 | 27 | ```js 28 | $("#parent").prepend($("#child")); 29 | ``` 30 | 31 | **Solution 2:** 32 | 33 | ```js 34 | $("#child").prependTo($("#parent")); 35 | ``` 36 | 37 | Both solutions are prepending the element `#child` (adding at the beginning) to the element `#parent`. 38 | 39 | Before: 40 | 41 | ```html 42 |
                          43 | other content 44 |
                          45 |
                          46 | ``` 47 | 48 | After: 49 | 50 | ```html 51 |
                          52 |
                          53 | other content 54 |
                          55 | ``` 56 | 57 | ## Prepend method 58 | 59 | [`prepend()`](http://api.jquery.com/prepend/) - Insert content, specified by the parameter, to the beginning of each element in the set of matched elements. 60 | 61 | **1.** [`prepend( content [, content ] )`](http://api.jquery.com/prepend/) 62 | 63 | ```js 64 | // with html string 65 | jQuery("#parent").prepend("child"); 66 | // or you can use jQuery object 67 | jQuery("#parent").prepend($("#child")); 68 | // or you can use comma seperated multiple elements to prepend 69 | jQuery("#parent").prepend($("#child1"), $("#child2")); 70 | ``` 71 | 72 | **2.** [`prepend(function)`](http://api.jquery.com/prepend/) 73 | 74 | JQuery **`version: 1.4`** onwards you can use callback function as the argument. Where you can get arguments as index position of the element in the set and the old HTML value of the element. Within the function, `this` refers to the current element in the set. 75 | 76 | ```js 77 | jQuery("#parent").prepend(function (i, oldHTML) { 78 | // return the value to be prepend 79 | return "child"; 80 | }); 81 | ``` 82 | -------------------------------------------------------------------------------- /docs/languages/kotlin/annotations.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Annotations in Kotlin 3 | description: Learn about annotations in Kotlin and how they can enhance your programming experience. Discover how to leverage annotations to provide additional information to the compiler, generate boilerplate code, and improve code readability. Explore the various use cases and best practices for utilizing annotations in Kotlin development 4 | # image: "#" 5 | keywords: 6 | [ 7 | Kotlin annotations, 8 | annotation processing, 9 | compiler, 10 | code generation, 11 | code readability, 12 | programming experience, 13 | Kotlin development, 14 | best practices, 15 | ] 16 | sidebar_position: 23 17 | sidebar_label: Annotations 18 | slug: /kotlin/annotations 19 | --- 20 | 21 | ## Declaring an annotation 22 | 23 | Annotations are means of attaching metadata to code. To declare an annotation, put the 24 | annotation 25 | modifier in front of a 26 | class: 27 | 28 | ```kotlin 29 | annotation class Strippable 30 | ``` 31 | 32 | Annotations can have meta-anotations: 33 | 34 | ```kotlin 35 | @Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.EXPRESSION) 36 | annotation class Strippable 37 | 38 | ``` 39 | 40 | Annotations, like other classes, can have constructors: 41 | 42 | ```kotlin 43 | annotation class Strippable(val importanceValue: Int) 44 | ``` 45 | 46 | But unlike other classes, is limited to the following types: 47 | 48 | - types that correspond to Java primitive types (Int, Long etc.); 49 | - strings 50 | - classes ( Foo:: class) 51 | - enums 52 | - other annotations 53 | - arrays of the types listed above 54 | 55 | ## Meta-annotations 56 | 57 | When declaring an annotation, meta-info can be included using the following meta-annotations: 58 | 59 | - `@Target`: specifies the possible kinds of elements which can be annotated with the annotation (classes, functions, properties, expressions etc.) 60 | - `@Retention` specifies whether the annotation is stored in the compiled class files and whether it's visible through reflection at runtime (by default, both are true.) 61 | - `@Repeatable` allows using the same annotation on a single element multiple times. 62 | - `@MustBeDocumented` specifies that the annotation is part of the public API and should be included in the class or method signature shown in the generated API documentation. 63 | 64 | Example: 65 | 66 | ```kotlin 67 | @Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, 68 | AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.EXPRESSION) 69 | @Retention(AnnotationRetention.SOURCE) 70 | @MustBeDocumented 71 | annotation class Fancy 72 | ``` 73 | -------------------------------------------------------------------------------- /docs/languages/html/doctypes/html-5-doctype.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: HTML 5 Doctype. 3 | keywords: [coding, web development, html] 4 | sidebar_position: 3 5 | sidebar_label: HTML 5 Doctype 6 | slug: /html/doctypes/html-5-doctype 7 | --- 8 | 9 | HTML5 is not based on SGML, and therefore does not require a reference to a DTD. 10 | 11 | HTML 5 Doctype declaration: 12 | 13 | ```html 14 | 15 | ``` 16 | 17 | ## Case Insensitivity 18 | 19 | Per the [W3.org HTML 5 `DOCTYPE` Spec](https://www.w3.org/TR/html5/syntax.html#the-doctype): 20 | 21 | > A DOCTYPE must consist of the following components, in this order: 22 | 23 | - A string that is an ASCII **case-insensitive** match for the string `" 29 | 30 | 31 | ``` 32 | 33 | This SO article discusses the topic extensively: [Uppercase or lowercase doctype?](http://stackoverflow.com/questions/7020961/uppercase-or-lowercase-doctype) 34 | 35 | ## HTML 4.01 Doctypes 36 | 37 | The HTML 4.01 specification provides several different types of doctypes that allow different types of elements to be specified within the document. 38 | 39 | ### HTML 4.01 Strict 40 | 41 | ```html 42 | 43 | ``` 44 | 45 | Includes all HTML elements and attributes, but **does not include presentational or deprecated elements** and **framesets are not allowed**. 46 | 47 | ### HTML 4.01 Transitional 48 | 49 | ```html 50 | 51 | ``` 52 | 53 | Includes all HTML elements and attributes and presentational and deprecated elements, but **framesets are not allowed**. 54 | 55 | ### HTML 4.01 Frameset 56 | 57 | ```html 58 | 59 | ``` 60 | 61 | Includes all HTML elements and attributes, presentational and deprecated elements. Framesets are allowed. 62 | 63 | ## Old Doctypes 64 | 65 | ### HTML 3.2 66 | 67 | ```html 68 | 69 | ``` 70 | 71 | HTML 3.2 is well supported by most browsers in use. However, HTML 3.2 has limited support for style sheets and no support for HTML 4 features such as frames and internationalization. 72 | 73 | ### HTML 2.0 74 | 75 | ```html 76 | 77 | ``` 78 | 79 | HTML 2.0 is widely supported by browsers but lacks support for tables, frames, and internationalization, as well as many commonly used presentation elements and attributes. 80 | 81 | #### Syntax 82 | 83 | ```html 84 | 85 | ``` 86 | -------------------------------------------------------------------------------- /docs/languages/jquery/checkbox-select-all-with-automatic-check-uncheck-on-other-checkbox-change.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Checkbox Select all with automatic check/uncheck on other checkbox change 3 | description: Learn how to implement a checkbox select all functionality using jQuery, where checking or unchecking one checkbox automatically updates the status of other checkboxes. This tutorial provides step-by-step instructions and code examples to help you create a user-friendly and efficient checkbox select all feature 4 | # image: "#" 5 | keywords: 6 | [ 7 | jQuery, 8 | checkbox select all, 9 | automatic check/uncheck, 10 | checkbox change, 11 | JavaScript, 12 | web development, 13 | front-end development, 14 | user interface, 15 | UI, 16 | web design, 17 | code example, 18 | tutorial, 19 | ] 20 | sidebar_position: 18 21 | sidebar_label: Checkbox Select all with automatic check/uncheck on other checkbox change 22 | slug: /jquery/checkbox-select-all-with-automatic-chec-uncheck-on-other-checkbox-change 23 | --- 24 | 25 | I've used various Stackoverflow examples and answers to come to this really simple example on how to manage "select all" checkbox coupled with an automatic check/uncheck if any of the group checkbox status changes. 26 | Constraint: The "select all" id must match the input names to create the select all group. 27 | In the example, the input select all ID is cbGroup1. The input names are also cbGroup1 28 | 29 | Code is very short, not plenty of if statement (time and resource consuming). 30 | 31 | ## 2 select all checkboxes with corresponding group checkboxes 32 | 33 | ```html 34 | 35 | 36 |

                          37 | Select all 38 | Group1 value 1 39 | Group1 value 2 40 | Group1 value 3 41 |

                          42 | 43 |

                          44 | Select all 45 | Group2 value 1 46 | Group2 value 2 47 | Group2 value 3 48 |

                          49 | 50 | 62 | ``` 63 | -------------------------------------------------------------------------------- /src/css/custom.css: -------------------------------------------------------------------------------- 1 | /** 2 | * Any CSS included here will be global. The classic template 3 | * bundles Infima by default. Infima is a CSS framework designed to 4 | * work well for content-centric websites. 5 | */ 6 | 7 | /* You can override the default Infima variables here. */ 8 | :root { 9 | --ifm-color-primary: #00b0ff; 10 | --ifm-color-primary-dark: #009ee6; 11 | --ifm-color-primary-darker: #0096d9; 12 | --ifm-color-primary-darkest: #007bb3; 13 | --ifm-color-primary-light: #1ab8ff; 14 | --ifm-color-primary-lighter: #26bcff; 15 | --ifm-color-primary-lightest: #4dc8ff; 16 | --ifm-code-font-size: 95%; 17 | 18 | /* Styling Theme */ 19 | --ifm-heading-font-family: "Balsamiq Sans"; 20 | --btn-color-course: #000000; 21 | } 22 | 23 | /* For readability concerns, you should choose a lighter palette in dark mode. */ 24 | html[data-theme="dark"] { 25 | /* --ifm-color-primary: #00B0FF; */ 26 | /* --ifm-color-primary-dark: #21af90; */ 27 | /* --ifm-color-primary-darker: #1fa588; */ 28 | /* --ifm-color-primary-darkest: #1a8870; */ 29 | /* --ifm-color-primary-light: #29d5b0; */ 30 | /* --ifm-color-primary-lighter: #32d8b4; */ 31 | /* --ifm-color-primary-lightest: #4fddbf; */ 32 | --ifm-background-color: #0c141f; 33 | --ifm-navbar-background-color: #020616; 34 | --ifm-dropdown-background-color: #020616; 35 | --ifm-card-background-color: #020616; 36 | 37 | --ifm-code-background: #2c333d; 38 | --ifm-navbar-search-input-background-color: #282c34; 39 | /* --ifm-navbar-search-input-icon: */ 40 | /* --ifm-color-emphasis-200: #0a0f22; */ 41 | --btn-color-course: #ffffff; 42 | } 43 | 44 | .docusaurus-highlight-code-line { 45 | background-color: rgba(0, 0, 0, 0.1); 46 | display: block; 47 | margin: 0 calc(-1 * var(--ifm-pre-padding)); 48 | padding: 0 var(--ifm-pre-padding); 49 | } 50 | 51 | html[data-theme="dark"] .docusaurus-highlight-code-line { 52 | background-color: rgba(0, 0, 0, 0.3); 53 | } 54 | 55 | .navbar__title { 56 | font-family: "Balsamiq sans"; 57 | } 58 | 59 | img { 60 | border-radius: 7px; 61 | } 62 | 63 | .footer { 64 | background-color: #020616; 65 | } 66 | 67 | pre { 68 | font-family: "Cascadia Code"; 69 | } 70 | 71 | #announcement { 72 | background-color: var(--ifm-background-color) !important; 73 | } 74 | 75 | .close { 76 | color: #ebe3e3; 77 | } 78 | 79 | /* Card container */ 80 | .cardContainer_qNfC { 81 | --ifm-link-color: var(--ifm-color-emphasis-800); 82 | --ifm-link-hover-color: var(--ifm-color-emphasis-700); 83 | --ifm-link-hover-decoration: none; 84 | border: 1px solid var(--ifm-color-emphasis-200); 85 | box-shadow: 0 1.5px 3px 0 rgb(0 0 0 / 15%); 86 | transition: all var(--ifm-transition-fast) ease; 87 | transition-property: border, box-shadow; 88 | } 89 | 90 | /* Docs text alignment */ 91 | article { 92 | text-align: left; 93 | } 94 | -------------------------------------------------------------------------------- /docs/languages/javascript/date-comparison.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Date Comparison in JavaScript 3 | description: Learn how to compare dates effectively using JavaScript. This comprehensive guide provides step-by-step instructions on comparing dates, including various scenarios and common pitfalls to avoid. Enhance your JavaScript skills and ensure accurate date comparisons in your web development projects 4 | # image: "#" 5 | keywords: 6 | [ 7 | date comparison, 8 | JavaScript, 9 | compare dates, 10 | web development, 11 | JavaScript date, 12 | date manipulation, 13 | date comparison techniques, 14 | JavaScript programming, 15 | web development tutorials, 16 | ] 17 | sidebar_position: 10 18 | sidebar_label: Date Comparison 19 | slug: /javascript/date-comparison 20 | --- 21 | 22 | import InArticleAd from '@site/src/components/Adsence/InArticleAd'; 23 | import DisplayAd from '@site/src/components/Adsence/DisplayAd'; 24 | 25 | 26 | 27 | ## Comparing Date values 28 | 29 | To check the equality of `Date` values: 30 | 31 | ```js 32 | var date1 = new Date(); 33 | var date2 = new Date(date1.valueOf() + 10); 34 | console.log(date1.valueOf() === date2.valueOf()); 35 | ``` 36 | 37 | > Sample output: `false` 38 | 39 | Note that you must use `valueOf()` or `getTime()` to compare the values of `Date` objects because the equality operator will compare if two object references are the same. For example: 40 | 41 | ```js 42 | var date1 = new Date(); 43 | var date2 = new Date(); 44 | console.log(date1 === date2); 45 | ``` 46 | 47 | > Sample output: `false` 48 | 49 | Whereas if the variables point to the same object: 50 | 51 | ```js 52 | var date1 = new Date(); 53 | var date2 = date1; 54 | console.log(date1 === date2); 55 | ``` 56 | 57 | > Sample output: `true` 58 | 59 | However, the other comparison operators will work as usual and you can use `<` and `>` to compare that one date is earlier or later than the other. For example: 60 | 61 | ```js 62 | var date1 = new Date(); 63 | var date2 = new Date(date1.valueOf() + 10); 64 | console.log(date1 < date2); 65 | ``` 66 | 67 | > Sample output: `true` 68 | 69 | It works even if the operator includes equality: 70 | 71 | ```js 72 | var date1 = new Date(); 73 | var date2 = new Date(date1.valueOf()); 74 | console.log(date1 <= date2); 75 | ``` 76 | 77 | > Sample output: `true` 78 | 79 | 80 | 81 | ## Date Difference Calculation 82 | 83 | To compare the difference of two dates, we can do the comparison based on the timestamp. 84 | 85 | ```js 86 | var date1 = new Date(); 87 | var date2 = new Date(date1.valueOf() + 5000); 88 | 89 | var dateDiff = date1.valueOf() - date2.valueOf(); 90 | var dateDiffInYears = dateDiff / 1000 / 60 / 60 / 24 / 365; //convert milliseconds into years 91 | 92 | console.log("Date difference in years : " + dateDiffInYears); 93 | ``` 94 | 95 | 96 | -------------------------------------------------------------------------------- /docs/languages/kotlin/vararg-parameters-in-functions.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Vararg Parameters in Functions 3 | description: Vararg parameters in functions provide a versatile and powerful feature in programming languages that allows functions to accept a variable number of arguments. This SEO-friendly guide explains the concept of vararg parameters, their benefits, and how they can be effectively utilized in programming. Discover how vararg parameters enable developers to write more flexible and adaptable functions, accommodating different input scenarios. Explore practical examples and best practices to harness the full potential of vararg parameters in your programming projects. 4 | # image: "#" 5 | keywords: 6 | [ 7 | vararg parameters, 8 | flexible functions, 9 | variable arguments, 10 | programming languages, 11 | adaptable functions, 12 | function parameters, 13 | variadic functions, 14 | versatile programming, 15 | programming flexibility, 16 | function input scenarios, 17 | varargs, 18 | programming best practices, 19 | ] 20 | sidebar_position: 9 21 | sidebar_label: Vararg Parameters in Functions 22 | slug: /kotlin/vararg-parameters-in-functions 23 | --- 24 | 25 | ## Basics: Using the vararg keyword 26 | 27 | Define the function using the `vararg` keyword. 28 | 29 | ```kotlin 30 | fun printNumbers(vararg numbers: Int) { 31 | for (number in numbers) { 32 | println(number) 33 | } 34 | } 35 | ``` 36 | 37 | Now you can pass as many parameters (of the correct type) into the function as you want. 38 | 39 | ```kotlin 40 | printNumbers(0, 1) // Prints "0" "1" 41 | printNumbers(10, 20, 30, 500) // Prints "10" "20" "30" "500" 42 | ``` 43 | 44 | > **Notes:** Vararg parameters **must** be the last parameter in the parameter list. 45 | 46 | ## Spread Operator: Passing arrays into vararg functions 47 | 48 | Arrays can be passed into vararg functions using the **Spread Operator**, `*`. 49 | 50 | Assuming the following function exists... 51 | 52 | ```kotlin 53 | fun printNumbers(vararg numbers: Int) { 54 | for (number in numbers) { 55 | println(number) 56 | } 57 | } 58 | ``` 59 | 60 | You can **pass an array** into the function like so... 61 | 62 | ```kotlin 63 | val numbers = intArrayOf(1, 2, 3) 64 | printNumbers(*numbers) 65 | 66 | // This is the same as passing in (1, 2, 3) 67 | ``` 68 | 69 | The spread operator can also be used **in the middle** of the parameters... 70 | 71 | ```kotlin 72 | val numbers = intArrayOf(1, 2, 3) 73 | printNumbers(10, 20, *numbers, 30, 40) 74 | 75 | // This is the same as passing in (10, 20, 1, 2, 3, 30, 40) 76 | ``` 77 | 78 | ## Syntax 79 | 80 | - **Vararg Keyword**: `vararg` is used in a method declaration to indicate that a variable number of parameters will be accepted. 81 | - **Spread Operator**: An asterisk (`*`) before an array that is used in function calls to "unfold" the contents into individual parameters. 82 | -------------------------------------------------------------------------------- /src/components/HomePageFeatures/HomepageFeatures.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import clsx from 'clsx'; 3 | import styles from './HomepageFeatures.module.css'; 4 | 5 | const FeatureList = [ 6 | { 7 | title: 'Easy to Use', 8 | Svg: require('../../../static/img/features/easy-to-use-1.svg').default, 9 | description: ( 10 | <> 11 | GeekyWeb was designed from the ground up to be easy to use and learn different programming languages. 12 | 13 | ), 14 | }, 15 | { 16 | title: 'Organized Content', 17 | Svg: require('../../../static/img/features/well-organised-2.svg').default, 18 | description: ( 19 | <> 20 | You will well organize content on GeekyWeb so that you can learn anything from GeekyWeb in a very systematic way. 21 | 22 | ), 23 | }, 24 | { 25 | title: 'Instant Search', 26 | Svg: require('../../../static/img/features/instant-search-3.svg').default, 27 | description: ( 28 | <> 29 | You can search anything; it will show you the most appropriate results within a couple of seconds; you don't even have to wait. 30 | 31 | ), 32 | }, 33 | { 34 | title: 'Project Making', 35 | Svg: require('../../../static/img/features/projects-making-4.svg').default, 36 | description: ( 37 | <> 38 | You are able to create different projects on your own and, with the help of our guidance, start any course and start learning. 39 | 40 | ), 41 | }, 42 | { 43 | title: 'Various Languages', 44 | Svg: require('../../../static/img/features/different-different-languages-5.svg').default, 45 | description: ( 46 | <> 47 | Our docs are available in different languages, which allow you to learn in any language; in the future, we will try to add more languages. 48 | 49 | ), 50 | }, 51 | { 52 | title: 'Contact Us', 53 | Svg: require('../../../static/img/features/contact-us-6.svg').default, 54 | description: ( 55 | <> 56 | You can also contact us if you are facing any errors regarding practicing and regarding the docs; by contacting us, you are able to solve errors. 57 | 58 | ), 59 | }, 60 | ]; 61 | 62 | function Feature({ Svg, title, description }) { 63 | return ( 64 |
                          65 |
                          66 | 67 |
                          68 |
                          69 |

                          {title}

                          70 |

                          {description}

                          71 |
                          72 |
                          73 | ); 74 | } 75 | 76 | export default function HomepageFeatures() { 77 | return ( 78 |
                          79 |
                          80 |
                          81 | {FeatureList.map((props, idx) => ( 82 | 83 | ))} 84 |
                          85 |
                          86 |
                          87 | ); 88 | } 89 | -------------------------------------------------------------------------------- /docs/languages/kotlin/singleton-objects.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Singleton objects in Kotlin 3 | description: Discover how to effectively implement and leverage singleton objects in Kotlin with this comprehensive guide. Singleton objects provide a powerful and efficient way to ensure a class has only one instance throughout the entire application. Explore the benefits of using singleton objects, understand their usage scenarios, and learn best practices for creating and accessing singletons in Kotlin. Whether you're a beginner or an experienced Kotlin developer, this guide will equip you with the knowledge and techniques to optimize your application design and take full advantage of the singleton pattern 4 | # image: "#" 5 | keywords: 6 | [ 7 | Kotlin singleton objects, 8 | implementing singletons in Kotlin, 9 | singleton design pattern, 10 | singleton instance, 11 | Kotlin application design, 12 | best practices for singletons, 13 | efficient class instances, 14 | usage scenarios, 15 | Kotlin development, 16 | optimizing application design, 17 | Kotlin patterns, 18 | ] 19 | sidebar_position: 21 20 | sidebar_label: Singleton objects 21 | slug: /kotlin/singleton-objects 22 | --- 23 | 24 | An **object** is a special kind of class, which can be declared using `object` keyword. Objects are similar to Singletons (a design pattern) in java. It also functions as the static part of java. Beginners who are switching from java to kotlin can vastly use this feature, in place of static, or singletons. 25 | 26 | ## Use as repalcement of static methods/fields of java 27 | 28 | ```kotlin 29 | object CommonUtils { 30 | 31 | var anyname: String ="Hello" 32 | 33 | fun dispMsg(message: String) { 34 | println(message) 35 | } 36 | } 37 | ``` 38 | 39 | From any other class, just invoke the variable and functions in this way: 40 | 41 | ```kotlin 42 | CommonUtils.anyname 43 | CommonUtils.dispMsg("like static call") 44 | ``` 45 | 46 | ## Use as a singleton 47 | 48 | Kotlin objects are actually just singletons. Its primary advantage is that you don't have to use `SomeSingleton.INSTANCE` to get the instance of the singleton. 49 | 50 | In java your singleton looks like this: 51 | 52 | ```kotlin 53 | public enum SharedRegistry { 54 | INSTANCE; 55 | public void register(String key, Object thing) {} 56 | } 57 | 58 | public static void main(String[] args) { 59 | SharedRegistry.INSTANCE.register("a", "apple"); 60 | SharedRegistry.INSTANCE.register("b", "boy"); 61 | SharedRegistry.INSTANCE.register("c", "cat"); 62 | SharedRegistry.INSTANCE.register("d", "dog"); 63 | } 64 | ``` 65 | 66 | In kotlin, the equivalent code is 67 | 68 | ```kotlin 69 | object SharedRegistry { 70 | fun register(key: String, thing: Object) {} 71 | } 72 | 73 | fun main(Array args) { 74 | SharedRegistry.register("a", "apple") 75 | SharedRegistry.register("b", "boy") 76 | SharedRegistry.register("c", "cat") 77 | SharedRegistry.register("d", "dog") 78 | } 79 | ``` 80 | 81 | It's obvoiusly less verbose to use. 82 | -------------------------------------------------------------------------------- /docs/languages/kotlin/dsl-building.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: DSL Building in Kotlin 3 | description: Discover the power of Domain-Specific Language (DSL) building in Kotlin with our comprehensive guide. Learn how to leverage Kotlin's expressive syntax and functional capabilities to create efficient and concise DSLs tailored to your specific use cases. Whether you're a beginner or an experienced Kotlin developer, this tutorial will equip you with the knowledge and tools to design and implement DSLs that enhance code readability, productivity, and maintainability. Unlock the full potential of Kotlin's DSL capabilities and take your programming skills to the next level 4 | # image: "#" 5 | keywords: 6 | [ 7 | Kotlin, 8 | DSL building, 9 | Domain-Specific Language, 10 | expressive syntax, 11 | functional programming, 12 | code readability, 13 | productivity, 14 | maintainability, 15 | Kotlin developer, 16 | programming skills, 17 | ] 18 | sidebar_position: 29 19 | sidebar_label: DSL Building 20 | slug: /kotlin/dsl-building 21 | --- 22 | 23 | Focus on the syntax details to design internal [DSLs](https://en.wikipedia.org/wiki/Domain-specific_language) in Kotlin. 24 | 25 | ## Infix approach to build DSL 26 | 27 | If you have: 28 | 29 | ```kotlin 30 | infix fun T?.shouldBe(expected: T?) = assertEquals(expected, this) 31 | ``` 32 | 33 | you can write the following DSL-like code in your tests: 34 | 35 | ```kotlin 36 | @Test 37 | fun test() { 38 | 100.plusOne() shouldBe 101 39 | } 40 | ``` 41 | 42 | ## Overriding invoke method to build DSL 43 | 44 | If you have: 45 | 46 | ```kotlin 47 | class MyExample(val i: Int) { 48 | operator fun invoke(block: MyExample.() -> R) = block() 49 | fun Int.bigger() = this > i 50 | } 51 | ``` 52 | 53 | you can write the following DSL-like code in your production code: 54 | 55 | ```kotlin 56 | fun main2(args: Array) { 57 | val ex = MyExample(233) 58 | ex { 59 | // bigger is defined in the context of `ex` 60 | // you can only call this method inside this context 61 | if (777.bigger()) kotlin.io.println("why") 62 | } 63 | } 64 | ``` 65 | 66 | ## Using operators with lambdas 67 | 68 | If you have: 69 | 70 | ```kotlin 71 | val r = Random(233) 72 | infix inline operator fun Int.rem(block: () -> Unit) { 73 | if (r.nextInt(100) < this) block() 74 | } 75 | ``` 76 | 77 | You can write the following DSL-like code: 78 | 79 | ```kotlin 80 | 20 % { println("The possibility you see this message is 20%") } 81 | ``` 82 | 83 | ## Using extensions with lambdas 84 | 85 | If you have: 86 | 87 | ```kotlin 88 | operator fun String.invoke(block: () -> R) = { 89 | try { block.invoke() } 90 | catch (e: AssertException) { System.err.println("$this\n${e.message}") } 91 | } 92 | ``` 93 | 94 | You can write the following DSL-like code: 95 | 96 | ```kotlin 97 | "it should return 2" { 98 | parse("1 + 1").buildAST().evaluate() shouldBe 2 99 | } 100 | ``` 101 | 102 | If you feel confused with `shouldBe` above, see the example `Infix approach to build DSL`. 103 | -------------------------------------------------------------------------------- /docs/languages/kotlin/type-safe-builders.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Type-Safe Builders in Kotlin 3 | description: Discover the power of type-safe builders in Kotlin and elevate the robustness and flexibility of your code. This comprehensive guide explores the concept of type-safe builders and demonstrates how they can revolutionize your development process. Gain insights into leveraging Kotlin's expressive syntax, static typing, and DSL capabilities to construct fluent and error-proof APIs. Unlock the potential to create domain-specific languages (DSLs) that provide intuitive and concise syntax for building complex structures in a type-safe manner. Learn best practices, design patterns, and practical examples to master the art of building type-safe builders in Kotlin, resulting in cleaner, more maintainable codebases 4 | # image: "#" 5 | keywords: 6 | [ 7 | Kotlin, 8 | type-safe builders, 9 | type safety, 10 | DSL, 11 | domain-specific languages, 12 | static typing, 13 | Kotlin syntax, 14 | fluent APIs, 15 | robust code, 16 | flexible code, 17 | clean code, 18 | maintainable code, 19 | Kotlin development, 20 | programming patterns, 21 | error-proof APIs, 22 | Kotlin DSLs, 23 | ] 24 | sidebar_position: 25 25 | sidebar_label: Type-Safe Builders 26 | slug: /kotlin/type-safe-builders 27 | --- 28 | 29 | ## Type-safe tree structure builder 30 | 31 | Builders can be defined as a set of extension functions taking lambda expressions with receivers as arguments. In this example, a menu of a `JFrame` is being built: 32 | 33 | ```kotlin 34 | import javax.swing.* 35 | 36 | fun JFrame.menuBar(init: JMenuBar.() -> Unit) { 37 | val menuBar = JMenuBar() 38 | menuBar.init() 39 | setJMenuBar(menuBar) 40 | } 41 | 42 | fun JMenuBar.menu(caption: String, init: JMenu.() -> Unit) { 43 | val menu = JMenu(caption) 44 | menu.init() 45 | add(menu) 46 | } 47 | 48 | fun JMenu.menuItem(caption: String, init: JMenuItem.() -> Unit) { 49 | val menuItem = JMenuItem(caption) 50 | menuItem.init() 51 | add(menuItem) 52 | } 53 | ``` 54 | 55 | These functions can then be used to build a tree structure of objects in an easy way: 56 | 57 | ```kotlin 58 | class MyFrame : JFrame() { 59 | init { 60 | menuBar { 61 | menu("Menu1") { 62 | menuItem("Item1") { 63 | // Initialize MenuItem with some Action 64 | } 65 | menuItem("Item2") {} 66 | } 67 | menu("Menu2") { 68 | menuItem("Item3") {} 69 | menuItem("Item4") {} 70 | } 71 | } 72 | } 73 | } 74 | ``` 75 | 76 | ### Remarks 77 | 78 | A **type-safe builder** is a concept, rather than a language feature, so it is not strictly formalized. 79 | 80 | ### A typical structure of a type-safe builder 81 | 82 | A single builder function usually consists of 3 steps: 83 | 84 | 1. Create an object. 85 | 1. Execute lambda to initialize the object. 86 | 1. Add the object to structure or return it. 87 | 88 | ### Type-safe builders in Kotlin libraries 89 | 90 | The concept of type-safe builders is widely used in some Kotlin libraries and frameworks, eg.: 91 | 92 | - Anko 93 | - Wasabi 94 | - Ktor 95 | - Spec 96 | -------------------------------------------------------------------------------- /docs/languages/jquery/contributors.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Contributors - jQuery Docs 3 | sidebar_position: 20 4 | sidebar_label: Contributors 5 | slug: /jquery/contributors 6 | --- 7 | 8 | # Contributors - jQuery Docs 9 | 10 | :::tip Thanks 11 | Thanks to the great people behind the beautiful Stackoverflow Documentation :innocent:. All of you are good souls :100: 12 | ::: 13 | 14 | [charlietfl](https://stackoverflow.com/users/1175966/charlietfl) 15 | [Roko C. Buljan](https://stackoverflow.com/users/383904/roko-c-buljan) 16 | [Naftali aka Neal](https://stackoverflow.com/users/561731/naftali-aka-neal) 17 | [acdcjunior](https://stackoverflow.com/users/1850609/acdcjunior) 18 | [Pranav C Balan](https://stackoverflow.com/users/3037257/pranav-c-balan) 19 | [Gone Coding](https://stackoverflow.com/users/201078/gone-coding) 20 | [Travis J](https://stackoverflow.com/users/1026459/travis-j) 21 | [Zakaria Acharki](https://stackoverflow.com/users/4281779/zakaria-acharki) 22 | [Matas Vaitkevicius](https://stackoverflow.com/users/1509764/matas-vaitkevicius) 23 | [Zaz](https://stackoverflow.com/users/405550/zaz) 24 | [John Slegers](https://stackoverflow.com/users/1946501/john-slegers) 25 | [Paul Roub](https://stackoverflow.com/users/1324/paul-roub) 26 | [Alex Char](https://stackoverflow.com/users/3420271/alex-char) 27 | [Scimonster](https://stackoverflow.com/users/3187556/scimonster) 28 | [Ashkan Mobayen Khiabani](https://stackoverflow.com/users/1079221/ashkan-mobayen-khiabani) 29 | [Mark Schultheiss](https://stackoverflow.com/users/125981/mark-schultheiss) 30 | [Anil](https://stackoverflow.com/users/711308/anil) 31 | [Liam](https://stackoverflow.com/users/542251/liam) 32 | [Shaunak D](https://stackoverflow.com/users/3639582/shaunak-d) 33 | [David](https://stackoverflow.com/users/892629/david) 34 | [Wesley Smith](https://stackoverflow.com/users/1376624/wesley-smith) 35 | [Yosvel Quintero Arguelles](https://stackoverflow.com/users/1932552/yosvel-quintero-arguelles) 36 | [Igor Raush](https://stackoverflow.com/users/1391671/igor-raush) 37 | [Sverri M. Olsen](https://stackoverflow.com/users/1300892/sverri-m-olsen) 38 | [Andrew Brooke](https://stackoverflow.com/users/2278598/andrew-brooke) 39 | [kapantzak](https://stackoverflow.com/users/1221792/kapantzak) 40 | [blurfus](https://stackoverflow.com/users/600486/blurfus) 41 | [TheDeadMedic](https://stackoverflow.com/users/247223/thedeadmedic) 42 | [martincarlin87](https://stackoverflow.com/users/634120/martincarlin87) 43 | [Adjit](https://stackoverflow.com/users/1887101/adjit) 44 | [j08691](https://stackoverflow.com/users/616443/j08691) 45 | [Mottie](https://stackoverflow.com/users/145346/mottie) 46 | [user2314737](https://stackoverflow.com/users/2314737/user2314737) 47 | [Alon Eitan](https://stackoverflow.com/users/754119/alon-eitan) 48 | [Shekhar Pankaj](https://stackoverflow.com/users/3218902/shekhar-pankaj) 49 | [jkdev](https://stackoverflow.com/users/3345375/jkdev) 50 | [Nux](https://stackoverflow.com/users/333296/nux) 51 | [Ajay Narain Mathur](https://stackoverflow.com/users/2720743/ajay-narain-mathur) 52 | [Keyslinger](https://stackoverflow.com/users/80857/keyslinger) 53 | [mark.hch](https://stackoverflow.com/users/1189882/mark-hch) 54 | [Alex](https://stackoverflow.com/users/1397240/alex) 55 | [NotJustin](https://stackoverflow.com/users/2699725/notjustin) 56 | [Jatniel Prinsloo](https://stackoverflow.com/users/6664169/jatniel-prinsloo) 57 | -------------------------------------------------------------------------------- /docs/languages/kotlin/enum.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Enum in Kotlin 3 | description: Explore the power of enums in Kotlin with this comprehensive guide. Learn how to leverage enums to create type-safe constants, improve code readability, and enhance code maintainability. Discover the versatility of enums in handling finite sets of related values, and how they can simplify your programming tasks. Whether you're a beginner or an experienced Kotlin developer, this guide will provide you with the knowledge and practical examples to master enums and take your Kotlin programming skills to the next level. 4 | # image: "#" 5 | keywords: 6 | [ 7 | Kotlin enum, 8 | enum in Kotlin, 9 | type-safe constants, 10 | code readability, 11 | code maintainability, 12 | finite sets of values, 13 | Kotlin programming, 14 | Kotlin development, 15 | enum tutorial, 16 | enum examples, 17 | enum use cases, 18 | enum benefits, 19 | Kotlin enum guide, 20 | ] 21 | sidebar_position: 7 22 | sidebar_label: Enum 23 | slug: /kotlin/enum 24 | --- 25 | 26 | ## Initialization 27 | 28 | Enum classes as any other classes can have a constructor and be initialized 29 | 30 | ```kotlin 31 | enum class Color(val rgb: Int) { 32 | RED(0xFF0000), 33 | GREEN(0x00FF00), 34 | BLUE(0x0000FF) 35 | } 36 | ``` 37 | 38 | ## Functions and Properties in enums 39 | 40 | Enum classes can also declare members (i.e. properties and functions). A semicolon (`;`) must be placed between the last enum object and the first member declaration. 41 | 42 | If a member is `abstract`, the enum objects must implement it. 43 | 44 | ```kotlin 45 | enum class Color { 46 | RED { 47 | override val rgb: Int = 0xFF0000 48 | }, 49 | GREEN { 50 | override val rgb: Int = 0x00FF00 51 | }, 52 | BLUE { 53 | override val rgb: Int = 0x0000FF 54 | } 55 | 56 | ; 57 | 58 | abstract val rgb: Int 59 | 60 | fun colorString() = "#%06X".format(0xFFFFFF and rgb) 61 | } 62 | ``` 63 | 64 | ## Simple enum 65 | 66 | ```kotlin 67 | enum class Color { 68 | RED, GREEN, BLUE 69 | } 70 | ``` 71 | 72 | Each enum constant is an object. Enum constants are separated with commas. 73 | 74 | ## Mutability 75 | 76 | Enums can be mutable, this is another way to obtain a singleton behavior: 77 | 78 | ```kotlin 79 | enum class Planet(var population: Int = 0) { 80 | EARTH(7 * 100000000), 81 | MARS(); 82 | 83 | override fun toString() = "$name[population=$population]" 84 | } 85 | 86 | println(Planet.MARS) // MARS[population=0] 87 | Planet.MARS.population = 3 88 | println(Planet.MARS) // MARS[population=3] 89 | ``` 90 | 91 | ## Remarks 92 | 93 | Just like in Java, enum classes in Kotlin have synthetic methods allowing to list the defined enum constants and to get an enum constant by its name. The signatures of these methods are as follows (assuming the name of the enum class is `EnumClass`): 94 | 95 | ```kotlin 96 | EnumClass.valueOf(value: String): EnumClass 97 | EnumClass.values(): Array 98 | ``` 99 | 100 | The `valueOf()` method throws an `IllegalArgumentException` if the specified name does not match any of the enum constants defined in the class. 101 | 102 | Every enum constant has properties to obtain its name and position in the enum class declaration: 103 | 104 | ```kotlin 105 | val name: String 106 | val ordinal: Int 107 | ``` 108 | 109 | The enum constants also implement the Comparable interface, with the natural order being the order in which they are defined in the enum class. 110 | -------------------------------------------------------------------------------- /src/components/SocialShare/index.js: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {InlineReactionButtons} from 'sharethis-reactjs'; 3 | import {InlineShareButtons} from 'sharethis-reactjs'; 4 | // import {StickyShareButtons} from 'sharethis-reactjs'; 5 | // import {InlineFollowButtons} from 'sharethis-reactjs'; 6 | // import Layout from '@theme/Layout'; 7 | // import styles from '../pages/introduction.css' 8 | // import './courses.module.css' // if needed then 9 | 10 | // import Link from '@docusaurus/Link'; 11 | 12 | function pprrint() { 13 | return ( 14 | <> 15 | {/* */} 16 | {/*
                          */} 17 |
                          18 |

                          What About GeekyWeb...?

                          19 | 41 |
                          42 | {/*

                          React This Docus

                          */} 43 | 77 | 78 | ); 79 | } 80 | 81 | export default pprrint; -------------------------------------------------------------------------------- /docs/languages/kotlin/basics-of-kotlin.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Basics of Kotlin 3 | description: Learn the fundamentals of Kotlin programming with this comprehensive guide. Whether you're a beginner or an experienced developer, this tutorial provides a step-by-step approach to help you understand the basics of Kotlin. Discover the key features, syntax, and concepts of this modern and concise programming language, and explore how Kotlin can enhance your productivity and efficiency in developing robust and scalable applications. Start your Kotlin journey today and unlock the potential of this versatile language. 4 | # image: "#" 5 | keywords: 6 | [ 7 | Kotlin basics, 8 | Kotlin programming, 9 | Kotlin tutorial, 10 | learn Kotlin, 11 | Kotlin syntax, 12 | Kotlin concepts, 13 | Kotlin features, 14 | Kotlin language, 15 | Kotlin development, 16 | Kotlin applications, 17 | modern programming language, 18 | concise programming, 19 | beginner's guide to Kotlin, 20 | Kotlin for beginners, 21 | Kotlin productivity, 22 | Kotlin efficiency, 23 | robust applications, 24 | scalable applications., 25 | ] 26 | sidebar_position: 3 27 | sidebar_label: Basics of Kotlin 28 | slug: /kotlin/basics-of-kotlin 29 | --- 30 | 31 | This topic covers the basics of Kotlin for beginners. 32 | 33 | ## Basic examples 34 | 35 | 1.The Unit return type declaration is optional for functions. The following codes are equivalent. 36 | 37 | ```kotlin 38 | fun printHello(name: String?): Unit { 39 | if (name != null) 40 | println("Hello ${name}") 41 | } 42 | 43 | fun printHello(name: String?) { 44 | ... 45 | } 46 | ``` 47 | 48 | 2.Single-Expression functions:When a function returns a single expression, the curly braces can be omitted and the body is specified after = symbol 49 | 50 | ```kotlin 51 | fun double(x: Int): Int = x * 2 52 | ``` 53 | 54 | Explicitly declaring the return type is optional when this can be inferred by the compiler 55 | 56 | ```kotlin 57 | fun double(x: Int) = x * 2 58 | ``` 59 | 60 | 3.String interpolation: Using string values is easy. 61 | 62 | ```kotlin 63 | In java: 64 | int num=10 65 | String s = "i =" + i; 66 | 67 | In Kotlin 68 | val num = 10 69 | val s = "i = $num" 70 | ``` 71 | 72 | 4.In Kotlin, the type system distinguishes between references that can hold null (nullable references) and those that can not (non-null references). For example, a regular variable of type String can not hold null: 73 | 74 | ```kotlin 75 | var a: String = "abc" 76 | a = null // compilation error 77 | ``` 78 | 79 | To allow nulls, we can declare a variable as nullable string, written String?: 80 | 81 | ```kotlin 82 | var b: String? = "abc" 83 | b = null // ok 84 | ``` 85 | 86 | 5.In Kotlin,== actually checks for equality of values.By convention, an expression like 87 | a == b is translated to 88 | 89 | ```kotlin 90 | a?.equals(b) ?: (b === null) 91 | ``` 92 | 93 | ## Remarks 94 | 95 | 1. Kotlin file has an extension .kt. 96 | 1. All classes in Kotlin have a common superclass Any, that is a default super for a class with no supertypes declared(similar to Object in Java). 97 | 1. Variables can be declared as val(immutable- assign once) or var(mutables- value can be changed) 98 | 1. Semicolon is not needed at end of statement. 99 |
                        • If a function does not return any useful value, its return type is Unit.It is also optional. 100 | 6.Referential equality is checked by the === operation. a === b evaluates to true if and only if a and b point to the same object.
                        • 101 | -------------------------------------------------------------------------------- /docs/languages/kotlin/basic-lambdas.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Basic Lambdas in Kotlin 3 | description: Learn the fundamentals of using lambdas in Kotlin with this beginner-friendly guide. Discover how to leverage lambdas to write concise and expressive code, enabling you to enhance the functionality of your Kotlin applications. Explore practical examples and gain a solid understanding of lambda syntax, parameters, and the powerful features they offer. Whether you're a Kotlin novice or looking to expand your programming skills, this tutorial will equip you with the knowledge to utilize lambdas effectively and efficiently. 4 | # image: "#" 5 | keywords: 6 | [ 7 | Kotlin lambdas, 8 | lambda functions, 9 | anonymous functions, 10 | lambda expressions, 11 | higher-order functions, 12 | functional programming, 13 | concise code, 14 | expressive syntax, 15 | Kotlin programming, 16 | lambda parameters, 17 | lambda examples, 18 | Kotlin beginners, 19 | functional programming in Kotlin, 20 | ] 21 | sidebar_position: 14 22 | sidebar_label: Basic Lambdas 23 | slug: /kotlin/basic-lambdas 24 | --- 25 | 26 | ## Lambda as parameter to filter function 27 | 28 | ```kotlin 29 | val allowedUsers = users.filter { it.age > MINIMUM_AGE } 30 | ``` 31 | 32 | ## Lambda passed as a variable 33 | 34 | ```kotlin 35 | val isOfAllowedAge = { user: User -> user.age > MINIMUM_AGE } 36 | val allowedUsers = users.filter(isOfAllowedAge) 37 | ``` 38 | 39 | ## Lambda for benchmarking a function call 40 | 41 | General-purpose stopwatch for timing how long a function takes to run: 42 | 43 | ```kotlin 44 | object Benchmark { 45 | fun realtime(body: () -> Unit): Duration { 46 | val start = Instant.now() 47 | try { 48 | body() 49 | } finally { 50 | val end = Instant.now() 51 | return Duration.between(start, end) 52 | } 53 | } 54 | } 55 | ``` 56 | 57 | Usage: 58 | 59 | ```kotlin 60 | val time = Benchmark.realtime({ 61 | // some long-running code goes here ... 62 | }) 63 | println("Executed the code in $time") 64 | ``` 65 | 66 | #### Syntax 67 | 68 | - Explicit parameters: 69 | - { parameterName: ParameterType, otherParameterName: OtherParameterType -> anExpression() } 70 | - Inferred parameters: 71 | - val addition: (Int, Int) -> Int = { a, b -> a + b } 72 | - Single parameter `it` shorthand 73 | - val square: (Int) -> Int = { it\*it } 74 | - Signature: 75 | - () -> ResultType 76 | - (InputType) -> ResultType 77 | - (InputType1, InputType2) -> ResultType 78 | 79 | ## Remarks 80 | 81 | Input type parameters can be left out when they can be left out when they can be inferred from the context. For example say you have a function on a class that takes a function: 82 | 83 | ```kotlin 84 | data class User(val fistName: String, val lastName: String) { 85 | fun username(userNameGenerator: (String, String) -> String) = 86 | userNameGenerator(firstName, secondName) 87 | } 88 | ``` 89 | 90 | You can use this function by passing a lambda, and since the parameters are already specified in the function signature there's no need to re-declare them in the lambda expression: 91 | 92 | ```kotlin 93 | val user = User("foo", "bar") 94 | println(user.userName { firstName, secondName -> 95 | "${firstName.toUppercase}"_"${secondName.toUppercase}" 96 | }) // prints FOO_BAR 97 | ``` 98 | 99 | This also applies when you are assigning a lambda to a variable: 100 | 101 | ```kotlin 102 | //valid: 103 | val addition: (Int, Int) = { a, b -> a + b } 104 | //valid: 105 | val addition = { a: Int, b: Int -> a + b } 106 | //error (type inference failure): 107 | val addition = { a, b -> a + b } 108 | ``` 109 | 110 | When the lambda takes one parameter, and the type can be inferred from the context, you can refer to the parameter by `it`. 111 | 112 | ```kotlin 113 | listOf(1,2,3).map { it * 2 } // [2,4,6] 114 | ``` 115 | -------------------------------------------------------------------------------- /docs/languages/kotlin/delegated-properties.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Delegated properties in kotlin 3 | description: Dive into the world of delegated properties in Kotlin and unlock the power of simplified code with this comprehensive guide. Learn how to leverage delegated properties to enhance your Kotlin projects, reduce boilerplate code, and improve code maintainability. Discover the various types of delegated properties, including lazy, observable, vetoable, and more. Master the art of delegation and harness the flexibility and efficiency of delegated properties to optimize your Kotlin development workflow 4 | # image: "#" 5 | keywords: [ 6 | Kotlin, delegated properties, code abstraction, code simplification, Kotlin projects, reduce boilerplate code, improve code maintainability, lazy properties, observable properties, vetoable properties, code optimization, Kotlin development 7 | ] 8 | sidebar_position: 26 9 | sidebar_label: Delegated properties 10 | slug: /kotlin/delegated-properties 11 | --- 12 | 13 | Kotlin can delegate the implementation of a property to a handler object. Some standard handlers are included, such as lazy initialization or observable properties. Custom handlers can also be created. 14 | 15 | ## Observable properties 16 | 17 | ```kotlin 18 | var foo : Int by Delegates.observable("1") { property, oldValue, newValue -> 19 | println("${property.name} was changed from $oldValue to $newValue") 20 | } 21 | foo = 2 22 | ``` 23 | 24 | The example prints `foo was changed from 1 to 2` 25 | 26 | ## Custom delegation 27 | 28 | ```kotlin 29 | class MyDelegate { 30 | operator fun getValue(owner: Any?, property: KProperty<*>): String { 31 | return "Delegated value" 32 | } 33 | } 34 | 35 | val foo : String by MyDelegate() 36 | println(foo) 37 | ``` 38 | 39 | The example prints `Delegated value` 40 | 41 | ## Lazy initialization 42 | 43 | ```kotlin 44 | val foo : Int by lazy { 1 + 1 } 45 | println(foo) 46 | ``` 47 | 48 | The example prints `2`. 49 | 50 | ## Map-backed properties 51 | 52 | ```kotlin 53 | val map = mapOf("foo" to 1) 54 | val foo : String by map 55 | println(foo) 56 | ``` 57 | 58 | The example prints `1` 59 | 60 | ## Delegate Can be used as a layer to reduce boilerplate 61 | 62 | Consider Kotlin's Null Type system and `WeakReference`. 63 | 64 | So let's say we have to save some sort of reference and we wanted to avoid memory leaks, here is where `WeakReference` comes in. 65 | 66 | take for example this: 67 | 68 | ```kotlin 69 | class MyMemoryExpensiveClass { 70 | companion object { 71 | var reference: WeakReference? = null 72 | 73 | fun doWithReference(block: (MyMemoryExpensiveClass) -> Unit) { 74 | reference?.let { 75 | it.get()?.let(block) 76 | } 77 | } 78 | } 79 | 80 | init { 81 | reference = WeakReference(this) 82 | } 83 | } 84 | ``` 85 | 86 | Now this is just with one WeakReference. To Reduce this boilerplate, we can use a custom property delegate to help us like so: 87 | 88 | ```kotlin 89 | class WeakReferenceDelegate(initialValue: T? = null) : ReadWriteProperty { 90 | var reference = WeakReference(initialValue) 91 | private set 92 | 93 | override fun getValue(thisRef: Any, property: KProperty<*>): T? = reference.get() 94 | 95 | override fun setValue(thisRef: Any, property: KProperty<*>, value: T?) { 96 | reference = WeakReference(value) 97 | } 98 | } 99 | ``` 100 | 101 | So Now we can use variables that are wrapped with `WeakReference` just like normal nullable variables ! 102 | 103 | ```kotlin 104 | class MyMemoryExpensiveClass { 105 | companion object { 106 | var reference: MyMemoryExpensiveClass? by WeakReferenceDelegate() 107 | 108 | fun doWithReference(block: (MyMemoryExpensiveClass) -> Unit) { 109 | reference?.let(block) 110 | } 111 | } 112 | 113 | init { 114 | reference = this 115 | } 116 | } 117 | ``` 118 | -------------------------------------------------------------------------------- /docs/languages/kotlin/recyclerview-in-kotlin.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: RecyclerView in Kotlin 3 | description: Learn how to implement the RecyclerView component in Kotlin for seamless and optimized list display in Android development. The RecyclerView is a powerful and flexible tool that enables efficient handling of large data sets, improving performance and user experience. Discover essential techniques and best practices to create responsive and interactive lists, including item view recycling, view holders, and data binding. This comprehensive guide provides step-by-step instructions, code examples, and insights to help you leverage the RecyclerView to its full potential and enhance your Android applications 4 | # image: "#" 5 | keywords: 6 | [ 7 | RecyclerView, 8 | Kotlin, 9 | Android development, 10 | list display, 11 | efficient handling, 12 | large data sets, 13 | performance optimization, 14 | user experience, 15 | item view recycling, 16 | view holders, 17 | data binding, 18 | responsive lists, 19 | interactive lists, 20 | code examples, 21 | Android applications, 22 | ] 23 | sidebar_position: 31 24 | sidebar_label: RecyclerView 25 | slug: /kotlin/recyclerview 26 | --- 27 | 28 | I just want to share my little bit knowledge and code of RecyclerView using Kotlin. 29 | 30 | ## Main class and Adapter 31 | 32 | I am assuming that you have aware about the some syntax of **Kotlin** and how to use, just add **RecyclerView** in **activity_main.xml** file and set with adapter class. 33 | 34 | ```kotlin 35 | class MainActivity : AppCompatActivity(){ 36 | 37 | lateinit var mRecyclerView : RecyclerView 38 | val mAdapter : RecyclerAdapter = RecyclerAdapter() 39 | 40 | override fun onCreate(savedInstanceState: Bundle?) { 41 | super.onCreate(savedInstanceState) 42 | setContentView(R.layout.activity_main) 43 | val toolbar = findViewById(R.id.toolbar) as Toolbar 44 | setSupportActionBar(toolbar) 45 | 46 | mRecyclerView = findViewById(R.id.recycler_view) as RecyclerView 47 | 48 | mRecyclerView.setHasFixedSize(true) 49 | mRecyclerView.layoutManager = LinearLayoutManager(this) 50 | mAdapter.RecyclerAdapter(getList(), this) 51 | mRecyclerView.adapter = mAdapter 52 | } 53 | 54 | private fun getList(): ArrayList { 55 | var list : ArrayList = ArrayList() 56 | for (i in 1..10) { // equivalent of 1 <= i && i <= 10 57 | println(i) 58 | list.add("$i") 59 | } 60 | return list 61 | } 62 | } 63 | ``` 64 | 65 | this one is your recycler view **adapter** class and create **main_item.xml** file what you want 66 | 67 | ```kotlin 68 | class RecyclerAdapter : RecyclerView.Adapter() { 69 | 70 | var mItems: ArrayList = ArrayList() 71 | lateinit var mClick : OnClick 72 | 73 | fun RecyclerAdapter(item : ArrayList, mClick : OnClick){ 74 | this.mItems = item 75 | this.mClick = mClick; 76 | } 77 | 78 | override fun onBindViewHolder(holder: ViewHolder, position: Int) { 79 | val item = mItems[position] 80 | holder.bind(item, mClick, position) 81 | } 82 | 83 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ViewHolder { 84 | val layoutInflater = LayoutInflater.from(parent.context) 85 | return ViewHolder(layoutInflater.inflate(R.layout.main_item, parent, false)) 86 | } 87 | 88 | override fun getItemCount(): Int { 89 | return mItems.size 90 | } 91 | 92 | class ViewHolder(view: View) : RecyclerView.ViewHolder(view) { 93 | val card = view.findViewById(R.id.card) as TextView 94 | fun bind(str: String, mClick: OnClick, position: Int){ 95 | card.text = str 96 | card.setOnClickListener { view -> 97 | mClick.onClickListner(position) 98 | } 99 | } 100 | } 101 | } 102 | ``` 103 | -------------------------------------------------------------------------------- /docs/languages/jquery/element-visibility.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Element Visibility in jQuery 3 | description: Element Visibility in jQuery refers to the ability to control the visibility of HTML elements on a web page using jQuery, a popular JavaScript library. With jQuery, developers can easily manipulate the display or visibility of elements based on certain conditions or user interactions 4 | # image: "#" 5 | keywords: 6 | [ 7 | Element visibility, 8 | jQuery, 9 | HTML elements, 10 | web page, 11 | JavaScript library, 12 | manipulate display, 13 | visibility, 14 | conditions, 15 | user interactions, 16 | ] 17 | sidebar_position: 11 18 | sidebar_label: Element Visibility 19 | slug: /jquery/element-visibility 20 | --- 21 | 22 | ## Toggle possibilities 23 | 24 | **Simple `toggle()` case** 25 | 26 | ```js 27 | function toggleBasic() { 28 | $(".target1").toggle(); 29 | } 30 | ``` 31 | 32 | **With specific **duration\*\*\*\* 33 | 34 | ```js 35 | function toggleDuration() { 36 | $(".target2").toggle("slow"); // A millisecond duration value is also acceptable 37 | } 38 | ``` 39 | 40 | **...and **callback\*\*\*\* 41 | 42 | ```js 43 | function toggleCallback() { 44 | $(".target3").toggle("slow", function () { 45 | alert("now do something"); 46 | }); 47 | } 48 | ``` 49 | 50 | **...or with **easing** and callback.** 51 | 52 | ```js 53 | function toggleEasingAndCallback() { 54 | // You may use jQueryUI as the core only supports linear and swing easings 55 | $(".target4").toggle("slow", "linear", function () { 56 | alert("now do something"); 57 | }); 58 | } 59 | ``` 60 | 61 | **...or with a variety of **options**.** 62 | 63 | ```js 64 | function toggleWithOptions() { 65 | $(".target5").toggle({ 66 | // See all possible options in: api.jquery.com/toggle/#toggle-options 67 | duration: 1000, // milliseconds 68 | easing: "linear", 69 | done: function () { 70 | alert("now do something"); 71 | }, 72 | }); 73 | } 74 | ``` 75 | 76 | **It's also possible to use a **slide** as animation with `slideToggle()`** 77 | 78 | ```js 79 | function toggleSlide() { 80 | $(".target6").slideToggle(); // Animates from top to bottom, instead of top corner 81 | } 82 | ``` 83 | 84 | **...or fade in/out by changing opacity with `fadeToggle()`** 85 | 86 | ```js 87 | function toggleFading() { 88 | $(".target7").fadeToggle("slow"); 89 | } 90 | ``` 91 | 92 | **...or toggle a class with `toggleClass()`** 93 | 94 | ```js 95 | function toggleClass() { 96 | $(".target8").toggleClass("active"); 97 | } 98 | ``` 99 | 100 | **A common case is to use `toggle()` in order to show one element while hiding the other (same class)** 101 | 102 | ```js 103 | function toggleX() { 104 | $(".targetX").toggle("slow"); 105 | } 106 | ``` 107 | 108 | All the above examples can be found [here](https://codepen.io/anon/pen/GERVJe) 109 | 110 | ## Overview 111 | 112 | ```js 113 | $(element).hide(); // sets display: none 114 | $(element).show(); // sets display to original value 115 | $(element).toggle(); // toggles between the two 116 | $(element).is(":visible"); // returns true or false 117 | $("element:visible"); // matches all elements that are visible 118 | $("element:hidden"); // matches all elements that are hidden 119 | 120 | $("element").fadeIn(); // display the element 121 | $("element").fadeOut(); // hide the element 122 | 123 | $("element").fadeIn(1000); // display the element using timer 124 | $("element").fadeOut(1000); // hide the element using timer 125 | 126 | // display the element using timer and a callback function 127 | $("element").fadeIn(1000, function () { 128 | // code to execute 129 | }); 130 | 131 | // hide the element using timer and a callback function 132 | $("element").fadeOut(1000, function () { 133 | // code to execute 134 | }); 135 | ``` 136 | 137 | #### Parameters 138 | 139 | | Parameter | Details | 140 | | --------- | ---------------------------------------------------------------------------------------------------------------------------- | 141 | | Duration | When passed, the effects of `.hide()`, `.show()` and `.toggle()` are animated; the element(s) will gradually fade in or out. | 142 | -------------------------------------------------------------------------------- /docs/languages/kotlin/strings.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Strings in Kotlin 3 | description: Discover the versatility and efficiency of string manipulation in Kotlin with this comprehensive guide. From basic string operations to advanced techniques, learn how to harness the full potential of Kotlin's string handling capabilities. Dive into topics such as concatenation, interpolation, substring extraction, pattern matching, and more. Gain insights into best practices for optimizing your code and creating SEO-friendly content using Kotlin's powerful string functions. Unlock the secrets of efficient string processing and elevate your Kotlin programming skills to new heights. 4 | # image: "#" 5 | keywords: 6 | [ 7 | Kotlin strings, 8 | string manipulation, 9 | string handling, 10 | string operations, 11 | concatenation, 12 | interpolation, 13 | substring extraction, 14 | pattern matching, 15 | Kotlin programming, 16 | efficient string processing, 17 | SEO-friendly content, 18 | Kotlin string functions, 19 | optimization, 20 | ] 21 | sidebar_position: 4 22 | sidebar_label: Strings 23 | slug: /kotlin/strings 24 | --- 25 | 26 | ## String Equality 27 | 28 | In Kotlin strings are compared with `==` operator which chect for their structural equality. 29 | 30 | ```kotlin 31 | val str1 = "Hello, World!" 32 | val str2 = "Hello," + " World!" 33 | println(str1 == str2) // Prints true 34 | ``` 35 | 36 | Referential equality is checked with `===` operator. 37 | 38 | ```kotlin 39 | val str1 = """ 40 | |Hello, World! 41 | """.trimMargin() 42 | 43 | val str2 = """ 44 | #Hello, World! 45 | """.trimMargin("#") 46 | 47 | val str3 = str1 48 | 49 | println(str1 == str2) // Prints true 50 | println(str1 === str2) // Prints false 51 | println(str1 === str3) // Prints true 52 | ``` 53 | 54 | ## String Literals 55 | 56 | Kotlin has two types of string literals: 57 | 58 | - Escaped string 59 | - Raw string 60 | 61 | **Escaped string** handles special characters by escaping them. Escaping is done with a backslash. The following escape sequences are supported: `\t`, `\b`, `\n`, `\r`, `\'`, `\"`, `\\` and `\$`. To encode any other character, use the Unicode escape sequence syntax: `\uFF00`. 62 | 63 | ```kotlin 64 | val s = "Hello, world!\n" 65 | ``` 66 | 67 | **Raw string** delimited by a triple quote `"""`, contains no escaping and can contain newlines and any other characters 68 | 69 | ```kotlin 70 | val text = """ 71 | for (c in "foo") 72 | print(c) 73 | """ 74 | ``` 75 | 76 | Leading whitespace can be removed with [trimMargin()](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/trim-margin.html) function. 77 | 78 | ```kotlin 79 | val text = """ 80 | |Tell me and I forget. 81 | |Teach me and I remember. 82 | |Involve me and I learn. 83 | |(Benjamin Franklin) 84 | """.trimMargin() 85 | ``` 86 | 87 | Default margin prefix is pipe character `|`, this can be set as a parameter to trimMargin; e.g. `trimMargin(">")`. 88 | 89 | ## Elements of String 90 | 91 | Elements of String are characters that can be accessed by the indexing operation 92 | `string[index]`. 93 | 94 | ```kotlin 95 | val str = "Hello, World!" 96 | println(str[1]) // Prints e 97 | ``` 98 | 99 | String elements can be iterated with a for-loop. 100 | 101 | ```kotlin 102 | for (c in str) { 103 | println(c) 104 | } 105 | ``` 106 | 107 | ## String Templates 108 | 109 | Both escaped strings and raw strings can contain template expressions. Template expression is a piece of code which is evaluated and its result is concatenated into string. It starts with a dollar sign `$` and consists of either a variable name: 110 | 111 | ```kotlin 112 | val i = 10 113 | val s = "i = $i" // evaluates to "i = 10" 114 | ``` 115 | 116 | Or an arbitrary expression in curly braces: 117 | 118 | ```kotlin 119 | val s = "abc" 120 | val str = "$s.length is ${s.length}" // evaluates to "abc.length is 3" 121 | ``` 122 | 123 | To include a literal dollar sign in a string, escape it using a backslash: 124 | 125 | ```kotlin 126 | val str = "\$foo" // evaluates to "$foo" 127 | ``` 128 | 129 | The exception is raw strings, which do not support escaping. In raw strings you can use the following syntax to represent a dollar sign. 130 | 131 | ```kotlin 132 | val price = """ 133 | ${'$'}9.99 134 | """ 135 | ``` 136 | -------------------------------------------------------------------------------- /docs/languages/jquery/attributes.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Attributes in jQuery 3 | description: jQuery is a popular JavaScript library that simplifies HTML document traversal, event handling, animating, and Ajax interactions for rapid web development. It provides a wide range of functions and attributes that enable developers to manipulate HTML elements easily. jQuery attributes play a crucial role in modifying and accessing various aspects of HTML elements, such as their properties, states, and behaviors. Understanding and utilizing these attributes can greatly enhance the interactivity and functionality of web pages 4 | # image: "#" 5 | keywords: 6 | [ 7 | jQuery, 8 | JavaScript library, 9 | HTML document traversal, 10 | event handling, 11 | animating, 12 | Ajax interactions, 13 | web development, 14 | HTML elements, 15 | attributes, 16 | properties, 17 | states, 18 | behaviors, 19 | interactivity, 20 | functionality, 21 | ] 22 | sidebar_position: 5 23 | sidebar_label: Attributes 24 | slug: /jquery/attributes 25 | --- 26 | 27 | ## Differece between attr() and prop() 28 | 29 | [`attr()`](http://stackoverflow.com/documentation/jquery/4429/attributes/15471/getting-value-of-html-attribute#t=201608020513212065116) gets/sets the HTML attribute using the DOM functions `getAttribute()` and `setAttribute()`. [`prop()`](https://api.jquery.com/prop/) works by setting the DOM property without changing the attribute. In many cases the two are interchangeable, but occasionally one is needed over the other. 30 | 31 | To set a checkbox as checked: 32 | 33 | ```js 34 | $("#tosAccept").prop("checked", true); // using attr() won't work properly here 35 | ``` 36 | 37 | To remove a property you can use the [`removeProp()`](https://api.jquery.com/removeProp/) method. Similarly [`removeAttr()`](http://stackoverflow.com/documentation/jquery/4429/attributes/15473/removing-attribute#t=201608020514117105889) removes attributes. 38 | 39 | ## Get the attribute value of a HTML element 40 | 41 | When a single parameter is passed to the [`.attr()`](https://api.jquery.com/attr/) function it returns the value of passed attribute on the selected element. 42 | 43 | Syntax: 44 | 45 | `$([selector]).attr([attribute name]);` 46 | 47 | Example: 48 | 49 | HTML: 50 | 51 | `Home` 52 | 53 | jQuery: 54 | 55 | `$('a').attr('href');` 56 | 57 | **Fetching `data` attributes:** 58 | 59 | jQuery offers [`.data()`](https://api.jquery.com/data/) function in order to deal with data attributes. `.data` function returns the value of the data attribute on the selected element. 60 | 61 | Syntax: 62 | 63 | `$([selector]).data([attribute name]);` 64 | 65 | Example: 66 | 67 | Html: 68 | 69 | `
                          ` 70 | 71 | jQuery: 72 | 73 | `$("article").data("column")` 74 | 75 | **Note:** 76 | 77 | > jQuery's data() method will give you access to data-\* attributes, BUT, it clobbers the case of the attribute name. [Reference](http://stackoverflow.com/questions/17351282/jquery-cant-get-data-attribute-value) 78 | 79 | ## Setting value of HTML attribute 80 | 81 | If you want to add an attribute to some element you can use the [`attr(attributeName, attributeValue)`](https://api.jquery.com/attr/) function. For example: 82 | 83 | ```js 84 | $("a").attr("title", "Click me"); 85 | ``` 86 | 87 | This example will add mouseover text `"Click me"` to all links on the page. 88 | 89 | The same function is used to change attributes' values. 90 | 91 | ## Removing attribute 92 | 93 | To remove an attribute from an element you can use the function [`.removeAttr(attributeName)`](https://api.jquery.com/removeAttr/). For example: 94 | 95 | ```js 96 | $("#home").removeAttr("title"); 97 | ``` 98 | 99 | This will remove `title` attribute from the element with ID `home`. 100 | 101 | ## Remarks 102 | 103 | The jQuery function `.attr()`, gets the value of an attribute for the **first** element in the set of matched elements or set one or more attributes for **every** matched element. 104 | 105 | It is worth noting that when getting the value of an attribute, it only gets it from the first element that matches the selector (i.e. `$("input").attr("type");` would only get the type of the first input, if there are more than one) 106 | 107 | However, when setting an attribute, it will apply it to all matching elements. 108 | -------------------------------------------------------------------------------- /docs/languages/javascript/comments.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Comments in JavaScript 3 | description: Learn the importance and usage of comments in JavaScript for better code organization and readability. Understand how to write effective comments to enhance collaboration and maintainability 4 | # image: "#" 5 | keywords: 6 | [ 7 | comments in JavaScript, 8 | JavaScript code organization, 9 | JavaScript code readability, 10 | write effective comments, 11 | collaboration in JavaScript, 12 | maintainable JavaScript code, 13 | ] 14 | sidebar_position: 5 15 | sidebar_label: Comments 16 | slug: /javascript/comments 17 | --- 18 | 19 | import InArticleAd from '@site/src/components/Adsence/InArticleAd'; 20 | 21 | 22 | 23 | ## Using Comments 24 | 25 | To add annotations, hints, or exclude some code from being executed JavaScript provides two ways of commenting code lines 26 | 27 | ### Single line Comment `//` 28 | 29 | Everything after the `//` until the end of the line is excluded from execution. 30 | 31 | ```js 32 | function elementAt(event) { 33 | // Gets the element from Event coordinates 34 | return document.elementFromPoint(event.clientX, event.clientY); 35 | } 36 | // TODO: write more cool stuff! 37 | ``` 38 | 39 | ### Multi-line Comment `/**/` 40 | 41 | Everything between the opening `/*` and the closing `*/` is excluded from execution, even if the opening and closing are on different lines. 42 | 43 | ```js 44 | /* 45 | Gets the element from Event coordinates. 46 | Use like: 47 | var clickedEl = someEl.addEventListener("click", elementAt, false); 48 | */ 49 | function elementAt(event) { 50 | return document.elementFromPoint(event.clientX, event.clientY); 51 | } 52 | /* TODO: write more useful comments! */ 53 | ``` 54 | 55 | 56 | 57 | ## Using HTML comments in JavaScript (Bad practice) 58 | 59 | HTML comments (optionally preceded by whitespace) will cause code (on the same line) to be ignored by the browser also, though this is considered **bad practice**. 60 | 61 | One-line comments with the HTML comment opening sequence (``) here. 64 | 65 | ```js 66 | Identical to using `//` since 68 | the closing `-->` is ignored. 69 | 70 | ``` 71 | 72 | This technique can be observed in legacy code to hide JavaScript from browsers that didn't support it: 73 | 74 | ```js 75 | 82 | 83 | ``` 84 | 85 | An HTML closing comment can also be used in JavaScript (independent of an opening comment) at the beginning of a line (optionally preceded by whitespace) in which case it too causes the rest of the line to be ignored: 86 | 87 | ```js 88 | --> Unreachable JS code 89 | 90 | ``` 91 | 92 | These facts have also been exploited to allow a page to call itself first as HTML and secondly as JavaScript. For example: 93 | 94 | ```js 95 | 99 | 100 | 106 | 109 | 110 | ``` 111 | 112 | When run a HTML, all the multiline text between the `` comments are ignored, so the JavaScript contained therein is ignored when run as HTML. 113 | 114 | As JavaScript, however, while the lines beginning with `` are ignored, their effect is not to escape over **multiple** lines, so the lines following them (e.g., `self.postMessage(...`) will not be ignored when run as JavaScript, at least until they reach a **JavaScript** comment, marked by `/*` and `*/`. Such JavaScript comments are used in the above example to ignore the remaining **HTML** text (until the `-->` which is also ignored as JavaScript). 115 | 116 | #### Syntax 117 | 118 | - `// Single line comment (continues until line break)` 119 | - `/* Multi line comment */` 120 | - ` Single line comment starting with the closing HTML comment segment "-->" (continues until line break)` 122 | 123 | 124 | -------------------------------------------------------------------------------- /docs/languages/jquery/jquery-deferred-objects-and-promises.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: jQuery Deferred objects and Promises 3 | description: Learn how to harness the capabilities of jQuery Deferred objects and Promises to handle asynchronous operations effectively. Explore their features, benefits, and practical implementations to optimize your web development workflow 4 | # image: "#" 5 | keywords: 6 | [ 7 | jQuery Deferred objects, 8 | jQuery Promises, 9 | asynchronous operations, 10 | web development, 11 | JavaScript, 12 | jQuery framework, 13 | asynchronous programming, 14 | asynchronous callbacks, 15 | concurrency management, 16 | event-driven architecture, 17 | deferred API, 18 | promise-based programming, 19 | web applications, 20 | ] 21 | sidebar_position: 16 22 | sidebar_label: jQuery Deferred objects and Promises 23 | slug: /jquery/deferred-objects-and-promises 24 | --- 25 | 26 | ## jQuery ajax() success, error VS .done(), .fail() 27 | 28 | **success and Error :** 29 | A **success** callback that gets invoked upon successful completion of an Ajax request. 30 | 31 | A **failure** callback that gets invoked in case there is any error while making the request. 32 | 33 | **Example:** 34 | 35 | ```js 36 | $.ajax({ 37 | url: "URL", 38 | type: "POST", 39 | data: yourData, 40 | datatype: "json", 41 | success: function (data) { 42 | successFunction(data); 43 | }, 44 | error: function (jqXHR, textStatus, errorThrown) { 45 | errorFunction(); 46 | }, 47 | }); 48 | ``` 49 | 50 | **.done() and .fail() :** 51 | 52 | .ajax().done(function(data, textStatus, jqXHR){}); 53 | Replaces method .success() which was deprecated in jQuery 1.8.This is an alternative construct for the success callback function above. 54 | 55 | .ajax().fail(function(jqXHR, textStatus, errorThrown){}); 56 | Replaces method .error() which was deprecated in jQuery 1.8.This is an alternative construct for the complete callback function above. 57 | 58 | **Example:** 59 | 60 | ```js 61 | $.ajax({ 62 | url: "URL", 63 | type: "POST", 64 | data: yourData, 65 | datatype: "json", 66 | }) 67 | .done(function (data) { 68 | successFunction(data); 69 | }) 70 | .fail(function (jqXHR, textStatus, errorThrown) { 71 | serrorFunction(); 72 | }); 73 | ``` 74 | 75 | ## Basic promise creation 76 | 77 | Here is a very simple example of a function that "**promises** to proceed when a given time elapses". It does that by creating a new `Deferred` object, that is resolved later and returning the Deferred's promise: 78 | 79 | ```js 80 | function waitPromise(milliseconds) { 81 | // Create a new Deferred object using the jQuery static method 82 | var def = $.Deferred(); 83 | 84 | // Do some asynchronous work - in this case a simple timer 85 | setTimeout(function () { 86 | // Work completed... resolve the deferred, so it's promise will proceed 87 | def.resolve(); 88 | }, milliseconds); 89 | 90 | // Immediately return a "promise to proceed when the wait time ends" 91 | return def.promise(); 92 | } 93 | ``` 94 | 95 | And use like this: 96 | 97 | ```js 98 | waitPromise(2000).then(function () { 99 | console.log("I have waited long enough"); 100 | }); 101 | ``` 102 | 103 | ## Get the current state of a promise 104 | 105 | By default the state of a promise is pending when it is created. The state of a promise is changed when the deferred object which created the promise either resolves/rejects it. 106 | 107 | ```js 108 | var deferred = new $.Deferred(); 109 | var d1 = deferred.promise({ 110 | prop: "value", 111 | }); 112 | var d2 = $("div").promise(); 113 | var d3 = $("div").hide(1000).promise(); 114 | 115 | console.log(d1.state()); // "pending" 116 | console.log(d2.state()); // "resolved" 117 | console.log(d3.state()); // "pending" 118 | ``` 119 | 120 | ## Asynchronous Promises Chaining 121 | 122 | If you have multiple asynchronous tasks that needs to occur one after the other, you will need to chain together their promise objects. Here is a simple example: 123 | 124 | ```js 125 | function First() { 126 | console.log("Calling Function First"); 127 | return $.get("/ajax/GetFunction/First"); 128 | } 129 | 130 | function Second() { 131 | console.log("Calling Function Second"); 132 | return $.get("/ajax/GetFunction/Second"); 133 | } 134 | 135 | function Third() { 136 | console.log("Calling Function Third"); 137 | return $.get("/ajax/GetFunction/Third"); 138 | } 139 | 140 | function log(results) { 141 | console.log("Result from previous AJAX call: " + results.data); 142 | } 143 | 144 | First().done(log).then(Second).done(log).then(Third).done(log); 145 | ``` 146 | -------------------------------------------------------------------------------- /docs/languages/kotlin/arrays.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Arrays in Kotlin 3 | description: Arrays in Kotlin provide a powerful tool for managing and manipulating collections of elements efficiently. This comprehensive guide explores the fundamentals of arrays in Kotlin, including their declaration, initialization, and common operations. Discover how to leverage arrays to store and access data, perform searching and sorting operations, and handle multidimensional arrays. With practical examples and step-by-step explanations, this guide will help you unlock the full potential of arrays in Kotlin for optimal data management and processing 4 | # image: "#" 5 | keywords: 6 | [ 7 | Kotlin arrays, 8 | array declaration, 9 | array initialization, 10 | array operations, 11 | data manipulation in Kotlin, 12 | efficient array handling, 13 | array searching, 14 | array sorting, 15 | multidimensional arrays, 16 | Kotlin data management, 17 | Kotlin array processing, 18 | ] 19 | sidebar_position: 5 20 | sidebar_label: Arrays 21 | slug: /kotlin/arrays 22 | --- 23 | 24 | ## Generic Arrays 25 | 26 | Generic arrays in Kotlin are represented by `Array`. 27 | 28 | To create an empty array, use `emptyArray()` factory function: 29 | 30 | ```kotlin 31 | val empty = emptyArray() 32 | ``` 33 | 34 | To create an array with given size and initial values, use the constructor: 35 | 36 | ```kotlin 37 | var strings = Array(size = 5, init = { index -> "Item #$index" }) 38 | print(Arrays.toString(a)) // prints "[Item #0, Item #1, Item #2, Item #3, Item #4]" 39 | print(a.size) // prints 5 40 | ``` 41 | 42 | Arrays have `get(index: Int): T` and `set(index: Int, value: T)` functions: 43 | 44 | ```kotlin 45 | strings.set(2, "ChangedItem") 46 | print(strings.get(2)) // prints "ChangedItem" 47 | 48 | // You can use subscription as well: 49 | strings[2] = "ChangedItem" 50 | print(strings[2]) // prints "ChangedItem" 51 | ``` 52 | 53 | ## Arrays of Primitives 54 | 55 | These types **do not** inherit from `Array` to avoid boxing, however, they have the same attributes and methods. 56 | 57 | | Kotlin type | Factory function | JVM type | 58 | | -------------- | ----------------------------- | ----------- | 59 | | `BooleanArray` | `booleanArrayOf(true, false)` | `boolean[]` | 60 | | `ByteArray` | `byteArrayOf(1, 2, 3)` | `byte[]` | 61 | | `CharArray` | `charArrayOf('a', 'b', 'c')` | `char[]` | 62 | | `DoubleArray` | `doubleArrayOf(1.2, 5.0)` | `double[]` | 63 | | `FloatArray` | `floatArrayOf(1.2, 5.0)` | `float[]` | 64 | | `IntArray` | `intArrayOf(1, 2, 3)` | `int[]` | 65 | | `LongArray` | `longArrayOf(1, 2, 3)` | `long[]` | 66 | | `ShortArray` | `shortArrayOf(1, 2, 3)` | `short[]` | 67 | 68 | ## Extensions 69 | 70 | `average()` is defined for `Byte`, `Int`, `Long`, `Short`, `Double`, `Float` and always returns `Double`: 71 | 72 | ```kotlin 73 | val doubles = doubleArrayOf(1.5, 3.0) 74 | print(doubles.average()) // prints 2.25 75 | 76 | val ints = intArrayOf(1, 4) 77 | println(ints.average()) // prints 2.5 78 | ``` 79 | 80 | `component1()`, `component2()`, ... `component5()` return an item of the array 81 | 82 | `getOrNull(index: Int)` returns null if index is out of bounds, otherwise an item of the array 83 | 84 | `first()`, `last()` 85 | 86 | `toHashSet()` returns a `HashSet` of all elements 87 | 88 | `sortedArray()`, `sortedArrayDescending()` creates and returns a new array with sorted elements of current 89 | 90 | `sort()`, `sortDescending` sort the array in-place 91 | 92 | `min()`, `max()` 93 | 94 | ## Iterate Array 95 | 96 | You can print the array elements using the loop same as the Java enhanced loop, but you need to change keyword from `:` to `in`. 97 | 98 | ```kotlin 99 | val asc = Array(5, { i -> (i * i).toString() }) 100 | for(s : String in asc){ 101 | println(s); 102 | } 103 | ``` 104 | 105 | You can also change data type in for loop. 106 | 107 | ```kotlin 108 | val asc = Array(5, { i -> (i * i).toString() }) 109 | for(s in asc){ 110 | println(s); 111 | } 112 | ``` 113 | 114 | ## Create an array 115 | 116 | ```kotlin 117 | val a = arrayOf(1, 2, 3) // creates an Array of size 3 containing [1, 2, 3]. 118 | ``` 119 | 120 | ## Create an array using a closure 121 | 122 | ```kotlin 123 | val a = Array(3) { i -> i * 2 } // creates an Array of size 3 containing [0, 2, 4] 124 | ``` 125 | 126 | ## Create an uninitialized array 127 | 128 | ```kotlin 129 | val a = arrayOfNulls(3) // creates an Array of [null, null, null] 130 | ``` 131 | 132 | The returned array will always have a nullable type. Arrays of non-nullable items can't be created uninitialized. 133 | -------------------------------------------------------------------------------- /docs/languages/kotlin/generics.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Generics in Kotlin 3 | description: Dive into the world of generics in Kotlin with this comprehensive guide. Discover how generics enable type-safe programming, allowing you to write flexible and reusable code that enhances readability and maintainability. Learn the fundamentals of generic classes, functions, and constraints, and explore advanced topics such as variance, type projections, and reified types. Master the art of leveraging generics to build robust, scalable, and error-free Kotlin applications. Whether you're a beginner or an experienced developer, this guide will equip you with the knowledge and skills to harness the power of generics in Kotlin effectively 4 | # image: "#" 5 | keywords: 6 | [ 7 | Kotlin generics, 8 | type-safe programming, 9 | generic classes, 10 | generic functions, 11 | type constraints, 12 | variance, 13 | type projections, 14 | reified types, 15 | Kotlin applications, 16 | type inference, 17 | generic interfaces, 18 | Kotlin programming, 19 | type parameters, 20 | Kotlin development, 21 | type erasure, 22 | generic constraints, 23 | ] 24 | sidebar_position: 19 25 | sidebar_label: Generics 26 | slug: /kotlin/generics 27 | --- 28 | 29 | A List can hold numbers, words or really anything. 30 | That's why we call the List **generic**. 31 | 32 | Generics are basically used to define which types a class can hold and which type an object currently holds. 33 | 34 | ## Declaration-site variance 35 | 36 | [Declaration-site variance](https://kotlinlang.org/docs/reference/generics.html#declaration-site-variance) can be thought of as declaration of use-site variance once and for all the use-sites. 37 | 38 | ```kotlin 39 | class Consumer { fun consume(t: T) { ... } } 40 | 41 | fun charSequencesConsumer() : Consumer() = ... 42 | 43 | val stringConsumer : Consumer = charSequenceConsumer() // OK since in-projection 44 | val anyConsumer : Consumer = charSequenceConsumer() // Error, Any cannot be passed 45 | 46 | val outConsumer : Consumer = ... // Error, T is `in`-parameter 47 | ``` 48 | 49 | Widespread examples of declaration-site variance are `List`, which is immutable so that `T` only appears as the return value type, and `Comparator`, which only receives `T` as argument. 50 | 51 | ## Use-site variance 52 | 53 | [Use-site variance](https://kotlinlang.org/docs/reference/generics.html#use-site-variance-type-projections) is similar to Java wildcards: 54 | 55 | Out-projection: 56 | 57 | ```kotlin 58 | val takeList : MutableList = ... // Java: List 59 | 60 | val takenValue : SomeType = takeList[0] // OK, since upper bound is SomeType 61 | 62 | takeList.add(takenValue) // Error, lower bound for generic is not specified 63 | ``` 64 | 65 | In-projection: 66 | 67 | ```kotlin 68 | val putList : MutableList = ... // Java: List 69 | 70 | val valueToPut : SomeType = ... 71 | putList.add(valueToPut) // OK, since lower bound is SomeType 72 | 73 | putList[0] // This expression has type Any, since no upper bound is specified 74 | ``` 75 | 76 | Star-projection 77 | 78 | ```kotlin 79 | val starList : MutableList<*> = ... // Java: List 80 | 81 | starList[0] // This expression has type Any, since no upper bound is specified 82 | starList.add(someValue) // Error, lower bound for generic is not specified 83 | ``` 84 | 85 | **See also:** 86 | 87 | - [Variant Generics](https://kotlinlang.org/docs/reference/java-to-kotlin-interop.html#variant-generics) interoperability when calling Kotlin from Java. 88 | 89 | ## Syntax 90 | 91 | - class **ClassName**<\***\*TypeName\*\***> 92 | - class **ClassName**<\*> 93 | - **ClassName** 94 | - **ClassName** 95 | - class **Name**<\***\*TypeName\*\***:\***\*UpperBound\*\***> 96 | 97 | ## Parameters 98 | 99 | | Parameter | Details | 100 | | -------------- | ------------------------------ | 101 | | **TypeName** | Type Name of generic parameter | 102 | | **UpperBound** | Covariant Type | 103 | | **LowerBound** | Contravariant Type | 104 | | ClassName | Name of the class | 105 | 106 | ## Remarks 107 | 108 | ### Implied Upper Bound is Nullable 109 | 110 | In Kotlin Generics, the upper bound of type parameter `T` would be `Any?`. Therefore for this class: 111 | 112 | ```kotlin 113 | class Consumer 114 | ``` 115 | 116 | The type parameter `T` is really `T: Any?`. To make a non-nullable upper bound, explicitly specific `T: Any`. For example: 117 | 118 | ```kotlin 119 | class Consumer 120 | ``` 121 | -------------------------------------------------------------------------------- /docs/languages/html/getting-started/introduction.md: -------------------------------------------------------------------------------- 1 | --- 2 | title: Introduction to HTML 3 | description: HTML stands for hypertext markup language used to create web pages using a markup language. HTML is the root language.... 4 | # image: "/img/docs/html/introduction-to-html.png" 5 | keywords: [coding, web development, html, introduction to html, what is html] 6 | sidebar_position: 1 7 | sidebar_label: Introduction to HTML 8 | slug: /html 9 | --- 10 | 11 | 12 | 13 | import DocCardList from '@theme/DocCardList'; 14 | import {useCurrentSidebarCategory} from '@docusaurus/theme-common'; 15 | import SocialShare from '@site/src/components/SocialShare'; 16 | 17 |
                          18 | Start Your Journey Now!🔥 19 |
                          20 |
                          Select Topic from below and start learning
                          21 |
                          22 |

                          ✅Getting Started with HTML

                          23 | - Introduction to HTML
                          24 | - Elements insight
                          25 | - Creating a Page
                          26 | - Breakdown of Page
                          27 | - Remarks
                          28 |
                          29 |

                          ✅Doctypes

                          30 | - Introduction to Doctypes
                          31 | - Adding the Doctype
                          32 | - HTML 5 Doctype
                          33 | - Remarks
                          34 |
                          35 |

                          ✅Headings

                          36 | - Introduction to Headings
                          37 | - Using Headings
                          38 | - Correct Structure Matters
                          39 | - Remarks
                          40 |
                          41 |

                          ✅Lists

                          42 | - Introduction to Lists
                          43 | - Ordered Lists
                          44 | - Unordered Lists
                          45 | - Nested Lists
                          46 | - Remarks
                          47 |
                          48 |
                          49 | 50 | 51 | 52 | 53 | 58 | 59 | 60 | 63 | 64 | 65 | 66 | ## Introduction 67 | 68 | [HTML](https://en.wikipedia.org/wiki/HTML) (**H**yper**t**ext **M**arkup **L**anguage) uses a markup system composed of elements which represent specific content. **Markup** means that with HTML you declare **what** is presented to a viewer, not **how** it is presented. Visual representations are defined by [Cascading Style Sheets (CSS)](https://en.wikipedia.org/wiki/CSS) and realized by browsers. [Still existing elements that allow for such](https://www.w3.org/TR/html5/obsolete.html#non-conforming-features), like e.g. [`font`](https://www.w3.org/wiki/HTML/Elements/font), "are entirely obsolete, and must not be used by authors". 69 | 70 | :::info 71 | HTML is sometimes called a programming language but it has no logic, so is a **markup language**. HTML tags provide semantic meaning and machine-readability to the content in the page. 72 | ::: 73 | 74 | An element usually consists of an opening tag (``), a closing tag (``), which contain the element's name surrounded by angle brackets, and the content in between: `...content...` 75 | 76 | There are some HTML elements that don't have a closing tag or any contents. These are called [void elements](https://stackoverflow.com/documentation/html/1449/void-elements). Void elements include ``, ``, `` and ``. 77 | 78 | Element names can be thought of as descriptive keywords for the content they contain, such as `video`, `audio`, `table`, `footer`. 79 | 80 | A HTML page may consist of potentially hundreds of elements which are then read by a web browser, interpreted and rendered into human readable or audible content on the screen. 81 | 82 | For this document it is important to note the difference between elements and tags: 83 | 84 | **Elements:** `video`, `audio`, `table`, `footer` 85 | 86 | **Tags:** `