mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-04 09:15:58 +02:00
style: auto format codebase
This commit is contained in:
@@ -13,7 +13,7 @@ export const ContainerWrapper = styled.div`
|
|||||||
|
|
||||||
// Offsets anchor links while taking the fixed header into consideration
|
// Offsets anchor links while taking the fixed header into consideration
|
||||||
[id]::before {
|
[id]::before {
|
||||||
content: '';
|
content: "";
|
||||||
display: block;
|
display: block;
|
||||||
height: 80px;
|
height: 80px;
|
||||||
margin-top: -80px;
|
margin-top: -80px;
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ export const HeaderWrapperSticky = styled.div`
|
|||||||
height: 74px;
|
height: 74px;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
z-index:1;
|
z-index: 1;
|
||||||
|
|
||||||
&::before {
|
&::before {
|
||||||
content: "";
|
content: "";
|
||||||
|
|||||||
@@ -3,34 +3,34 @@ import Prism from "prismjs"
|
|||||||
import type { Grammar } from "prismjs"
|
import type { Grammar } from "prismjs"
|
||||||
|
|
||||||
function supportsLookBehind() {
|
function supportsLookBehind() {
|
||||||
try {
|
try {
|
||||||
const lookbehindRegexp = new RegExp("(?<==)(.*)");
|
const lookbehindRegexp = new RegExp("(?<==)(.*)")
|
||||||
|
|
||||||
return lookbehindRegexp.test("=hello");
|
return lookbehindRegexp.test("=hello")
|
||||||
} catch(e) {
|
} catch (e) {
|
||||||
return false;
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function configurePrismJS() {
|
function configurePrismJS() {
|
||||||
const config: Grammar = {
|
const config: Grammar = {
|
||||||
property: {
|
property: {
|
||||||
pattern: /(.*.)(?==)/,
|
pattern: /(.*.)(?==)/,
|
||||||
},
|
},
|
||||||
operator: {
|
operator: {
|
||||||
pattern: /=/
|
pattern: /=/,
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
if (supportsLookBehind()) {
|
if (supportsLookBehind()) {
|
||||||
/* eslint-disable-next-line id-blacklist */
|
/* eslint-disable-next-line id-blacklist */
|
||||||
config.string = {
|
config.string = {
|
||||||
pattern: new RegExp("(?<==)(.*.)", "g"),
|
pattern: new RegExp("(?<==)(.*.)", "g"),
|
||||||
global: true,
|
global: true,
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Prism.languages.env = config;
|
Prism.languages.env = config
|
||||||
}
|
}
|
||||||
|
|
||||||
configurePrismJS();
|
configurePrismJS()
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import "prismjs/plugins/line-numbers/prism-line-numbers.css"
|
|||||||
import React, { FC, useEffect } from "react"
|
import React, { FC, useEffect } from "react"
|
||||||
import { MDXRenderer } from "gatsby-plugin-mdx"
|
import { MDXRenderer } from "gatsby-plugin-mdx"
|
||||||
import * as SC from "./styles"
|
import * as SC from "./styles"
|
||||||
import "./env";
|
import "./env"
|
||||||
|
|
||||||
interface IMarkdownProps {
|
interface IMarkdownProps {
|
||||||
content: string
|
content: string
|
||||||
@@ -31,9 +31,7 @@ export const Markdown: FC<IMarkdownProps> = ({ content, ...restProps }) => {
|
|||||||
Prism.highlightAll()
|
Prism.highlightAll()
|
||||||
}, [])
|
}, [])
|
||||||
return (
|
return (
|
||||||
<SC.MarkdownWrapper
|
<SC.MarkdownWrapper {...restProps}>
|
||||||
{...restProps}
|
|
||||||
>
|
|
||||||
<MDXRenderer>{content}</MDXRenderer>
|
<MDXRenderer>{content}</MDXRenderer>
|
||||||
</SC.MarkdownWrapper>
|
</SC.MarkdownWrapper>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -113,7 +113,6 @@ export const MarkdownWrapper = styled.div`
|
|||||||
letter-spacing: 0.25px;
|
letter-spacing: 0.25px;
|
||||||
color: #ebedee;
|
color: #ebedee;
|
||||||
font-family: "IBM Plex Mono", monospace;
|
font-family: "IBM Plex Mono", monospace;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
:not(pre) > code[class*="language-"],
|
:not(pre) > code[class*="language-"],
|
||||||
@@ -126,9 +125,9 @@ export const MarkdownWrapper = styled.div`
|
|||||||
pre > code[class*="language-"] {
|
pre > code[class*="language-"] {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
}
|
}
|
||||||
pre{
|
pre {
|
||||||
overflow-x: auto;
|
overflow-x: auto;
|
||||||
min-height:28px; /* to fix line-height causing Y overflow */
|
min-height: 28px; /* to fix line-height causing Y overflow */
|
||||||
}
|
}
|
||||||
img {
|
img {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ export const Box = styled.div`
|
|||||||
}
|
}
|
||||||
|
|
||||||
ul li + li {
|
ul li + li {
|
||||||
margin-top: 8px;
|
margin-top: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
a:not(.anchor) {
|
a:not(.anchor) {
|
||||||
@@ -53,8 +53,8 @@ export const Box = styled.div`
|
|||||||
props.theme.name === "dark" ? "#fff" : "#000"} !important;
|
props.theme.name === "dark" ? "#fff" : "#000"} !important;
|
||||||
font-weight: 400 !important;
|
font-weight: 400 !important;
|
||||||
background: none !important;
|
background: none !important;
|
||||||
border-bottom: 1px solid ${(props) =>
|
border-bottom: 1px solid
|
||||||
props.theme.name === "dark" ? "#fff" : "#000"};
|
${(props) => (props.theme.name === "dark" ? "#fff" : "#000")};
|
||||||
margin-bottom: 1px;
|
margin-bottom: 1px;
|
||||||
display: inline-flex;
|
display: inline-flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
@@ -79,7 +79,7 @@ export const Box = styled.div`
|
|||||||
/* I would prefer a svg, but could not get it to work */
|
/* I would prefer a svg, but could not get it to work */
|
||||||
background-image: url("${externalLink}");
|
background-image: url("${externalLink}");
|
||||||
filter: ${(props) =>
|
filter: ${(props) =>
|
||||||
props.theme.name === "dark" ? "invert(0%)" : "invert(100%)"} ;
|
props.theme.name === "dark" ? "invert(0%)" : "invert(100%)"};
|
||||||
background-size: 16px 16px;
|
background-size: 16px 16px;
|
||||||
width: 16px;
|
width: 16px;
|
||||||
height: 16px;
|
height: 16px;
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export const SidebarWrapper = styled.div`
|
|||||||
z-index: 100;
|
z-index: 100;
|
||||||
width: calc(100vw - 100px);
|
width: calc(100vw - 100px);
|
||||||
transition: transform 0.2s ease-in-out;
|
transition: transform 0.2s ease-in-out;
|
||||||
transform: translateX(-100vw)
|
transform: translateX(-100vw);
|
||||||
}
|
}
|
||||||
|
|
||||||
&.is-open {
|
&.is-open {
|
||||||
@@ -35,7 +35,7 @@ export const Header = styled(Link)`
|
|||||||
height: 74px; /* previously logo chose the height of the header */
|
height: 74px; /* previously logo chose the height of the header */
|
||||||
@media screen and (max-width: 767px) {
|
@media screen and (max-width: 767px) {
|
||||||
/* match mobile header height */
|
/* match mobile header height */
|
||||||
height:calc(35px + 32px);
|
height: calc(35px + 32px);
|
||||||
}
|
}
|
||||||
&:hover > * {
|
&:hover > * {
|
||||||
opacity: 0.85;
|
opacity: 0.85;
|
||||||
@@ -49,7 +49,6 @@ export const Logo = styled.div`
|
|||||||
background: #0b0f13;
|
background: #0b0f13;
|
||||||
height: 100%; /* match height of the header*/
|
height: 100%; /* match height of the header*/
|
||||||
flex: 0 0 74px;
|
flex: 0 0 74px;
|
||||||
|
|
||||||
`
|
`
|
||||||
|
|
||||||
export const StyledLogo = styled(TPHLogo)`
|
export const StyledLogo = styled(TPHLogo)`
|
||||||
|
|||||||
@@ -11,9 +11,7 @@ import * as SC from "./styles"
|
|||||||
|
|
||||||
const ALL_SPOTLIGHTS = graphql`
|
const ALL_SPOTLIGHTS = graphql`
|
||||||
query {
|
query {
|
||||||
spotlights: allFile(
|
spotlights: allFile(filter: { sourceInstanceName: { eq: "spotlights" } }) {
|
||||||
filter: { sourceInstanceName: { eq: "spotlights" } }
|
|
||||||
) {
|
|
||||||
edges {
|
edges {
|
||||||
node {
|
node {
|
||||||
relativePath
|
relativePath
|
||||||
@@ -42,7 +40,9 @@ function Tree({ item }: { item: IFileOrFolder }) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const SpotlightsSidebar: FC<HTMLAttributes<HTMLDivElement>> = (props) => {
|
export const SpotlightsSidebar: FC<HTMLAttributes<HTMLDivElement>> = (
|
||||||
|
props
|
||||||
|
) => {
|
||||||
const { spotlights } = useStaticQuery(ALL_SPOTLIGHTS)
|
const { spotlights } = useStaticQuery(ALL_SPOTLIGHTS)
|
||||||
const tree = useBuildTree(spotlights, "/spotlights")
|
const tree = useBuildTree(spotlights, "/spotlights")
|
||||||
const sortedTree = sort((a, b) => a.title.localeCompare(b.title), tree)
|
const sortedTree = sort((a, b) => a.title.localeCompare(b.title), tree)
|
||||||
|
|||||||
@@ -116,9 +116,9 @@ async function getCharacters() {
|
|||||||
|
|
||||||
// or, mixed
|
// or, mixed
|
||||||
async function getCharacters() {
|
async function getCharacters() {
|
||||||
const data = await fetch(
|
const data = await fetch(`https://rickandmortyapi.com/api/character`).then(
|
||||||
`https://rickandmortyapi.com/api/character`
|
(res) => res.json()
|
||||||
).then((res) => res.json());
|
);
|
||||||
return data.results;
|
return data.results;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -5,17 +5,17 @@ path: /bots
|
|||||||
This page details the bots you will see in our server.
|
This page details the bots you will see in our server.
|
||||||
Below are the bots you can interact with. There are other bots within the server, but they are strictly for usage by staff or are automatic in their nature. [Click here to jump to the passive bots](#passive-bots).
|
Below are the bots you can interact with. There are other bots within the server, but they are strictly for usage by staff or are automatic in their nature. [Click here to jump to the passive bots](#passive-bots).
|
||||||
|
|
||||||
|
|
||||||
## JudgeBot
|
## JudgeBot
|
||||||
|
|
||||||
**Description** Judgebot is our main moderation bot. If you receive any warnings or infractions, JudgeBot will be the one to DM you.
|
**Description** Judgebot is our main moderation bot. If you receive any warnings or infractions, JudgeBot will be the one to DM you.
|
||||||
|
|
||||||
Judgebot has a 50-point system. Each infraction gives you points, and points decay over time. Warnings give 5 points. Strikes typically give 10 but can give more in exceptional circumstances.
|
Judgebot has a 50-point system. Each infraction gives you points, and points decay over time. Warnings give 5 points. Strikes typically give 10 but can give more in exceptional circumstances.
|
||||||
- 10 points: 1-hour mute
|
|
||||||
- 20 points: 12-hour mute
|
- 10 points: 1-hour mute
|
||||||
- 30 points: 24-hour mute
|
- 20 points: 12-hour mute
|
||||||
- 40 points: 30-day mute
|
- 30 points: 24-hour mute
|
||||||
- 50 points: permanent ban
|
- 40 points: 30-day mute
|
||||||
|
- 50 points: permanent ban
|
||||||
|
|
||||||
**Source:** https://github.com/the-programmers-hangout/JudgeBot
|
**Source:** https://github.com/the-programmers-hangout/JudgeBot
|
||||||
|
|
||||||
@@ -27,7 +27,6 @@ Judgebot has a 50-point system. Each infraction gives you points, and points dec
|
|||||||
|
|
||||||
`:stop_sign:` - Reacting to a message with this emote will alert staff to it. Use it if you see any potentially rule breaking content.
|
`:stop_sign:` - Reacting to a message with this emote will alert staff to it. Use it if you see any potentially rule breaking content.
|
||||||
|
|
||||||
|
|
||||||
## Aura
|
## Aura
|
||||||
|
|
||||||
**Description:** Aura bot will hand out karma to users that earn it. Giving karma is as simple as mentioning (tagging) a user and thanking them in the same message.
|
**Description:** Aura bot will hand out karma to users that earn it. Giving karma is as simple as mentioning (tagging) a user and thanking them in the same message.
|
||||||
@@ -50,7 +49,6 @@ Judgebot has a 50-point system. Each infraction gives you points, and points dec
|
|||||||
|
|
||||||
`karma!reactions` - Details the reactions that Aura can add to messages.
|
`karma!reactions` - Details the reactions that Aura can add to messages.
|
||||||
|
|
||||||
|
|
||||||
## DocsBot
|
## DocsBot
|
||||||
|
|
||||||
**Description:** DocsBot can retrieve documentation for discord.js
|
**Description:** DocsBot can retrieve documentation for discord.js
|
||||||
@@ -87,8 +85,6 @@ Judgebot has a 50-point system. Each infraction gives you points, and points dec
|
|||||||
|
|
||||||
`tph!userinfo` - Displays info for a user.
|
`tph!userinfo` - Displays info for a user.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Keeper
|
## Keeper
|
||||||
|
|
||||||
**Description:** Keeper is a bot that allows you to bookmark messages by adding the `:bookmark:` emote reaction to a message.
|
**Description:** Keeper is a bot that allows you to bookmark messages by adding the `:bookmark:` emote reaction to a message.
|
||||||
@@ -101,8 +97,6 @@ Judgebot has a 50-point system. Each infraction gives you points, and points dec
|
|||||||
|
|
||||||
N/A
|
N/A
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## ModMail
|
## ModMail
|
||||||
|
|
||||||
**Description:** This bot lets you privately contact the staff team. DM it to start a discussion!
|
**Description:** This bot lets you privately contact the staff team. DM it to start a discussion!
|
||||||
@@ -111,8 +105,6 @@ N/A
|
|||||||
|
|
||||||
**Usage:** All you need to do is send a message. We'll see any edits you make to your message too!
|
**Usage:** All you need to do is send a message. We'll see any edits you make to your message too!
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Mimic
|
## Mimic
|
||||||
|
|
||||||
**Description:** Mimic is a bot that talks like you! If you opt-in it will save your messages and build markov chains in order to generate sentences that mimic how you and other users type!
|
**Description:** Mimic is a bot that talks like you! If you opt-in it will save your messages and build markov chains in order to generate sentences that mimic how you and other users type!
|
||||||
@@ -145,8 +137,6 @@ N/A
|
|||||||
|
|
||||||
`mimic!stats` - Display statistics of your messages
|
`mimic!stats` - Display statistics of your messages
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Polly
|
## Polly
|
||||||
|
|
||||||
**Description:** Polly is our macro bot.
|
**Description:** Polly is our macro bot.
|
||||||
@@ -181,7 +171,7 @@ N/A
|
|||||||
|
|
||||||
`++imageofcode` - Images of code can be really hard to read, let people know they should post the code as text instead.
|
`++imageofcode` - Images of code can be really hard to read, let people know they should post the code as text instead.
|
||||||
|
|
||||||
`++noresearch` - Research is an important part of programming. Encourage people to research *then* ask! Ask them what they found if anything.
|
`++noresearch` - Research is an important part of programming. Encourage people to research _then_ ask! Ask them what they found if anything.
|
||||||
|
|
||||||
`++patience` - Remind users not to pester others in channels.
|
`++patience` - Remind users not to pester others in channels.
|
||||||
|
|
||||||
@@ -191,8 +181,6 @@ N/A
|
|||||||
|
|
||||||
`++wrapmini` - Instruct a user to wrap their code.
|
`++wrapmini` - Instruct a user to wrap their code.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## ReWizard
|
## ReWizard
|
||||||
|
|
||||||
**Description:** ReWizard is a utility bot for regex. It can find, replace, split, and test regular expressions.
|
**Description:** ReWizard is a utility bot for regex. It can find, replace, split, and test regular expressions.
|
||||||
@@ -215,8 +203,6 @@ N/A
|
|||||||
|
|
||||||
`re!valid` - Tests whether the given regex is valid.
|
`re!valid` - Tests whether the given regex is valid.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## StandupBot
|
## StandupBot
|
||||||
|
|
||||||
**Description:** StandupBot is a bot that controls the standup channel. It enforces a strict message format. Once you have successfully sent a message you will no longer be able to post in the standup channel for 20 hours.
|
**Description:** StandupBot is a bot that controls the standup channel. It enforces a strict message format. Once you have successfully sent a message you will no longer be able to post in the standup channel for 20 hours.
|
||||||
@@ -229,7 +215,6 @@ N/A
|
|||||||
|
|
||||||
N/A
|
N/A
|
||||||
|
|
||||||
|
|
||||||
## SuggestionBot
|
## SuggestionBot
|
||||||
|
|
||||||
**Description:** SuggestionBot manages suggestions for the server. Send in your suggestion and we can put it to a vote!
|
**Description:** SuggestionBot manages suggestions for the server. Send in your suggestion and we can put it to a vote!
|
||||||
@@ -242,8 +227,6 @@ N/A
|
|||||||
|
|
||||||
`s!suggest your suggest message here` - Send in your suggestion message
|
`s!suggest your suggest message here` - Send in your suggestion message
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Passive bots
|
## Passive bots
|
||||||
|
|
||||||
Below are the bots you will see in the server but you will not need to interact with them. They automatically do their job!
|
Below are the bots you will see in the server but you will not need to interact with them. They automatically do their job!
|
||||||
@@ -254,70 +237,54 @@ Below are the bots you will see in the server but you will not need to interact
|
|||||||
|
|
||||||
**Source:** https://github.com/itsHobbes/clerky
|
**Source:** https://github.com/itsHobbes/clerky
|
||||||
|
|
||||||
|
|
||||||
## EmbedBot
|
## EmbedBot
|
||||||
|
|
||||||
**Description:** EmbedBot allows staff to manage and post embed messages into various channels.
|
**Description:** EmbedBot allows staff to manage and post embed messages into various channels.
|
||||||
|
|
||||||
**Source:** https://github.com/JakeJMattson/EmbedBot
|
**Source:** https://github.com/JakeJMattson/EmbedBot
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Emourge
|
## Emourge
|
||||||
|
|
||||||
**Description:** Emourge tracks emote usage. We use this to help us identify the least used emotes incase we want to add some new ones!
|
**Description:** Emourge tracks emote usage. We use this to help us identify the least used emotes incase we want to add some new ones!
|
||||||
|
|
||||||
**Source:** https://github.com/dfireBird/emourge-mongo
|
**Source:** https://github.com/dfireBird/emourge-mongo
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Hawk
|
## Hawk
|
||||||
|
|
||||||
**Description:** Hawk manages nickname prefixes & suffixes. It adds 🔨 to staff nicks and organises the occasional nick party!
|
**Description:** Hawk manages nickname prefixes & suffixes. It adds 🔨 to staff nicks and organises the occasional nick party!
|
||||||
|
|
||||||
**Source:** https://github.com/the-programmers-hangout/Hawk
|
**Source:** https://github.com/the-programmers-hangout/Hawk
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Nano
|
## Nano
|
||||||
|
|
||||||
**Description:** Nano manages our AMAs. Whenever someone is accepted for an AMA, we'll give them a run down of how it works.
|
**Description:** Nano manages our AMAs. Whenever someone is accepted for an AMA, we'll give them a run down of how it works.
|
||||||
|
|
||||||
**Source:** https://github.com/the-programmers-hangout/Nano
|
**Source:** https://github.com/the-programmers-hangout/Nano
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## RaffleBot
|
## RaffleBot
|
||||||
|
|
||||||
**Description:** RaffleBot is a discord bot built originally for The Programmer's Hangout that focuses on managing giveaways.
|
**Description:** RaffleBot is a discord bot built originally for The Programmer's Hangout that focuses on managing giveaways.
|
||||||
|
|
||||||
**Source:** https://github.com/Abzylicious/RaffleBot
|
**Source:** https://github.com/Abzylicious/RaffleBot
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Skadi
|
## Skadi
|
||||||
|
|
||||||
**Description:** Skadi manages activity roles on the server.
|
**Description:** Skadi manages activity roles on the server.
|
||||||
|
|
||||||
**Source:** This source isn't publicly available. We don't want people trying to game the system.
|
**Source:** This source isn't publicly available. We don't want people trying to game the system.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Slothbot
|
## Slothbot
|
||||||
|
|
||||||
**Description:** Slothbot manages slowmode across the server.
|
**Description:** Slothbot manages slowmode across the server.
|
||||||
|
|
||||||
**Source:** https://github.com/the-programmers-hangout/slothbot
|
**Source:** https://github.com/the-programmers-hangout/slothbot
|
||||||
|
|
||||||
|
|
||||||
## Taboo
|
## Taboo
|
||||||
|
|
||||||
**Description:** Taboo makes sure only accepted file formats are uploaded.
|
**Description:** Taboo makes sure only accepted file formats are uploaded.
|
||||||
|
|
||||||
**Source:** https://github.com/the-programmers-hangout/Taboo
|
**Source:** https://github.com/the-programmers-hangout/Taboo
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## Watchdog
|
## Watchdog
|
||||||
|
|
||||||
**Description:** Watchdog guards the gates of our server against raids and bots.
|
**Description:** Watchdog guards the gates of our server against raids and bots.
|
||||||
|
|||||||
@@ -46,7 +46,6 @@ If you get annoyed that you don't have your name and make a big deal out of it,
|
|||||||
|
|
||||||
The Programmer's Hangout has an [organisation on GitHub](https://github.com/the-programmers-hangout) and the best part is that you can join it too! To get yourself added to the organisation, send your GitHub username to the moderators via @ModMail#8255 and you'll be invited to the organisation. You even get a cool little badge on your GitHub profile!
|
The Programmer's Hangout has an [organisation on GitHub](https://github.com/the-programmers-hangout) and the best part is that you can join it too! To get yourself added to the organisation, send your GitHub username to the moderators via @ModMail#8255 and you'll be invited to the organisation. You even get a cool little badge on your GitHub profile!
|
||||||
|
|
||||||
|
|
||||||
## How do I appeal my ban?
|
## How do I appeal my ban?
|
||||||
|
|
||||||
We accept ban appeals 30 days after the initial ban date. You can appeal your ban through [this google form.](https://forms.gle/TZEmvxnMbVNfCe4o7)
|
We accept ban appeals 30 days after the initial ban date. You can appeal your ban through [this google form.](https://forms.gle/TZEmvxnMbVNfCe4o7)
|
||||||
@@ -9,16 +9,14 @@ title: What is Ansible?
|
|||||||
|
|
||||||
Ansible is an open-source software provisioning, configuration management, and application deployment tool enabling Infrastructure as code. It handles configuration management, application deployment, cloud provisioning, ad-hoc task execution, network automation, and multi-node orchestration.
|
Ansible is an open-source software provisioning, configuration management, and application deployment tool enabling Infrastructure as code. It handles configuration management, application deployment, cloud provisioning, ad-hoc task execution, network automation, and multi-node orchestration.
|
||||||
|
|
||||||
|
|
||||||
## What are the advantages of Ansible over other configuration management tools such as Chef or cfengine?
|
## What are the advantages of Ansible over other configuration management tools such as Chef or cfengine?
|
||||||
|
|
||||||
A big problem with other configuration management systems was that they relied on an agent to manage their systems, this creates a new problem of "managing the management" because the agents must be bootstrapped and kept updated which adds complexity. Ansible however is agentless. Ansible takes advantage of existing remote management systems like ssh and winrm to do it’s execution and not require managing another agent. While incoming ssh and winrm are never enabled by default in these operating systems, ansible is also a provisioning tool, which means it can provision systems with those two enabled. Rules can be set to ensure restarting these daemons if they crash, or restoring the state of the system in case ansible can’t reach them, further reducing the need of human intervention.
|
A big problem with other configuration management systems was that they relied on an agent to manage their systems, this creates a new problem of "managing the management" because the agents must be bootstrapped and kept updated which adds complexity. Ansible however is agentless. Ansible takes advantage of existing remote management systems like ssh and winrm to do it’s execution and not require managing another agent. While incoming ssh and winrm are never enabled by default in these operating systems, ansible is also a provisioning tool, which means it can provision systems with those two enabled. Rules can be set to ensure restarting these daemons if they crash, or restoring the state of the system in case ansible can’t reach them, further reducing the need of human intervention.
|
||||||
|
|
||||||
Another important advantage of ansible over chef is the “source of truth”. Ansible uses "playbooks" which are the set of instructions to be performed, that act as the source of truth. These playbooks can be stored in git and allow ansible to fetch them directly from the git server as required providing all the advantages of Infrastructure as Code. With other configuration management tools such as Chef, you have to upload the “cookbooks” to one of the Chef Servers, and there is no straightforward way of making sure they stay consistent.
|
Another important advantage of ansible over chef is the “source of truth”. Ansible uses "playbooks" which are the set of instructions to be performed, that act as the source of truth. These playbooks can be stored in git and allow ansible to fetch them directly from the git server as required providing all the advantages of Infrastructure as Code. With other configuration management tools such as Chef, you have to upload the “cookbooks” to one of the Chef Servers, and there is no straightforward way of making sure they stay consistent.
|
||||||
|
|
||||||
Another big advantage Ansible has over other Configuration Management systems is the ability to use dynamic inventory. With Chef, for example, you have to manually configure what system is being managed by Chef. With Ansible, you can poll data from an external source. This external source can be a system managed by Ansible itself, with ansible itself providing the data for when a new system is provisioned in the private or public cloud, making ansible self-reliant.
|
Another big advantage Ansible has over other Configuration Management systems is the ability to use dynamic inventory. With Chef, for example, you have to manually configure what system is being managed by Chef. With Ansible, you can poll data from an external source. This external source can be a system managed by Ansible itself, with ansible itself providing the data for when a new system is provisioned in the private or public cloud, making ansible self-reliant.
|
||||||
|
|
||||||
|
|
||||||
## Why use Ansible when I can just use bash & perl?
|
## Why use Ansible when I can just use bash & perl?
|
||||||
|
|
||||||
Ansible provides five major advantages to using bash & perl.
|
Ansible provides five major advantages to using bash & perl.
|
||||||
@@ -33,22 +31,24 @@ Ansible provides five major advantages to using bash & perl.
|
|||||||
|
|
||||||
**5.** Ansible comes with the ultimate oh shit button. Paid support.
|
**5.** Ansible comes with the ultimate oh shit button. Paid support.
|
||||||
|
|
||||||
|
|
||||||
## How do I get ansible?
|
## How do I get ansible?
|
||||||
|
|
||||||
You can get Ansible as a control node on most major platforms except Windows. Windows can be managed by Ansible, but it cannot be a control node.
|
You can get Ansible as a control node on most major platforms except Windows. Windows can be managed by Ansible, but it cannot be a control node.
|
||||||
|
|
||||||
On Fedora:
|
On Fedora:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ sudo dnf install ansible
|
$ sudo dnf install ansible
|
||||||
```
|
```
|
||||||
|
|
||||||
On RHEL/CentOS:
|
On RHEL/CentOS:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ sudo yum install ansible
|
$ sudo yum install ansible
|
||||||
```
|
```
|
||||||
|
|
||||||
On Ubuntu:
|
On Ubuntu:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ sudo apt update
|
$ sudo apt update
|
||||||
$ sudo apt install software-properties-common
|
$ sudo apt install software-properties-common
|
||||||
@@ -57,11 +57,13 @@ $ sudo apt install ansible
|
|||||||
```
|
```
|
||||||
|
|
||||||
On Gentoo:
|
On Gentoo:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ merge -av app-admin/ansible
|
$ merge -av app-admin/ansible
|
||||||
```
|
```
|
||||||
|
|
||||||
On FreeBSD:
|
On FreeBSD:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ sudo pkg install py36-ansible
|
$ sudo pkg install py36-ansible
|
||||||
```
|
```
|
||||||
@@ -71,12 +73,15 @@ Instructions to install on other targets can be found on https://docs.ansible.co
|
|||||||
## How do I use ansible?
|
## How do I use ansible?
|
||||||
|
|
||||||
Running an ansible playbook is simple.
|
Running an ansible playbook is simple.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ ansible -i inventory playbook.yml
|
$ ansible -i inventory playbook.yml
|
||||||
```
|
```
|
||||||
|
|
||||||
`-i` is to give the inventory, or the hosts where this playbook would run. This file contains the hostname/ip of the machine.
|
`-i` is to give the inventory, or the hosts where this playbook would run. This file contains the hostname/ip of the machine.
|
||||||
|
|
||||||
An example inventory file:
|
An example inventory file:
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
[all:vars]
|
[all:vars]
|
||||||
ansible_user=tph_admin
|
ansible_user=tph_admin
|
||||||
@@ -118,6 +123,7 @@ Inventory = /path/to/inventory
|
|||||||
```
|
```
|
||||||
|
|
||||||
This simplifies your commands a little. Now you can do things such as:
|
This simplifies your commands a little. Now you can do things such as:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ ansible web --list-hosts
|
$ ansible web --list-hosts
|
||||||
$ ansible web, ansible --lists-hosts
|
$ ansible web, ansible --lists-hosts
|
||||||
@@ -152,6 +158,7 @@ Sometimes modules might not exist for your command. Maybe you are using a custom
|
|||||||
```sh
|
```sh
|
||||||
$ ansible node1 -m command -a “ping”
|
$ ansible node1 -m command -a “ping”
|
||||||
```
|
```
|
||||||
|
|
||||||
In this case command is a module and `-a` is followed by the command that will be run.
|
In this case command is a module and `-a` is followed by the command that will be run.
|
||||||
|
|
||||||
## Examples of Ansible Playbooks
|
## Examples of Ansible Playbooks
|
||||||
@@ -186,6 +193,7 @@ $ ansible-playbook --syntax-check playbook.yml
|
|||||||
In fact, that playbook is incorrect. Run that command to see where it’s incorrect!
|
In fact, that playbook is incorrect. Run that command to see where it’s incorrect!
|
||||||
|
|
||||||
Then you can run it using:
|
Then you can run it using:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ ansible-playbook playbook.yml
|
$ ansible-playbook playbook.yml
|
||||||
```
|
```
|
||||||
@@ -202,17 +210,17 @@ A playbook to ensure certain users are present in a node.
|
|||||||
become: true
|
become: true
|
||||||
|
|
||||||
tasks:
|
tasks:
|
||||||
- name: Ensure three users are present
|
- name: Ensure three users are present
|
||||||
user:
|
user:
|
||||||
name: “{{ whatver_name_you_want_this_to_be }}”
|
name: “{{ whatver_name_you_want_this_to_be }}”
|
||||||
state: present
|
state: present
|
||||||
loop:
|
loop: dev_user
|
||||||
dev_user
|
qa_user
|
||||||
qa_user
|
prod_user
|
||||||
prod_user
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Create a VM on vsphere ESXi from a template.
|
Create a VM on vsphere ESXi from a template.
|
||||||
|
|
||||||
```yml
|
```yml
|
||||||
---
|
---
|
||||||
- name: Create a VM from a template
|
- name: Create a VM from a template
|
||||||
@@ -220,21 +228,20 @@ Create a VM on vsphere ESXi from a template.
|
|||||||
connection: local
|
connection: local
|
||||||
gather_facts: no
|
gather_facts: no
|
||||||
tasks:
|
tasks:
|
||||||
- name: Clone the template
|
- name: Clone the template
|
||||||
vmware_guest:
|
vmware_guest:
|
||||||
hostname: 192.0.2.44
|
hostname: 192.0.2.44
|
||||||
username: [email protected]
|
username: [email protected]
|
||||||
password: vmware
|
password: vmware
|
||||||
validate_certs: False
|
validate_certs: False
|
||||||
name: testvm_2
|
name: testvm_2
|
||||||
template: template_el7
|
template: template_el7
|
||||||
datacenter: DC1
|
datacenter: DC1
|
||||||
folder: /DC1/vm
|
folder: /DC1/vm
|
||||||
state: poweredon
|
state: poweredon
|
||||||
wait_for_ip_address: yes
|
wait_for_ip_address: yes
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
These are very simple playbooks. However you can go beyond and do wonders. At my workplace we have a playbook that checks the make of storage nodes we sell, then determines what version of esxi we support on it, and starts the work to set up initial storage volume pools. It then starts migrating data from customer’s old pools to our own pools. If for some reason it fails, and it is not the customer’s fault (invalid input for example), it writes an email with all the logs and sends it to the customer’s representative in our company, who upon getting the email, calls the customer and starts troubleshooting things with them.
|
These are very simple playbooks. However you can go beyond and do wonders. At my workplace we have a playbook that checks the make of storage nodes we sell, then determines what version of esxi we support on it, and starts the work to set up initial storage volume pools. It then starts migrating data from customer’s old pools to our own pools. If for some reason it fails, and it is not the customer’s fault (invalid input for example), it writes an email with all the logs and sends it to the customer’s representative in our company, who upon getting the email, calls the customer and starts troubleshooting things with them.
|
||||||
We also have a playbook that we use for provisioning virtual storage clusters on KVM, ESXi, Xen and HyperV, runs stress tests against them to ensure the software is working properly, and then goes ahead to use PXE Boot on 15 racks of physical hardware located all over the country to install the new software, including two racks stored in high temperature and low temperature conditions and run the same set of stress tests to ensure it works on Physical hardware as well.
|
We also have a playbook that we use for provisioning virtual storage clusters on KVM, ESXi, Xen and HyperV, runs stress tests against them to ensure the software is working properly, and then goes ahead to use PXE Boot on 15 racks of physical hardware located all over the country to install the new software, including two racks stored in high temperature and low temperature conditions and run the same set of stress tests to ensure it works on Physical hardware as well.
|
||||||
|
|
||||||
|
|||||||
@@ -12,18 +12,20 @@ Clojure is a dynamically typed high level lisp designed with interactive develop
|
|||||||
|
|
||||||
## Clojure features
|
## Clojure features
|
||||||
|
|
||||||
* Immutability by default: on creation, you cannot change the value of a variable or data structure. this has a few benefits: you know the value of the variable at any point, references can be shared safely as they don't usually modify the value, and of course it is great for concurrency as shared mutable state is minimised.
|
- Immutability by default: on creation, you cannot change the value of a variable or data structure. this has a few benefits: you know the value of the variable at any point, references can be shared safely as they don't usually modify the value, and of course it is great for concurrency as shared mutable state is minimised.
|
||||||
* Immutable persistent data structures: data structures that cannot be changed after creation, that preserves previous versions. This type of data structure will use a set of core functions to modify and yield a new updated version, and as they are immutable previous versions can be re-used between data structures, so they are not incredibly memory inefficient.
|
- Immutable persistent data structures: data structures that cannot be changed after creation, that preserves previous versions. This type of data structure will use a set of core functions to modify and yield a new updated version, and as they are immutable previous versions can be re-used between data structures, so they are not incredibly memory inefficient.
|
||||||
* Host platform interoperability: a major downside to many great languages is the lack of libraries that will attract a userbase and promote development in the language. Luckily for us, this is not the case with Clojure as the language is made to be fully interoperable with the host machine languages, so you can use Java libraries in JVM targetted Clojure code, .NET libraries in CLR targetted code and JS libraries and frameworks in ClojureScript. The benefits of this are immeasurable and allow so much more freedom when using Clojure.
|
- Host platform interoperability: a major downside to many great languages is the lack of libraries that will attract a userbase and promote development in the language. Luckily for us, this is not the case with Clojure as the language is made to be fully interoperable with the host machine languages, so you can use Java libraries in JVM targetted Clojure code, .NET libraries in CLR targetted code and JS libraries and frameworks in ClojureScript. The benefits of this are immeasurable and allow so much more freedom when using Clojure.
|
||||||
* Java: the main Clojure compiler targets the JVM, and allows programmers to use any Java libraries (or even other JVM language libraries) to harness the full potential of Clojure. There is the option to use the libraries directly, for example JavaFX, or using a Clojure wrapper for the library, such as CLJFX, which can make interop code more idiomatic.
|
- Java: the main Clojure compiler targets the JVM, and allows programmers to use any Java libraries (or even other JVM language libraries) to harness the full potential of Clojure. There is the option to use the libraries directly, for example JavaFX, or using a Clojure wrapper for the library, such as CLJFX, which can make interop code more idiomatic.
|
||||||
* .NET: Clojure has a ported compiler called clojure-clr, which targets the .NET runtime. This allows programmers to use C# and other .NET libraries, including OpenGL. Although this port is not as used, it is still relatively similar to the main compiler.
|
- .NET: Clojure has a ported compiler called clojure-clr, which targets the .NET runtime. This allows programmers to use C# and other .NET libraries, including OpenGL. Although this port is not as used, it is still relatively similar to the main compiler.
|
||||||
* ClojureScript: this is a Clojure compiler targetting JavaScript, again with full interoperability with JS, allowing web apps and websites to be built in Clojure. This compiler uses the Google Closure Optimizing Compiler, meaning that the JavaScript code produced is very efficient and performant. There are many wrappers for JS frameworks and libraries, such as Reagent (a minimalistic React interface).
|
- ClojureScript: this is a Clojure compiler targetting JavaScript, again with full interoperability with JS, allowing web apps and websites to be built in Clojure. This compiler uses the Google Closure Optimizing Compiler, meaning that the JavaScript code produced is very efficient and performant. There are many wrappers for JS frameworks and libraries, such as Reagent (a minimalistic React interface).
|
||||||
* Concurrency models:
|
- Concurrency models:
|
||||||
* Software Transactional Memory and Atoms: Clojure has atoms built into the language, which are what store a state. STM will make a copy of the global variable being modified or referred to, and allow any operations to be performed on said data. After the changes are made the global variable is checked for any changes since the copy was made, and if the original copy and new copy are identical, the global is updated. Otherwise, the current changes are discarded, a new copy of the global is obtained and this process repeats. A key point is to not perform side effects with atomic changes.
|
- Software Transactional Memory and Atoms: Clojure has atoms built into the language, which are what store a state. STM will make a copy of the global variable being modified or referred to, and allow any operations to be performed on said data. After the changes are made the global variable is checked for any changes since the copy was made, and if the original copy and new copy are identical, the global is updated. Otherwise, the current changes are discarded, a new copy of the global is obtained and this process repeats. A key point is to not perform side effects with atomic changes.
|
||||||
* Asynchronous Agents: Clojure also has another concurrency model, using agents that are bound to a single location for their lifetime, and require an action to mutate its the location to a new state. An agent should have an immutable state, and will be able to be read without coordination. An action will be dispatched by a send function which will return, and then later on the action (which is a function) will be applied to the agent's state. The return value of this function will be sent to be validated, and if validation succeeds or there is no validator, the agent's state will be updated, and any watchers will be notified. Any other actions dispatched later will be added to the action queue to be applied once the agent's state has changed.
|
- Asynchronous Agents: Clojure also has another concurrency model, using agents that are bound to a single location for their lifetime, and require an action to mutate its the location to a new state. An agent should have an immutable state, and will be able to be read without coordination. An action will be dispatched by a send function which will return, and then later on the action (which is a function) will be applied to the agent's state. The return value of this function will be sent to be validated, and if validation succeeds or there is no validator, the agent's state will be updated, and any watchers will be notified. Any other actions dispatched later will be added to the action queue to be applied once the agent's state has changed.
|
||||||
* Lazy sequences: lazy sequences are a feature that allows element evaluation to be deferred by computing the sequence at runtime, which allows infinitely long sequences to be created with little overhead, with the option to forcefully evaluate elements if required.
|
- Lazy sequences: lazy sequences are a feature that allows element evaluation to be deferred by computing the sequence at runtime, which allows infinitely long sequences to be created with little overhead, with the option to forcefully evaluate elements if required.
|
||||||
⠀
|
⠀
|
||||||
|
|
||||||
## Tools
|
## Tools
|
||||||
|
|
||||||
Clojure has many different tools that make it an amazing language to work with, the most prominent of these being the REPL. The Clojure compiler already comes with a REPL built in, but there are also others, such as nREPLs (network REPLs) and socket REPLS. More about those here: https://lambdaisland.com/guides/clojure-repls/clojure-repls#org44377fd
|
Clojure has many different tools that make it an amazing language to work with, the most prominent of these being the REPL. The Clojure compiler already comes with a REPL built in, but there are also others, such as nREPLs (network REPLs) and socket REPLS. More about those here: https://lambdaisland.com/guides/clojure-repls/clojure-repls#org44377fd
|
||||||
|
|
||||||
As for editors and extensions, there is CIDER, which is an Emacs IDE for Clojure supporting interactive REPL development via nREPLs, debugging, testing, docs lookup and more. There is also a similar environment called CALVA for visual studio code, which includes inline code evaluation, structural editing, intellisense and more. See these links: https://github.com/BetterThanTomorrow/calva https://github.com/clojure-emacs/cider
|
As for editors and extensions, there is CIDER, which is an Emacs IDE for Clojure supporting interactive REPL development via nREPLs, debugging, testing, docs lookup and more. There is also a similar environment called CALVA for visual studio code, which includes inline code evaluation, structural editing, intellisense and more. See these links: https://github.com/BetterThanTomorrow/calva https://github.com/clojure-emacs/cider
|
||||||
@@ -31,6 +33,7 @@ As for editors and extensions, there is CIDER, which is an Emacs IDE for Clojure
|
|||||||
Now there are many more tools and libraries for Clojure which are included in this handy toolbox website: https://www.clojure-toolbox.com/
|
Now there are many more tools and libraries for Clojure which are included in this handy toolbox website: https://www.clojure-toolbox.com/
|
||||||
|
|
||||||
## Code Examples
|
## Code Examples
|
||||||
|
|
||||||
```clj
|
```clj
|
||||||
Hello World 1
|
Hello World 1
|
||||||
(println "Hello World")
|
(println "Hello World")
|
||||||
@@ -51,7 +54,8 @@ Further code examples:
|
|||||||
https://pastecord.com/ukycegasab.clj
|
https://pastecord.com/ukycegasab.clj
|
||||||
|
|
||||||
## Resources
|
## Resources
|
||||||
* Getting started: https://clojure.org/guides/getting_started
|
|
||||||
* Special characters: https://clojure.org/guides/weird_characters
|
- Getting started: https://clojure.org/guides/getting_started
|
||||||
* Community docs: https://clojuredocs.org/
|
- Special characters: https://clojure.org/guides/weird_characters
|
||||||
* Libraries: https://clojure.org/community/libraries
|
- Community docs: https://clojuredocs.org/
|
||||||
|
- Libraries: https://clojure.org/community/libraries
|
||||||
|
|||||||
@@ -7,49 +7,54 @@ title: What is Deno?
|
|||||||
---
|
---
|
||||||
|
|
||||||
## What is Deno?
|
## What is Deno?
|
||||||
|
|
||||||
Deno is a modern and secure runtime, and toolchain for JavaScript and TypeScript. It uses V8 and is built in Rust.
|
Deno is a modern and secure runtime, and toolchain for JavaScript and TypeScript. It uses V8 and is built in Rust.
|
||||||
|
|
||||||
## History
|
## History
|
||||||
|
|
||||||
Deno was created by Ryan Dahl, the creator of Node.js to fix some of his regrets with the now over a decade old javascript runtime which can be found in his talk: '10 Things I Regret About Node.js' <https://www.youtube.com/watch?v=M3BM9TB-8yA>
|
Deno was created by Ryan Dahl, the creator of Node.js to fix some of his regrets with the now over a decade old javascript runtime which can be found in his talk: '10 Things I Regret About Node.js' <https://www.youtube.com/watch?v=M3BM9TB-8yA>
|
||||||
|
|
||||||
## What benefits does Deno have?
|
## What benefits does Deno have?
|
||||||
* TypeScript support out of the box.
|
|
||||||
* Support for Inbuilt tooling which is available without configuring or installing anything:
|
- TypeScript support out of the box.
|
||||||
* Format
|
- Support for Inbuilt tooling which is available without configuring or installing anything:
|
||||||
* Test
|
- Format
|
||||||
* Lint
|
- Test
|
||||||
* Bundle
|
- Lint
|
||||||
* Compile
|
- Bundle
|
||||||
* Generate documentation
|
- Compile
|
||||||
* Browser compatibility through support for ES modules and Web APIs; which makes it easy to pick up.
|
- Generate documentation
|
||||||
* Secure sandbox, access to the filesystem, environment or the network has to be explicitly given.
|
- Browser compatibility through support for ES modules and Web APIs; which makes it easy to pick up.
|
||||||
* No node_modules folder. Dependencies are declared as direct urls. All dependencies are fetched, compiled, and stored in a centralized DENO_DIR folder.
|
- Secure sandbox, access to the filesystem, environment or the network has to be explicitly given.
|
||||||
* Explicit import mechanism makes the module system more robust and easy to use.
|
- No node_modules folder. Dependencies are declared as direct urls. All dependencies are fetched, compiled, and stored in a centralized DENO_DIR folder.
|
||||||
* Modular and easily extendable.
|
- Explicit import mechanism makes the module system more robust and easy to use.
|
||||||
* Focuses on embeddable architecture.
|
- Modular and easily extendable.
|
||||||
* Standard library which is available at <https://deno.land/std@0.97.0>
|
- Focuses on embeddable architecture.
|
||||||
* Faster HTTP, TypeScript compile time and common tooling. Say goodbye to long CI times.
|
- Standard library which is available at <https://deno.land/std@0.97.0>
|
||||||
|
- Faster HTTP, TypeScript compile time and common tooling. Say goodbye to long CI times.
|
||||||
|
|
||||||
## Architecture
|
## Architecture
|
||||||
|
|
||||||
Unlike node, deno is built to be modular and is a collection of rust crates. These crates can be tested, used, and worked on independently.
|
Unlike node, deno is built to be modular and is a collection of rust crates. These crates can be tested, used, and worked on independently.
|
||||||
|
|
||||||
* Rusty_v8 provides zero-cost rust bindings to v8.
|
- Rusty_v8 provides zero-cost rust bindings to v8.
|
||||||
* Deno_core contains:
|
- Deno_core contains:
|
||||||
* ES module loading infrastructure.
|
- ES module loading infrastructure.
|
||||||
* JsRuntime which can be used with an event loop implementation. This is a single execution context for javascript.
|
- JsRuntime which can be used with an event loop implementation. This is a single execution context for javascript.
|
||||||
* Resource table infrastructure. A resource is similar to a file descriptor. They are integers that are allocated by the privileged side of Deno which refer to various rust objects that need to be persisted between ops.
|
- Resource table infrastructure. A resource is similar to a file descriptor. They are integers that are allocated by the privileged side of Deno which refer to various rust objects that need to be persisted between ops.
|
||||||
* Ops interface (Deno’s operating system bindings) to bind rust functions to the javascript side. This centralized binding interface allows you to monitor global metrics and state reliably.
|
- Ops interface (Deno’s operating system bindings) to bind rust functions to the javascript side. This centralized binding interface allows you to monitor global metrics and state reliably.
|
||||||
* Extension interface.
|
- Extension interface.
|
||||||
* Deno_runtime is built on deno core and contains ops to implement the Deno namespace (APIs for FS, I/O, net tcp/udp and similar).
|
- Deno_runtime is built on deno core and contains ops to implement the Deno namespace (APIs for FS, I/O, net tcp/udp and similar).
|
||||||
* Extensions folder contain implementation of web specs such as fetch, timers, websocket, webusb, and others.
|
- Extensions folder contain implementation of web specs such as fetch, timers, websocket, webusb, and others.
|
||||||
* Cli is built on deno_runtime and contains.
|
- Cli is built on deno_runtime and contains.
|
||||||
* Infrastructure to compile and typecheck typescript.
|
- Infrastructure to compile and typecheck typescript.
|
||||||
* Infrastructure for code analysis and module graph.
|
- Infrastructure for code analysis and module graph.
|
||||||
* Inbuilt tooling such as lint, docs, or format. Those tools are built using rust crates such as deno_lint, deno_doc, and dprint.
|
- Inbuilt tooling such as lint, docs, or format. Those tools are built using rust crates such as deno_lint, deno_doc, and dprint.
|
||||||
* Extensions
|
- Extensions
|
||||||
* LSP (Language Server Protocol)
|
- LSP (Language Server Protocol)
|
||||||
|
|
||||||
## Deno Sandbox
|
## Deno Sandbox
|
||||||
|
|
||||||
Deno embraces browsers in providing a sandbox. By default, no permissions are given to the scripts.
|
Deno embraces browsers in providing a sandbox. By default, no permissions are given to the scripts.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
@@ -80,30 +85,39 @@ deno run --prompt script.ts
|
|||||||
# Install a cli with all permissions named aleph (react-next-alternative for deno)
|
# Install a cli with all permissions named aleph (react-next-alternative for deno)
|
||||||
deno install --unstable -A -n aleph https://deno.land/x/[email protected]/cli.ts
|
deno install --unstable -A -n aleph https://deno.land/x/[email protected]/cli.ts
|
||||||
```
|
```
|
||||||
|
|
||||||
Note: Higher level permissions will override lower level perms. If you give access to /tmp, it will automatically give access to /tmp/file, /tmp/test/file.
|
Note: Higher level permissions will override lower level perms. If you give access to /tmp, it will automatically give access to /tmp/file, /tmp/test/file.
|
||||||
|
|
||||||
## Permissions API
|
## Permissions API
|
||||||
|
|
||||||
Code can ask for permissions to be granted dynamically using the Deno.permissions API.
|
Code can ask for permissions to be granted dynamically using the Deno.permissions API.
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
// We will use utility functions from deno’s standard library to query and prompt for permissions.
|
// We will use utility functions from deno’s standard library to query and prompt for permissions.
|
||||||
import { grant, grantOrThrow } from "https://deno.land/[email protected]/permissions/mod.ts"
|
import {
|
||||||
|
grant,
|
||||||
|
grantOrThrow,
|
||||||
|
} from "https://deno.land/[email protected]/permissions/mod.ts";
|
||||||
|
|
||||||
// grantOrThrow will throw if permissions are not given.
|
// grantOrThrow will throw if permissions are not given.
|
||||||
|
|
||||||
const permissions = await grant([{
|
const permissions = await grant([
|
||||||
name: "env"
|
{
|
||||||
}, {
|
name: "env",
|
||||||
|
},
|
||||||
|
{
|
||||||
name: "write",
|
name: "write",
|
||||||
path: "/tmp"
|
path: "/tmp",
|
||||||
}])
|
},
|
||||||
|
]);
|
||||||
|
|
||||||
// Once prompted and denied, you cannot prompt for permissions again. Any subsequent call will return the previous state.
|
// Once prompted and denied, you cannot prompt for permissions again. Any subsequent call will return the previous state.
|
||||||
|
|
||||||
console.log(permissions)
|
console.log(permissions);
|
||||||
```
|
```
|
||||||
|
|
||||||
## Web Compatibility
|
## Web Compatibility
|
||||||
|
|
||||||
Node’s incompatibility with the web is a huge burden on everyone. Here are few common pain points:
|
Node’s incompatibility with the web is a huge burden on everyone. Here are few common pain points:
|
||||||
|
|
||||||
Polyfill browser APIs such as fetch or window.
|
Polyfill browser APIs such as fetch or window.
|
||||||
@@ -115,6 +129,7 @@ Relearn node-specific way to achieve what can be done through web APIs.
|
|||||||
Deno avoids above and future problems by committing to strong compatibility with web standards.
|
Deno avoids above and future problems by committing to strong compatibility with web standards.
|
||||||
|
|
||||||
### 1. Web Worker
|
### 1. Web Worker
|
||||||
|
|
||||||
Web workers are used to write multithreaded code on the web. They are available in Deno with one notable change. You can enable deno namespace for workers and enforce permissions.
|
Web workers are used to write multithreaded code on the web. They are available in Deno with one notable change. You can enable deno namespace for workers and enforce permissions.
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
@@ -131,6 +146,7 @@ const worker = new Worker(new URL("./worker.ts", import.meta.url).href, {
|
|||||||
```
|
```
|
||||||
|
|
||||||
### 2. Web GPU
|
### 2. Web GPU
|
||||||
|
|
||||||
WebGPU API provides a low level, high performance, and cross platform way to program GPU hardware. The spec isn’t finalized. Deno and most browsers support it through an experimental flag.
|
WebGPU API provides a low level, high performance, and cross platform way to program GPU hardware. The spec isn’t finalized. Deno and most browsers support it through an experimental flag.
|
||||||
|
|
||||||
<https://github.com/gpuweb/gpuweb/wiki/Implementation-Status>
|
<https://github.com/gpuweb/gpuweb/wiki/Implementation-Status>
|
||||||
@@ -147,45 +163,50 @@ deno run --unstable --allow-write=. https://crux.land/4KtnG8
|
|||||||
# Open it
|
# Open it
|
||||||
./output.png
|
./output.png
|
||||||
```
|
```
|
||||||
|
|
||||||
You can open the URL in the browser to see what the code looks like. More examples can be found in this repo: <https://github.com/crowlKats/webgpu-examples>
|
You can open the URL in the browser to see what the code looks like. More examples can be found in this repo: <https://github.com/crowlKats/webgpu-examples>
|
||||||
|
|
||||||
Note: WSL2 users will need to be on insider and have graphics drivers for wsl installed.
|
Note: WSL2 users will need to be on insider and have graphics drivers for wsl installed.
|
||||||
|
|
||||||
### 3. Local Storage And Session Storage
|
### 3. Local Storage And Session Storage
|
||||||
|
|
||||||
Deno supports local storage and session storage. Persistence is achieved using sqlite behind the scenes.
|
Deno supports local storage and session storage. Persistence is achieved using sqlite behind the scenes.
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
localStorage.setItem('deno', 'good dinosaur')
|
localStorage.setItem("deno", "good dinosaur");
|
||||||
console.log(localStorage.getItem('deno'))
|
console.log(localStorage.getItem("deno"));
|
||||||
localStorage.removeItem('deno')
|
localStorage.removeItem("deno");
|
||||||
localStorage.clear()
|
localStorage.clear();
|
||||||
```
|
```
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# Set location.
|
# Set location.
|
||||||
deno run --location=https://myapp script.ts
|
deno run --location=https://myapp script.ts
|
||||||
```
|
```
|
||||||
|
|
||||||
### 4. Import Map
|
### 4. Import Map
|
||||||
|
|
||||||
Import map lets you rewire your code imports.
|
Import map lets you rewire your code imports.
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"imports": {
|
"imports": {
|
||||||
"std/": "https://deno.land/[email protected]/",
|
"std/": "https://deno.land/[email protected]/",
|
||||||
"npm/": "https://esm.sh/"
|
"npm/": "https://esm.sh/"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
// Only for illustration purposes. Don’t use this approach.
|
// Only for illustration purposes. Don’t use this approach.
|
||||||
import { VERSION } from "std/version.ts"
|
import { VERSION } from "std/version.ts";
|
||||||
|
|
||||||
import Markdown from "npm/markdown-it"
|
import Markdown from "npm/markdown-it";
|
||||||
const md = new Markdown()
|
const md = new Markdown();
|
||||||
|
|
||||||
console.log(md.render(`# Hello, I am using std@${VERSION}`))
|
console.log(md.render(`# Hello, I am using std@${VERSION}`));
|
||||||
```
|
```
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
deno run --import-map=./import_map.json script.ts
|
deno run --import-map=./import_map.json script.ts
|
||||||
```
|
```
|
||||||
@@ -195,6 +216,7 @@ More: <https://docs.google.com/document/d/1vFQzbmxg9ilpg8CT_P8roEYcpTfZ06Q5N4J9-
|
|||||||
You can look inside extensions to see which web standards are supported: <https://github.com/denoland/deno/tree/main/extensions>
|
You can look inside extensions to see which web standards are supported: <https://github.com/denoland/deno/tree/main/extensions>
|
||||||
|
|
||||||
## Tooling
|
## Tooling
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# lint the code.
|
# lint the code.
|
||||||
deno lint
|
deno lint
|
||||||
@@ -225,15 +247,17 @@ deno doc
|
|||||||
```
|
```
|
||||||
|
|
||||||
## How do I use my existing node packages?
|
## How do I use my existing node packages?
|
||||||
|
|
||||||
Use a cdn such as esm.sh or skypack.dev. They will convert npm packages to work with deno. Node modules are polyfilled through <https://deno.land/std/node/>. If your package uses an unavailable node module, it won’t work with deno. You can make a PR to add it in the std.
|
Use a cdn such as esm.sh or skypack.dev. They will convert npm packages to work with deno. Node modules are polyfilled through <https://deno.land/std/node/>. If your package uses an unavailable node module, it won’t work with deno. You can make a PR to add it in the std.
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import React from "https://esm.sh/react"
|
import React from "https://esm.sh/react";
|
||||||
// we need ?dts flag to get `X-Typescript-Types` header on skypack.
|
// we need ?dts flag to get `X-Typescript-Types` header on skypack.
|
||||||
import ReactDom from "https://cdn.skypack.dev/[email protected]?dts"
|
import ReactDom from "https://cdn.skypack.dev/[email protected]?dts";
|
||||||
```
|
```
|
||||||
|
|
||||||
## How do I get auto completion for url imports?
|
## How do I get auto completion for url imports?
|
||||||
|
|
||||||
Add this to your vscode config to get import intellisense for your favorite registry (any registry will work as long as they support registry protocol: <https://github.com/denoland/vscode_deno/blob/main/docs/ImportCompletions.md#module-registry-completions>
|
Add this to your vscode config to get import intellisense for your favorite registry (any registry will work as long as they support registry protocol: <https://github.com/denoland/vscode_deno/blob/main/docs/ImportCompletions.md#module-registry-completions>
|
||||||
|
|
||||||
```json
|
```json
|
||||||
@@ -242,9 +266,11 @@ Add this to your vscode config to get import intellisense for your favorite regi
|
|||||||
"https://nest.land/": true
|
"https://nest.land/": true
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
You should be able to configure this for your favorite editor since it’s implemented inside LSP.
|
You should be able to configure this for your favorite editor since it’s implemented inside LSP.
|
||||||
|
|
||||||
## Isn’t it insecure to import from urls? What if they change code?
|
## Isn’t it insecure to import from urls? What if they change code?
|
||||||
|
|
||||||
No, deno caches any dependencies in DENO_DIR on running any command on the source code. It will use cache for subsequent runs. You can generate a lock file which can later be used to check subresource integrity.
|
No, deno caches any dependencies in DENO_DIR on running any command on the source code. It will use cache for subsequent runs. You can generate a lock file which can later be used to check subresource integrity.
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
@@ -254,9 +280,11 @@ deno cache --lock=deno.lockfile --lock-write deps.ts
|
|||||||
# Use lockfile when running a script
|
# Use lockfile when running a script
|
||||||
deno run --lock=deno.lockfile script.ts
|
deno run --lock=deno.lockfile script.ts
|
||||||
```
|
```
|
||||||
|
|
||||||
Unless you pass `--reload`, deno won’t refetch any of the urls.
|
Unless you pass `--reload`, deno won’t refetch any of the urls.
|
||||||
|
|
||||||
## How do type declarations for external modules work?
|
## How do type declarations for external modules work?
|
||||||
|
|
||||||
This is usually handled by registries by providing a specific header `X-Typescript-Types` in the requests. Deno will automatically fetch types from that.
|
This is usually handled by registries by providing a specific header `X-Typescript-Types` in the requests. Deno will automatically fetch types from that.
|
||||||
|
|
||||||
You can explicitly provide deno a type declaration file by commenting `@deno-types=path_to_file`.
|
You can explicitly provide deno a type declaration file by commenting `@deno-types=path_to_file`.
|
||||||
@@ -264,10 +292,11 @@ You can explicitly provide deno a type declaration file by commenting `@deno-typ
|
|||||||
```ts
|
```ts
|
||||||
// @deno-types=”./some_module.d.ts”
|
// @deno-types=”./some_module.d.ts”
|
||||||
// Remote files are supported as well.
|
// Remote files are supported as well.
|
||||||
import someModule from "./some_module.js"
|
import someModule from "./some_module.js";
|
||||||
```
|
```
|
||||||
|
|
||||||
## How do you use private modules with deno?
|
## How do you use private modules with deno?
|
||||||
|
|
||||||
Deno will request a file using an Authorization header set to Bearer [TOKEN]. You have to set these in the `DENO_AUTH_TOKENS` environment variable.
|
Deno will request a file using an Authorization header set to Bearer [TOKEN]. You have to set these in the `DENO_AUTH_TOKENS` environment variable.
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -276,29 +305,34 @@ DENO_AUTH_TOKENS=[token]@deno.land;[token]@example.land:5000
|
|||||||
```
|
```
|
||||||
|
|
||||||
## I want a script runner.
|
## I want a script runner.
|
||||||
|
|
||||||
Use make, denon, velociraptor or others.
|
Use make, denon, velociraptor or others.
|
||||||
|
|
||||||
1. <https://www.gnu.org/software/make/>
|
1. <https://www.gnu.org/software/make/>
|
||||||
2. <https://github.com/denosaurs/denon>
|
2. <https://github.com/denosaurs/denon>
|
||||||
3. <https://velociraptor.run/>
|
3. <https://velociraptor.run/>
|
||||||
|
|
||||||
## Which companies use deno?
|
## Which companies use deno?
|
||||||
Github, netlify, fly.io, appwrite, and many others.
|
|
||||||
|
Github, netlify, fly.io, appwrite, and many others.
|
||||||
|
|
||||||
## Code examples
|
## Code examples
|
||||||
|
|
||||||
### Http Server
|
### Http Server
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
const body = new TextEncoder().encode("Hello World");
|
const body = new TextEncoder().encode("Hello World");
|
||||||
|
|
||||||
async function handler(conn: Deno.Conn) {
|
async function handler(conn: Deno.Conn) {
|
||||||
for await (const { respondWith } of Deno.serveHttp(conn)) {
|
for await (const { respondWith } of Deno.serveHttp(conn)) {
|
||||||
respondWith(new Response(body));
|
respondWith(new Response(body));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for await (const conn of Deno.listen({ port: 4000 })) {
|
for await (const conn of Deno.listen({ port: 4000 })) {
|
||||||
handler(conn)
|
handler(conn);
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
# We will run it with prompt and unstable since native http isn’t stable yet
|
# We will run it with prompt and unstable since native http isn’t stable yet
|
||||||
deno run --unstable --prompt http.ts
|
deno run --unstable --prompt http.ts
|
||||||
@@ -310,6 +344,7 @@ deno run --unstable --prompt http.ts
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Cat
|
### Cat
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
const filenames = Deno.args;
|
const filenames = Deno.args;
|
||||||
for (const filename of filenames) {
|
for (const filename of filenames) {
|
||||||
@@ -320,6 +355,7 @@ for (const filename of filenames) {
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Testing
|
### Testing
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
import {
|
import {
|
||||||
assert,
|
assert,
|
||||||
@@ -364,19 +400,19 @@ Shell Tool: <https://deno.land/x/[email protected]>
|
|||||||
|
|
||||||
## Resources
|
## Resources
|
||||||
|
|
||||||
* Website: https://deno.land/
|
- Website: https://deno.land/
|
||||||
* Documentation viewer for modules: <https://doc.deno.land/>
|
- Documentation viewer for modules: <https://doc.deno.land/>
|
||||||
* Code and dep visualizer: <https://deno-visualizer.danopia.net/>
|
- Code and dep visualizer: <https://deno-visualizer.danopia.net/>
|
||||||
* Manual: <https://deno.land/manual>
|
- Manual: <https://deno.land/manual>
|
||||||
* Runtime APIs: <https://doc.deno.land/builtin/stable>
|
- Runtime APIs: <https://doc.deno.land/builtin/stable>
|
||||||
* Deno lint rules: <https://lint.deno.land/>
|
- Deno lint rules: <https://lint.deno.land/>
|
||||||
* Standard Library: <https://deno.land/std>
|
- Standard Library: <https://deno.land/std>
|
||||||
* Benchmark: <https://deno.land/benchmarks>
|
- Benchmark: <https://deno.land/benchmarks>
|
||||||
* Testing: <https://deno.land/manual@v1.10.2/testing>
|
- Testing: <https://deno.land/manual@v1.10.2/testing>
|
||||||
* FAQs for typescript in deno: <https://deno.land/manual@v1.8.1/typescript/faqs>
|
- FAQs for typescript in deno: <https://deno.land/manual@v1.8.1/typescript/faqs>
|
||||||
* Editor: <https://deno.land/manual@v1.9.0/getting_started/setup_your_environment#editors-and-ides> (Note: jetbrains plugin is broken.)
|
- Editor: <https://deno.land/manual@v1.9.0/getting_started/setup_your_environment#editors-and-ides> (Note: jetbrains plugin is broken.)
|
||||||
* Debugging: <https://deno.land/manual@v1.9.0/getting_started/debugging_your_code>
|
- Debugging: <https://deno.land/manual@v1.9.0/getting_started/debugging_your_code>
|
||||||
* Deno walkthrough series on youtube: <https://www.youtube.com/channel/UCjg3RCjC2punepJwGYFW7RQ>
|
- Deno walkthrough series on youtube: <https://www.youtube.com/channel/UCjg3RCjC2punepJwGYFW7RQ>
|
||||||
* Pastebin for deno: <https://crux.land/>
|
- Pastebin for deno: <https://crux.land/>
|
||||||
* Docker Image: <https://github.com/denoland/deno_docker>
|
- Docker Image: <https://github.com/denoland/deno_docker>
|
||||||
* Web platform compat status: <https://wpt.deno.land/>
|
- Web platform compat status: <https://wpt.deno.land/>
|
||||||
|
|||||||
@@ -7,9 +7,11 @@ title: What is Docker?
|
|||||||
---
|
---
|
||||||
|
|
||||||
## What is Docker?
|
## What is Docker?
|
||||||
|
|
||||||
Docker is a platform for developers and sysadmins to develop, deploy, and run applications with containers. Containers allow for total application and environment isolation which makes it much easier to ensure an application runs with any necessary dependencies.
|
Docker is a platform for developers and sysadmins to develop, deploy, and run applications with containers. Containers allow for total application and environment isolation which makes it much easier to ensure an application runs with any necessary dependencies.
|
||||||
|
|
||||||
## Why should I use Docker?
|
## Why should I use Docker?
|
||||||
|
|
||||||
The simplest use case for Docker is packaging an application into an image and then running it on any machine running the Docker platform. Think running your API locally on Windows, on your OSX laptop, or on a Linux server in a cloud without making any changes to your codebase, all with the same command.
|
The simplest use case for Docker is packaging an application into an image and then running it on any machine running the Docker platform. Think running your API locally on Windows, on your OSX laptop, or on a Linux server in a cloud without making any changes to your codebase, all with the same command.
|
||||||
|
|
||||||
For more complex deployments consisting of multiple containers, Docker provides a tool called docker-compose. This will read a configuration of one or more Docker containers and run them for you and manage them as a single application.
|
For more complex deployments consisting of multiple containers, Docker provides a tool called docker-compose. This will read a configuration of one or more Docker containers and run them for you and manage them as a single application.
|
||||||
@@ -17,11 +19,13 @@ For more complex deployments consisting of multiple containers, Docker provides
|
|||||||
Another benefit is using it to perform builds or development on local machines to avoid needing to set up a development environment. As dependencies can be a nightmare in situations like this, requiring things like npm or virtualenv and other isolation techniques, containerization can greatly simplify things and shorten the time it takes for someone to get set up on a project. You can even pull down a container containing a language runtime and just start writing code immediately, for languages with REPLs you can use docker to launch a REPL shell for any language without needing to go install a runtime on your machine.
|
Another benefit is using it to perform builds or development on local machines to avoid needing to set up a development environment. As dependencies can be a nightmare in situations like this, requiring things like npm or virtualenv and other isolation techniques, containerization can greatly simplify things and shorten the time it takes for someone to get set up on a project. You can even pull down a container containing a language runtime and just start writing code immediately, for languages with REPLs you can use docker to launch a REPL shell for any language without needing to go install a runtime on your machine.
|
||||||
|
|
||||||
## What's the difference between Docker and a VM?
|
## What's the difference between Docker and a VM?
|
||||||
|
|
||||||
VMs have been widely used to solve these problems. The key difference between VMs and containers is that containers are not a virtual OS. All containers running on a host share the same parent kernel. Container technology is enabled by core Linux kernel features for isolating applications. When you run a Linux container on a Windows machine using Docker for Windows, a single Linux VM must run as the host for the Linux containers, but when running natively on a Linux machine, no VM is required, and container applications run inside an isolated process, just like any other application.
|
VMs have been widely used to solve these problems. The key difference between VMs and containers is that containers are not a virtual OS. All containers running on a host share the same parent kernel. Container technology is enabled by core Linux kernel features for isolating applications. When you run a Linux container on a Windows machine using Docker for Windows, a single Linux VM must run as the host for the Linux containers, but when running natively on a Linux machine, no VM is required, and container applications run inside an isolated process, just like any other application.
|
||||||
|
|
||||||
The advantage to this approach is that it's very lightweight since it doesn't require the overhead of a virtual guest operating system and virtual access to resources through a hypervisor.
|
The advantage to this approach is that it's very lightweight since it doesn't require the overhead of a virtual guest operating system and virtual access to resources through a hypervisor.
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
You can get a fully functional ubuntu machine by just running
|
You can get a fully functional ubuntu machine by just running
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ title: What is Elixir?
|
|||||||
---
|
---
|
||||||
|
|
||||||
## What is Elixir?
|
## What is Elixir?
|
||||||
|
|
||||||
Elixir is a dynamically typed, functional programming language, with an emphasis on concurrency.
|
Elixir is a dynamically typed, functional programming language, with an emphasis on concurrency.
|
||||||
Elixir, despite being a young language, has grown quite rapidly, and has surprisingly fleshed out libraries and documentation.
|
Elixir, despite being a young language, has grown quite rapidly, and has surprisingly fleshed out libraries and documentation.
|
||||||
On a surface level, the language was inspired by ruby in terms of syntax, but the way the language works is quite different.
|
On a surface level, the language was inspired by ruby in terms of syntax, but the way the language works is quite different.
|
||||||
@@ -13,14 +14,17 @@ Elixir leverages concurrency via the "actor model", where many lightweight proce
|
|||||||
To do this, Elixir compiles to the BEAM / Erlang VM, which was built with this kind of distributed programming model in mind. Elixir is very similar in features to Erlang.
|
To do this, Elixir compiles to the BEAM / Erlang VM, which was built with this kind of distributed programming model in mind. Elixir is very similar in features to Erlang.
|
||||||
|
|
||||||
## What is Erlang?
|
## What is Erlang?
|
||||||
|
|
||||||
Erlang is a much older programming language, for which the Erlang VM was designed. Erlang was initially conceived of at Ericsson, for use in telecommunications. They needed to be able to handle many different calls at once, and so needed a programming model that support many different workers, or "actors" running concurrently.
|
Erlang is a much older programming language, for which the Erlang VM was designed. Erlang was initially conceived of at Ericsson, for use in telecommunications. They needed to be able to handle many different calls at once, and so needed a programming model that support many different workers, or "actors" running concurrently.
|
||||||
The Erlang VM leverages the actor model to do this.
|
The Erlang VM leverages the actor model to do this.
|
||||||
|
|
||||||
## How is Elixir different from Erlang?
|
## How is Elixir different from Erlang?
|
||||||
|
|
||||||
Elixir has an arguably friendlier syntax, but for the most part is very similar to erlang in terms of language constructs.
|
Elixir has an arguably friendlier syntax, but for the most part is very similar to erlang in terms of language constructs.
|
||||||
One major addition to the language however is metaprogramming. Elixir has a rich and easy to use macro system, and an almost homiconic syntax, somewhat reminiscent of Lisp, but without the parens. Elixir also comes with a somewhat richer standard library. Another big advantage of Elixir is very easy interop with Erlang: calling an Erlang function is as simple as calling an Elixir one, and Erlang users can also use Elixir functions with little pain.
|
One major addition to the language however is metaprogramming. Elixir has a rich and easy to use macro system, and an almost homiconic syntax, somewhat reminiscent of Lisp, but without the parens. Elixir also comes with a somewhat richer standard library. Another big advantage of Elixir is very easy interop with Erlang: calling an Erlang function is as simple as calling an Elixir one, and Erlang users can also use Elixir functions with little pain.
|
||||||
|
|
||||||
## What is the actor model?
|
## What is the actor model?
|
||||||
|
|
||||||
We've mentioned the actor model a few times, but what exactly is it?
|
We've mentioned the actor model a few times, but what exactly is it?
|
||||||
The actor model is 2 things
|
The actor model is 2 things
|
||||||
|
|
||||||
@@ -30,6 +34,7 @@ The actor model is 2 things
|
|||||||
In elixir / erlang, we can run millions of processes concurrently with no worry at all. Each process has its own memory and resources, and to share these, they must communicate. Communication via processes is done via "message passing" where a process A will send a message to another process B, ready to receive and respond to that message. The only way to share data is by communicating, no 2 processes can hold onto the same piece of memory. This model avoids many problems arising from shared concurrent state (though not all, mind you).
|
In elixir / erlang, we can run millions of processes concurrently with no worry at all. Each process has its own memory and resources, and to share these, they must communicate. Communication via processes is done via "message passing" where a process A will send a message to another process B, ready to receive and respond to that message. The only way to share data is by communicating, no 2 processes can hold onto the same piece of memory. This model avoids many problems arising from shared concurrent state (though not all, mind you).
|
||||||
|
|
||||||
## How do I learn more about Elixir?
|
## How do I learn more about Elixir?
|
||||||
|
|
||||||
There's quite a few resources on Elixir, including a few books https://elixir-lang.org/learning.html#books.
|
There's quite a few resources on Elixir, including a few books https://elixir-lang.org/learning.html#books.
|
||||||
|
|
||||||
A good place to start if you're interested is the website itself: https://elixir-lang.org/ which includes a lot of information about the language, including a guide to installing and getting started with it, as well as a large tutorial guiding you through most of the language's constructs.
|
A good place to start if you're interested is the website itself: https://elixir-lang.org/ which includes a lot of information about the language, including a guide to installing and getting started with it, as well as a large tutorial guiding you through most of the language's constructs.
|
||||||
@@ -45,6 +50,7 @@ IO.puts "Hello World from Elixir!"
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Various ways of summing a lists
|
### Various ways of summing a lists
|
||||||
|
|
||||||
The first works via recursion and pattern matching on the shape of a list, the second works by using a function defined in the Enum module.
|
The first works via recursion and pattern matching on the shape of a list, the second works by using a function defined in the Enum module.
|
||||||
|
|
||||||
```elixir
|
```elixir
|
||||||
@@ -63,6 +69,7 @@ end
|
|||||||
```
|
```
|
||||||
|
|
||||||
### Concurrent Processes
|
### Concurrent Processes
|
||||||
|
|
||||||
A simple example how simple processes can delegate work between eachother. The different processes here are running in parallel after being spawned.
|
A simple example how simple processes can delegate work between eachother. The different processes here are running in parallel after being spawned.
|
||||||
|
|
||||||
```elixir
|
```elixir
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ title: What is Google?
|
|||||||
---
|
---
|
||||||
|
|
||||||
## What is Google?
|
## What is Google?
|
||||||
|
|
||||||
Google allows us smooth brained chumps to keep our jobs while looking like we know what we're doing.
|
Google allows us smooth brained chumps to keep our jobs while looking like we know what we're doing.
|
||||||
|
|
||||||
"What!?!?" I hear you say. That's right. Google can almost always give you the answers you're looking for and in this spotlight we'll show you how!
|
"What!?!?" I hear you say. That's right. Google can almost always give you the answers you're looking for and in this spotlight we'll show you how!
|
||||||
@@ -28,7 +29,7 @@ That's all folks.
|
|||||||
|
|
||||||
🦗
|
🦗
|
||||||
|
|
||||||
**But... I want to *really* know how to use google!**
|
**But... I want to _really_ know how to use google!**
|
||||||
|
|
||||||
Alright alright. Pull your chair up close and I'll tell you the secrets big search don't want you to know! You didn't hear it from me though!
|
Alright alright. Pull your chair up close and I'll tell you the secrets big search don't want you to know! You didn't hear it from me though!
|
||||||
|
|
||||||
@@ -37,6 +38,7 @@ Alright alright. Pull your chair up close and I'll tell you the secrets big sear
|
|||||||
One of the most important things to know is that google uses various keyword and punctuation combinations as filter operators. Let's take a look at what they are, and how they affect your search results.
|
One of the most important things to know is that google uses various keyword and punctuation combinations as filter operators. Let's take a look at what they are, and how they affect your search results.
|
||||||
|
|
||||||
### 1. The colon
|
### 1. The colon
|
||||||
|
|
||||||
`site:` - Imagine you're looking for that one specific stack overflow post. You remember seeing it way back when you were just a wee little programming child typing on your keyboard with your index fingers only. We can use `site:` to filter our results to a specific website.
|
`site:` - Imagine you're looking for that one specific stack overflow post. You remember seeing it way back when you were just a wee little programming child typing on your keyboard with your index fingers only. We can use `site:` to filter our results to a specific website.
|
||||||
|
|
||||||
Example: `site:stackoverflow.com html regex` - One of the top results here should be an infamous SO post on parsing HTML with regex. If you haven't read it take a look!
|
Example: `site:stackoverflow.com html regex` - One of the top results here should be an infamous SO post on parsing HTML with regex. If you haven't read it take a look!
|
||||||
@@ -54,11 +56,13 @@ Example: `cache:https://stackoverflow.com/questions` - Now you need not panic wh
|
|||||||
Example: `filetype:pdf On Computable Numbers` - PDF results for one of Alan Turing's papers.
|
Example: `filetype:pdf On Computable Numbers` - PDF results for one of Alan Turing's papers.
|
||||||
|
|
||||||
### 2. The dash
|
### 2. The dash
|
||||||
|
|
||||||
`-` this little guy is a tricksy fellow. The echos of enraged Java programmers shattered through the lands as they searched `-xmx` and were given no results. As it turns out, using a dash will **exclude** the following word from the results
|
`-` this little guy is a tricksy fellow. The echos of enraged Java programmers shattered through the lands as they searched `-xmx` and were given no results. As it turns out, using a dash will **exclude** the following word from the results
|
||||||
|
|
||||||
Example: `-xmx` - will give you no results.
|
Example: `-xmx` - will give you no results.
|
||||||
|
|
||||||
### 3. Quotes
|
### 3. Quotes
|
||||||
|
|
||||||
`"` - When you make a search on google, if you put a word or phrase in quotes, google will look for an exact match. Useful if you're looking for a very specific error.
|
`"` - When you make a search on google, if you put a word or phrase in quotes, google will look for an exact match. Useful if you're looking for a very specific error.
|
||||||
|
|
||||||
Example: `"Fly, you fools"`
|
Example: `"Fly, you fools"`
|
||||||
@@ -76,6 +80,7 @@ If you're looking for research papers for school/college/uni/fun then Google Sch
|
|||||||
<https://scholar.google.com/>
|
<https://scholar.google.com/>
|
||||||
|
|
||||||
## Advanced Search
|
## Advanced Search
|
||||||
|
|
||||||
Still stuck trying to find what you want? Try Google's Advanced Search page <https://www.google.com/advanced_search>
|
Still stuck trying to find what you want? Try Google's Advanced Search page <https://www.google.com/advanced_search>
|
||||||
This page is a slightly more UX friendly version of all the above filters and more!
|
This page is a slightly more UX friendly version of all the above filters and more!
|
||||||
Image advanced search: <https://www.google.com/advanced_image_search>
|
Image advanced search: <https://www.google.com/advanced_image_search>
|
||||||
|
|||||||
@@ -5,11 +5,12 @@ created_at: "2018/07/18"
|
|||||||
title: What is GraphQL?
|
title: What is GraphQL?
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
## What is GraphQL?
|
## What is GraphQL?
|
||||||
|
|
||||||
GraphQL is a query language for APIs, meant to challenge and replace REST. At its core, GraphQL enables declarative data fetching where a client can specify exactly what data it needs from an API. Put bluntly, a lot of people claim GraphQL to be REST 2.0.
|
GraphQL is a query language for APIs, meant to challenge and replace REST. At its core, GraphQL enables declarative data fetching where a client can specify exactly what data it needs from an API. Put bluntly, a lot of people claim GraphQL to be REST 2.0.
|
||||||
|
|
||||||
## Why does GraphQL exist?
|
## Why does GraphQL exist?
|
||||||
|
|
||||||
GraphQL was created internally by Facebook in 2012, mainly to optimize the network load for mobile devices. Interestingly, other companies like Netflix or Coursera were working on comparable ideas to make API interactions more efficient. When Facebook announced GraphQL, Coursera abandoned their efforts and jumped on GraphQL.
|
GraphQL was created internally by Facebook in 2012, mainly to optimize the network load for mobile devices. Interestingly, other companies like Netflix or Coursera were working on comparable ideas to make API interactions more efficient. When Facebook announced GraphQL, Coursera abandoned their efforts and jumped on GraphQL.
|
||||||
|
|
||||||
## What makes GraphQL better than REST?
|
## What makes GraphQL better than REST?
|
||||||
@@ -85,6 +86,7 @@ query user(id: "5") {
|
|||||||
3. Strong-typing. Contrary to working with JSON responses limited to string and numeric, and the discrepancy between front-end (JS) and any back-end language being lost in translation.
|
3. Strong-typing. Contrary to working with JSON responses limited to string and numeric, and the discrepancy between front-end (JS) and any back-end language being lost in translation.
|
||||||
|
|
||||||
## Core concepts
|
## Core concepts
|
||||||
|
|
||||||
GraphQL has three types of operations:
|
GraphQL has three types of operations:
|
||||||
|
|
||||||
- queries (fetching data),
|
- queries (fetching data),
|
||||||
@@ -147,6 +149,7 @@ http://myapi/graphql?query={me{name}}
|
|||||||
```
|
```
|
||||||
|
|
||||||
## How can I start using GraphQL?
|
## How can I start using GraphQL?
|
||||||
|
|
||||||
While it is possible to convert an existing REST endpoint to GraphQL, either through automated tools, or manually, the best case scenario would be on an entirely new project.
|
While it is possible to convert an existing REST endpoint to GraphQL, either through automated tools, or manually, the best case scenario would be on an entirely new project.
|
||||||
|
|
||||||
## Common misconceptions
|
## Common misconceptions
|
||||||
@@ -158,6 +161,7 @@ While it is possible to convert an existing REST endpoint to GraphQL, either thr
|
|||||||
- When it was first announced by Facebook, a lot of people thought it was React exclusive! This is not true. GraphQL can work on any tech stack (although some languages have more complete tooling than others)
|
- When it was first announced by Facebook, a lot of people thought it was React exclusive! This is not true. GraphQL can work on any tech stack (although some languages have more complete tooling than others)
|
||||||
|
|
||||||
## Closing notes
|
## Closing notes
|
||||||
|
|
||||||
Today, GraphQL is used in production by lots of different companies such as GitHub, Twitter, Yelp and Shopify - to name only a few. We are seeing month after month, small and large companies converting to it.
|
Today, GraphQL is used in production by lots of different companies such as GitHub, Twitter, Yelp and Shopify - to name only a few. We are seeing month after month, small and large companies converting to it.
|
||||||
|
|
||||||
## Related projects and libraries
|
## Related projects and libraries
|
||||||
|
|||||||
@@ -7,10 +7,12 @@ title: What is Haskell?
|
|||||||
---
|
---
|
||||||
|
|
||||||
## What is Haskell?
|
## What is Haskell?
|
||||||
|
|
||||||
"Haskell is a computer programming language. In particular, it is a polymorphically statically typed, lazy, purely functional language, quite different from most other programming languages. The language is named for Haskell Brooks Curry, whose work in mathematical logic serves as a foundation for functional languages. Haskell is based on the lambda calculus, hence the lambda we use as a logo." - Haskell Wiki
|
"Haskell is a computer programming language. In particular, it is a polymorphically statically typed, lazy, purely functional language, quite different from most other programming languages. The language is named for Haskell Brooks Curry, whose work in mathematical logic serves as a foundation for functional languages. Haskell is based on the lambda calculus, hence the lambda we use as a logo." - Haskell Wiki
|
||||||
The above being said, if you perceive yourself to be "bad" at math, don't feed into it. If you are interested in using it and you apply yourself it will work out.
|
The above being said, if you perceive yourself to be "bad" at math, don't feed into it. If you are interested in using it and you apply yourself it will work out.
|
||||||
|
|
||||||
## Why should I use Haskell?
|
## Why should I use Haskell?
|
||||||
|
|
||||||
Haskell is a general purpose programming language. So you can use it for anything, from scripting to game development - that being said, it provides you with some rather unique and cool benefits not found in many other places.
|
Haskell is a general purpose programming language. So you can use it for anything, from scripting to game development - that being said, it provides you with some rather unique and cool benefits not found in many other places.
|
||||||
|
|
||||||
- Haskell code tends to be very short and clear (See code examples below)
|
- Haskell code tends to be very short and clear (See code examples below)
|
||||||
|
|||||||
@@ -6,10 +6,12 @@ title: What is Julia?
|
|||||||
---
|
---
|
||||||
|
|
||||||
## What is Julia?
|
## What is Julia?
|
||||||
|
|
||||||
Julia is a high-level dynamic programming language for numerical computing. It is free and open-source: under the MIT license.
|
Julia is a high-level dynamic programming language for numerical computing. It is free and open-source: under the MIT license.
|
||||||
Although Julia is still in its youth (the current release is v1.2), Julia provides a lot of support for mathematical analysis and data science.
|
Although Julia is still in its youth (the current release is v1.2), Julia provides a lot of support for mathematical analysis and data science.
|
||||||
|
|
||||||
## How hard is Julia to learn?
|
## How hard is Julia to learn?
|
||||||
|
|
||||||
Julia is a fairly complex language but has some very simple behaviors which are easy to pick up. It is mainly used for data science and mathematical analysis, so those complexities come with it. You must understand some mathematical principles to use the language well. Julia uses certain expressions differently from other languages as well making it a bit harder to pick up; however, it makes sense. For example, string concatenation is done with \*, and not +. Julia is heavily documented and low-level, so learning the standard syntax is easy to do by following the tutorial along with other resources.
|
Julia is a fairly complex language but has some very simple behaviors which are easy to pick up. It is mainly used for data science and mathematical analysis, so those complexities come with it. You must understand some mathematical principles to use the language well. Julia uses certain expressions differently from other languages as well making it a bit harder to pick up; however, it makes sense. For example, string concatenation is done with \*, and not +. Julia is heavily documented and low-level, so learning the standard syntax is easy to do by following the tutorial along with other resources.
|
||||||
|
|
||||||
## What's so great about Julia?
|
## What's so great about Julia?
|
||||||
@@ -30,12 +32,15 @@ Julia is a fairly complex language but has some very simple behaviors which are
|
|||||||
- Efficient support for Unicode, including but not limited to UTF-8
|
- Efficient support for Unicode, including but not limited to UTF-8
|
||||||
|
|
||||||
## What platforms can Julia run on?
|
## What platforms can Julia run on?
|
||||||
|
|
||||||
Julia can run on most popular platforms such as MacOSX, most Linux builds, Windows, and others. This is due to it compiling to a native binary. However, it does not have broad support for front-end development, but there is a library for Qt bindings.
|
Julia can run on most popular platforms such as MacOSX, most Linux builds, Windows, and others. This is due to it compiling to a native binary. However, it does not have broad support for front-end development, but there is a library for Qt bindings.
|
||||||
|
|
||||||
## CLI
|
## CLI
|
||||||
|
|
||||||
The Julia download comes with a CLI environment. With the CLI you can try out Julia functions and expressions in the command line. (Binary languages rarely have a CLI, so this is pretty cool)
|
The Julia download comes with a CLI environment. With the CLI you can try out Julia functions and expressions in the command line. (Binary languages rarely have a CLI, so this is pretty cool)
|
||||||
|
|
||||||
## Code Examples:
|
## Code Examples:
|
||||||
|
|
||||||
Hello world:
|
Hello world:
|
||||||
|
|
||||||
```julia
|
```julia
|
||||||
@@ -140,6 +145,7 @@ end
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Resources:
|
## Resources:
|
||||||
|
|
||||||
Julia documentation: <https://docs.julialang.org>
|
Julia documentation: <https://docs.julialang.org>
|
||||||
|
|
||||||
Try it out online! <https://juliabox.com>, and <https://www.tutorialspoint.com/execute_julia_online.php>
|
Try it out online! <https://juliabox.com>, and <https://www.tutorialspoint.com/execute_julia_online.php>
|
||||||
|
|||||||
@@ -6,12 +6,15 @@ title: What is Kotlin?
|
|||||||
---
|
---
|
||||||
|
|
||||||
## What is kotlin?
|
## What is kotlin?
|
||||||
|
|
||||||
Kotlin is a statically typed programming language that runs on the JVM (Java Virtual Machine).
|
Kotlin is a statically typed programming language that runs on the JVM (Java Virtual Machine).
|
||||||
|
|
||||||
## Why does kotlin exist?
|
## Why does kotlin exist?
|
||||||
|
|
||||||
Kotlin exists as a modern roll of Java - Java was built from the ground up to suit OOP, and that's a task that it does pretty well. Later, functional programming was added in, by contrast, kotlin was made with both paradigms in mind, picking the good, easy to adopt parts up and adding them all into one neat language. Kotlin also had a requirement: Allow interop with Java code - to which it does (works great on android!)
|
Kotlin exists as a modern roll of Java - Java was built from the ground up to suit OOP, and that's a task that it does pretty well. Later, functional programming was added in, by contrast, kotlin was made with both paradigms in mind, picking the good, easy to adopt parts up and adding them all into one neat language. Kotlin also had a requirement: Allow interop with Java code - to which it does (works great on android!)
|
||||||
|
|
||||||
## How hard is kotlin to learn?
|
## How hard is kotlin to learn?
|
||||||
|
|
||||||
Well, that depends a lot on where you are coming from. If you already know Java, it'll be exceptionally easy to pick up. Everything has a very "right" feeling to it compared to the older style, it's almost like a natural progression.
|
Well, that depends a lot on where you are coming from. If you already know Java, it'll be exceptionally easy to pick up. Everything has a very "right" feeling to it compared to the older style, it's almost like a natural progression.
|
||||||
|
|
||||||
If you don't know Java, that's a bit trickier to answer. You can certainly learn it, as a first language either, but there are some Java things you will need to know. If I were learning it as a first language, I'd try to heavily rely on the documentation and understand each feature that exists in kotlin, and why they exist. The most important is the concept of nullable types.
|
If you don't know Java, that's a bit trickier to answer. You can certainly learn it, as a first language either, but there are some Java things you will need to know. If I were learning it as a first language, I'd try to heavily rely on the documentation and understand each feature that exists in kotlin, and why they exist. The most important is the concept of nullable types.
|
||||||
@@ -19,6 +22,7 @@ If you don't know Java, that's a bit trickier to answer. You can certainly learn
|
|||||||
Java will allow anything to be null, but in kotlin there is a distinct separation. a `String` is very different to a `String?` - the second one can have a value of null, the first cannot. When interoping with Java code, it's always best to assume anything can be null.
|
Java will allow anything to be null, but in kotlin there is a distinct separation. a `String` is very different to a `String?` - the second one can have a value of null, the first cannot. When interoping with Java code, it's always best to assume anything can be null.
|
||||||
|
|
||||||
## What are some key features of kotlin?
|
## What are some key features of kotlin?
|
||||||
|
|
||||||
If you're a Java user, here is a comparison list made by Jetbrains: <https://kotlinlang.org/docs/reference/comparison-to-java.html>
|
If you're a Java user, here is a comparison list made by Jetbrains: <https://kotlinlang.org/docs/reference/comparison-to-java.html>
|
||||||
|
|
||||||
Some key ones to point out of this list:
|
Some key ones to point out of this list:
|
||||||
@@ -28,18 +32,23 @@ Some key ones to point out of this list:
|
|||||||
- Extension functions - great for fixing up a library class that is missing a method. No pretty print function? That's cool, just define it yourself. `LibraryClass.newFunction() = ...` (Yes, like C#)
|
- Extension functions - great for fixing up a library class that is missing a method. No pretty print function? That's cool, just define it yourself. `LibraryClass.newFunction() = ...` (Yes, like C#)
|
||||||
|
|
||||||
## What platforms can kotlin run on?
|
## What platforms can kotlin run on?
|
||||||
|
|
||||||
Anything and everything. Let's break that down:
|
Anything and everything. Let's break that down:
|
||||||
|
|
||||||
## The JVM
|
## The JVM
|
||||||
|
|
||||||
This is primary compile target, the JVM as a piece of kit allows you to write some code and have it work without separate compilations on Windows, Mac and Linux - so you've got all of your bases covered there.
|
This is primary compile target, the JVM as a piece of kit allows you to write some code and have it work without separate compilations on Windows, Mac and Linux - so you've got all of your bases covered there.
|
||||||
|
|
||||||
## Android
|
## Android
|
||||||
|
|
||||||
Yea, it's also a first class language on android, the only other language supported by google: <https://youtu.be/d8ALcQiuPWs>
|
Yea, it's also a first class language on android, the only other language supported by google: <https://youtu.be/d8ALcQiuPWs>
|
||||||
|
|
||||||
## Native
|
## Native
|
||||||
|
|
||||||
If you don't like the JVM and you're not an android dev, well, you can just target native: <https://kotlinlang.org/docs/reference/native-overview.html>
|
If you don't like the JVM and you're not an android dev, well, you can just target native: <https://kotlinlang.org/docs/reference/native-overview.html>
|
||||||
|
|
||||||
## JavaScript
|
## JavaScript
|
||||||
|
|
||||||
Yea, you can make kotlin compile to JavaScript, see here: <https://kotlinlang.org/docs/tutorials/javascript/kotlin-to-javascript/kotlin-to-javascript.html>
|
Yea, you can make kotlin compile to JavaScript, see here: <https://kotlinlang.org/docs/tutorials/javascript/kotlin-to-javascript/kotlin-to-javascript.html>
|
||||||
|
|
||||||
Here are some extra points that don't fit into any of the headings above
|
Here are some extra points that don't fit into any of the headings above
|
||||||
|
|||||||
@@ -6,14 +6,17 @@ title: What is Lisp?
|
|||||||
---
|
---
|
||||||
|
|
||||||
## What is Lisp?
|
## What is Lisp?
|
||||||
|
|
||||||
Originally specified in 1958, Lisp is the second oldest high level programming language in use today. (Only younger than FORTRAN by one year!). There have been many different dialects of Lisp that have come and gone over the ages. In the modern day, some of the most known and used Lisp dialects (lisps) are Common Lisp, Clojure/ClojureScript, Racket and Scheme. The name "Lisp" was derived from "LISt Processor", and the list data structure is at the core of the language. Many recognizable language features were first developed in Lisp; dynamic typing, garbage collection, the read-eval-print loop, and more.
|
Originally specified in 1958, Lisp is the second oldest high level programming language in use today. (Only younger than FORTRAN by one year!). There have been many different dialects of Lisp that have come and gone over the ages. In the modern day, some of the most known and used Lisp dialects (lisps) are Common Lisp, Clojure/ClojureScript, Racket and Scheme. The name "Lisp" was derived from "LISt Processor", and the list data structure is at the core of the language. Many recognizable language features were first developed in Lisp; dynamic typing, garbage collection, the read-eval-print loop, and more.
|
||||||
|
|
||||||
## How hard are Lisps to learn?
|
## How hard are Lisps to learn?
|
||||||
|
|
||||||
The basics are not very difficult (especially because there aren't that many basics to learn). Experience with functional programming translates well. Most Lisps have a very small set of keywords and syntax rules, and rich libraries constructed atop those simple essentials. A lot of newcomers to Lisps are initially put off by a lot of parentheses, but most of those newcomers come to accept, and in some cases, admire the simplicity provided by, those parens. For example, Lisps usually have no concept of 'operator precedence' - the innermost parens are evaluated first.
|
The basics are not very difficult (especially because there aren't that many basics to learn). Experience with functional programming translates well. Most Lisps have a very small set of keywords and syntax rules, and rich libraries constructed atop those simple essentials. A lot of newcomers to Lisps are initially put off by a lot of parentheses, but most of those newcomers come to accept, and in some cases, admire the simplicity provided by, those parens. For example, Lisps usually have no concept of 'operator precedence' - the innermost parens are evaluated first.
|
||||||
|
|
||||||
If you know python, this document may be of particular interest to you: http://norvig.com/python-lisp.html. Even if you don't know python, the second paragraph under the heading "Introducing Python" explains some Lisp philosophy of use.
|
If you know python, this document may be of particular interest to you: http://norvig.com/python-lisp.html. Even if you don't know python, the second paragraph under the heading "Introducing Python" explains some Lisp philosophy of use.
|
||||||
|
|
||||||
## What are some key features?
|
## What are some key features?
|
||||||
|
|
||||||
- Homoiconicity: Lisps treat data and code similarly - that is to say, the code you write is in the form of lisp data structures (arbitrarily nested lists) that the lisp interpreter reads and evaluates. While this can feel awkward at first, it allows for what might be the simplest metaprogramming constructs.
|
- Homoiconicity: Lisps treat data and code similarly - that is to say, the code you write is in the form of lisp data structures (arbitrarily nested lists) that the lisp interpreter reads and evaluates. While this can feel awkward at first, it allows for what might be the simplest metaprogramming constructs.
|
||||||
|
|
||||||
- Macros: Macros let you expand and redefine the syntax of the language itself. Think of it as having a hook into the interpreter... you get to write what feel like functions that return lisp expressions, and the interpreter will expand those macros, and then evaluate the code that the macro expands to. This is only possible because lisp code is written as s-expressions (lists enclosed in parens). As a result, you don't find any grunt-work in lisp. No need to type semi-similar chunks of code over and over again when you can just invent new syntax for it. How powerful are macros? As one example, Clojure's function and macro definition operators are both macros that use the 'special form' (roughly a keyword) "def".
|
- Macros: Macros let you expand and redefine the syntax of the language itself. Think of it as having a hook into the interpreter... you get to write what feel like functions that return lisp expressions, and the interpreter will expand those macros, and then evaluate the code that the macro expands to. This is only possible because lisp code is written as s-expressions (lists enclosed in parens). As a result, you don't find any grunt-work in lisp. No need to type semi-similar chunks of code over and over again when you can just invent new syntax for it. How powerful are macros? As one example, Clojure's function and macro definition operators are both macros that use the 'special form' (roughly a keyword) "def".
|
||||||
@@ -75,47 +78,53 @@ If you know python, this document may be of particular interest to you: http://n
|
|||||||
## Learning resources, blogs, sources of information:
|
## Learning resources, blogs, sources of information:
|
||||||
|
|
||||||
### Common Lisp:
|
### Common Lisp:
|
||||||
- Practical Common Lisp (book available online): http://www.gigamonkeys.com/book/
|
|
||||||
- Land of Lisp: http://landoflisp.com/
|
- Practical Common Lisp (book available online): http://www.gigamonkeys.com/book/
|
||||||
- Common Lisp Hyperspec: http://clhs.lisp.se/
|
- Land of Lisp: http://landoflisp.com/
|
||||||
- Lisp koans: https://github.com/google/lisp-koans
|
- Common Lisp Hyperspec: http://clhs.lisp.se/
|
||||||
- Planet Lisp (blog aggregation): http://planet.lisp.org/
|
- Lisp koans: https://github.com/google/lisp-koans
|
||||||
- Common Lisp Wiki: https://cliki.net/
|
- Planet Lisp (blog aggregation): http://planet.lisp.org/
|
||||||
- Simplified common lisp reference: http://jtra.cz/stuff/lisp/sclr/index.html
|
- Common Lisp Wiki: https://cliki.net/
|
||||||
- Learning Lisp fast: https://cs.gmu.edu/~sean/lisp/LispTutorial.html
|
- Simplified common lisp reference: http://jtra.cz/stuff/lisp/sclr/index.html
|
||||||
- Articulate common lisp (a website that tries to cover beginner topics with fewer hard opinions): http://articulate-lisp.com/
|
- Learning Lisp fast: https://cs.gmu.edu/~sean/lisp/LispTutorial.html
|
||||||
- State of the common lisp ecosystem, 2015: http://borretti.me/article/common-lisp-sotu-2015
|
- Articulate common lisp (a website that tries to cover beginner topics with fewer hard opinions): http://articulate-lisp.com/
|
||||||
- Lisp subreddit: https://www.reddit.com/r/lisp/
|
- State of the common lisp ecosystem, 2015: http://borretti.me/article/common-lisp-sotu-2015
|
||||||
- Wikipedia article on CAR and CDR (a central concept in lisp lists): https://en.wikipedia.org/wiki/CAR_and_CDR
|
- Lisp subreddit: https://www.reddit.com/r/lisp/
|
||||||
- http://random-state.net/files/nikodemus-cl-faq.html
|
- Wikipedia article on CAR and CDR (a central concept in lisp lists): https://en.wikipedia.org/wiki/CAR_and_CDR
|
||||||
|
- http://random-state.net/files/nikodemus-cl-faq.html
|
||||||
|
|
||||||
### Clojure(Script):
|
### Clojure(Script):
|
||||||
- "Clojure for the Brave and True", a book somewhat akin to 'Automate the boring stuff', but aimed at Clojure: https://www.braveclojure.com/
|
|
||||||
- Clojure Homepage: https://clojure.org/api/cheatsheet
|
- "Clojure for the Brave and True", a book somewhat akin to 'Automate the boring stuff', but aimed at Clojure: https://www.braveclojure.com/
|
||||||
- Clojure GitHub: https://clojure.github.io/clojure/
|
- Clojure Homepage: https://clojure.org/api/cheatsheet
|
||||||
- Katas: https://github.com/marshallshen/clojure-katas
|
- Clojure GitHub: https://clojure.github.io/clojure/
|
||||||
- Koans: https://github.com/functional-koans/clojure-koans
|
- Katas: https://github.com/marshallshen/clojure-katas
|
||||||
- 4Clojure - a set of 150+ problems for practicing clojure, with interpretting and tests on the page: https://www.4clojure.com/
|
- Koans: https://github.com/functional-koans/clojure-koans
|
||||||
- Clojure subreddit: https://www.reddit.com/r/Clojure/
|
- 4Clojure - a set of 150+ problems for practicing clojure, with interpretting and tests on the page: https://www.4clojure.com/
|
||||||
- Stand up a simple web app in Clojure: http://clojure-doc.org/articles/tutorials/basic_web_development.html
|
- Clojure subreddit: https://www.reddit.com/r/Clojure/
|
||||||
- An article explaining the basics of laziness available in Clojure: http://clojure-doc.org/articles/language/laziness.html
|
- Stand up a simple web app in Clojure: http://clojure-doc.org/articles/tutorials/basic_web_development.html
|
||||||
|
- An article explaining the basics of laziness available in Clojure: http://clojure-doc.org/articles/language/laziness.html
|
||||||
|
|
||||||
### Scheme:
|
### Scheme:
|
||||||
- Probably the de facto guide to Scheme is known as SICP - "Structure and Interpretation of Computer Programs". This is a book written by a couple of MIT professors, which was used as a textbook for introductory programming courses. It uses Scheme to teach principals of programming. It should probably be noted that this book and these courses are not focused on teaching Scheme (they cover the majority of the Scheme language in the first lecture/chapter) - they're focused on teaching computer programming concepts, and Scheme is just the language used to express those concepts.
|
|
||||||
- The SICP book online (freely available): https://mitpress.mit.edu/sites/default/files/sicp/index.html
|
- Probably the de facto guide to Scheme is known as SICP - "Structure and Interpretation of Computer Programs". This is a book written by a couple of MIT professors, which was used as a textbook for introductory programming courses. It uses Scheme to teach principals of programming. It should probably be noted that this book and these courses are not focused on teaching Scheme (they cover the majority of the Scheme language in the first lecture/chapter) - they're focused on teaching computer programming concepts, and Scheme is just the language used to express those concepts.
|
||||||
- 2004 MIT SICP course playlist (higher quality, standalone video): https://www.youtube.com/playlist?list=PL7BcsI5ueSNFPCEisbaoQ0kXIDX9rR5FF
|
- The SICP book online (freely available): https://mitpress.mit.edu/sites/default/files/sicp/index.html
|
||||||
- The 2010 UC Berkeley SICP course (recorded in classroom, somewhat lower fidelity): https://www.youtube.com/playlist?list=PLhMnuBfGeCDNgVzLPxF9o5UNKG1b-LFY9
|
- 2004 MIT SICP course playlist (higher quality, standalone video): https://www.youtube.com/playlist?list=PL7BcsI5ueSNFPCEisbaoQ0kXIDX9rR5FF
|
||||||
|
- The 2010 UC Berkeley SICP course (recorded in classroom, somewhat lower fidelity): https://www.youtube.com/playlist?list=PLhMnuBfGeCDNgVzLPxF9o5UNKG1b-LFY9
|
||||||
|
|
||||||
### Racket:
|
### Racket:
|
||||||
|
|
||||||
- The jumping-off point for Racket info (documentation, tools, getting started, etc) is https://racket-lang.org/.
|
- The jumping-off point for Racket info (documentation, tools, getting started, etc) is https://racket-lang.org/.
|
||||||
|
|
||||||
### IDEs/editors:
|
### IDEs/editors:
|
||||||
|
|
||||||
- Lisps in general: Emacs - Emacs has been called "a great operating system, lacking only a decent editor". The Emacs community has a lot of lispers, partially because Emacs plugin are written mostly in ELisp - a dialect of Lisp that is at the core of Emacs' extendability. As such, many Lisps have Emacs packages for editing, running, debugging, project maintenance, etc, and Emacs has packages for version control, file/directory management, and even things like personal organization (basically all done in text buffers).
|
- Lisps in general: Emacs - Emacs has been called "a great operating system, lacking only a decent editor". The Emacs community has a lot of lispers, partially because Emacs plugin are written mostly in ELisp - a dialect of Lisp that is at the core of Emacs' extendability. As such, many Lisps have Emacs packages for editing, running, debugging, project maintenance, etc, and Emacs has packages for version control, file/directory management, and even things like personal organization (basically all done in text buffers).
|
||||||
|
|
||||||
- Common Lisp: Emacs with SLIME, Vim with SLIMV, Portacle (kinda), LispWorks, Allegro CL.
|
- Common Lisp: Emacs with SLIME, Vim with SLIMV, Portacle (kinda), LispWorks, Allegro CL.
|
||||||
|
|
||||||
- Clojure: Nightcode, Light Table, IntelliJ Cursive, Eclipse with counterclockwise, Emacs with CIDER, VIM with Fireplace.
|
- Clojure: Nightcode, Light Table, IntelliJ Cursive, Eclipse with counterclockwise, Emacs with CIDER, VIM with Fireplace.
|
||||||
|
|
||||||
- Racket: By default, Racket comes with DrRacket, an IDE with extensive documentation of the language
|
- Racket: By default, Racket comes with DrRacket, an IDE with extensive documentation of the language
|
||||||
|
|
||||||
## Other resources:
|
## Other resources:
|
||||||
|
|
||||||
|
|||||||
@@ -11,11 +11,13 @@ Sqlite is a small self-contained SQL database engine written in ANSI C. It allow
|
|||||||
It is commonly embedded either into an operating system or an application to store data for querying against without running a full DBMS.
|
It is commonly embedded either into an operating system or an application to store data for querying against without running a full DBMS.
|
||||||
|
|
||||||
Sqlite has some rather attractive features that make it a good choice for many situations, those situations include;
|
Sqlite has some rather attractive features that make it a good choice for many situations, those situations include;
|
||||||
|
|
||||||
- Storing a cache of data between application runs.
|
- Storing a cache of data between application runs.
|
||||||
- Storing relational data for querying either on disk or in ram.
|
- Storing relational data for querying either on disk or in ram.
|
||||||
- Being used as a stable format for long term storage.
|
- Being used as a stable format for long term storage.
|
||||||
|
|
||||||
This being said, Sqlite does have a few usecases it is unsuited for;
|
This being said, Sqlite does have a few usecases it is unsuited for;
|
||||||
|
|
||||||
- Being accessed directly by multiple users over the network.
|
- Being accessed directly by multiple users over the network.
|
||||||
- Petabyte scale data.
|
- Petabyte scale data.
|
||||||
- Highly concurrent reads and writes.
|
- Highly concurrent reads and writes.
|
||||||
@@ -50,12 +52,12 @@ sqlite>
|
|||||||
```
|
```
|
||||||
|
|
||||||
Before we start lets turn on some helpers (they make output prettier)
|
Before we start lets turn on some helpers (they make output prettier)
|
||||||
|
|
||||||
```
|
```
|
||||||
.headers on
|
.headers on
|
||||||
.mode column
|
.mode column
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
In here we can now execute our SQL commands.
|
In here we can now execute our SQL commands.
|
||||||
|
|
||||||
First we will create some tables
|
First we will create some tables
|
||||||
@@ -90,6 +92,7 @@ create unique index song_id_uindex
|
|||||||
This will create a simple database with two tables. Song and Artist, there is also a relationship between a song and its artist
|
This will create a simple database with two tables. Song and Artist, there is also a relationship between a song and its artist
|
||||||
|
|
||||||
Lets insert some data into the database now,
|
Lets insert some data into the database now,
|
||||||
|
|
||||||
```sql
|
```sql
|
||||||
INSERT INTO artist (id, name)
|
INSERT INTO artist (id, name)
|
||||||
VALUES (1, 'Billie Eilish');
|
VALUES (1, 'Billie Eilish');
|
||||||
@@ -115,6 +118,7 @@ Now we can start querying the database. First lets get all the songs.
|
|||||||
```sql
|
```sql
|
||||||
select * from song;
|
select * from song;
|
||||||
```
|
```
|
||||||
|
|
||||||
We will get back
|
We will get back
|
||||||
|
|
||||||
```
|
```
|
||||||
@@ -138,6 +142,7 @@ WHERE (select artist_id from artist where artist_name = 'The Beatles');
|
|||||||
```
|
```
|
||||||
|
|
||||||
This should return something like
|
This should return something like
|
||||||
|
|
||||||
```
|
```
|
||||||
sqlite> song_id artist_name title
|
sqlite> song_id artist_name title
|
||||||
...> ---------- ----------- ----------
|
...> ---------- ----------- ----------
|
||||||
@@ -151,6 +156,5 @@ Other than that this is a fully fledged SQL engine, so you can go to town trying
|
|||||||
|
|
||||||
## Resources
|
## Resources
|
||||||
|
|
||||||
* When to use SQLite: https://www.sqlite.org/whentouse.html
|
- When to use SQLite: https://www.sqlite.org/whentouse.html
|
||||||
* Documentation: https://www.sqlite.org/docs.html
|
- Documentation: https://www.sqlite.org/docs.html
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ title: What is Svelte?
|
|||||||
---
|
---
|
||||||
|
|
||||||
## What is Svelte?
|
## What is Svelte?
|
||||||
|
|
||||||
Svelte is a front-end technology similar in use to React, Vue, Angular, and the like. However, instead of loading a framework on the client-side, Svelte wires everything up during the build step, meaning it doesn't have to interpret any additional information at runtime. However, it's still in its relative infancy.
|
Svelte is a front-end technology similar in use to React, Vue, Angular, and the like. However, instead of loading a framework on the client-side, Svelte wires everything up during the build step, meaning it doesn't have to interpret any additional information at runtime. However, it's still in its relative infancy.
|
||||||
|
|
||||||
## When should you use Svelte?
|
## When should you use Svelte?
|
||||||
@@ -20,6 +21,7 @@ Svelte is a front-end technology similar in use to React, Vue, Angular, and the
|
|||||||
- If you don't need interactivity/data binding.
|
- If you don't need interactivity/data binding.
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
### Styling a component
|
### Styling a component
|
||||||
|
|
||||||
```html
|
```html
|
||||||
@@ -119,9 +121,7 @@ https://svelte.dev/examples#classes
|
|||||||
</label>
|
</label>
|
||||||
|
|
||||||
{#if visible}
|
{#if visible}
|
||||||
<p in:fly="{{ y: 200, duration: 2000 }}" out:fade>
|
<p in:fly="{{ y: 200, duration: 2000 }}" out:fade>Flies in, fades out</p>
|
||||||
Flies in, fades out
|
|
||||||
</p>
|
|
||||||
{/if}
|
{/if}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ Symfony is an Open Source full stack PHP framework for web applications and a se
|
|||||||
Symfony aims to speed up the creation and maintenance of web applications and to replace repetitive coding tasks. It's also aimed at building robust applications in an enterprise context and aims to give developers full control over the configuration.
|
Symfony aims to speed up the creation and maintenance of web applications and to replace repetitive coding tasks. It's also aimed at building robust applications in an enterprise context and aims to give developers full control over the configuration.
|
||||||
|
|
||||||
## Why should I use Symfony
|
## Why should I use Symfony
|
||||||
|
|
||||||
- Modularity, the core of Symfony is really small but as your needs grow you can easily install more components without having to refactor anything.
|
- Modularity, the core of Symfony is really small but as your needs grow you can easily install more components without having to refactor anything.
|
||||||
- Flexible architecture, you can customize pretty much anything ranging from folder structure to foreign libraries.
|
- Flexible architecture, you can customize pretty much anything ranging from folder structure to foreign libraries.
|
||||||
- Scalability, thanks to Symfony’s architecture no matter how big your application grows you can always keep extending it without having to worry about having to refactor your whole codebase.
|
- Scalability, thanks to Symfony’s architecture no matter how big your application grows you can always keep extending it without having to worry about having to refactor your whole codebase.
|
||||||
@@ -20,31 +21,39 @@ Symfony aims to speed up the creation and maintenance of web applications and to
|
|||||||
- There are a great set of 3rd party libraries that can be found at https://flex.symfony.com/
|
- There are a great set of 3rd party libraries that can be found at https://flex.symfony.com/
|
||||||
- You can build anything in it that meet the needs of any business, as long as it’s web based
|
- You can build anything in it that meet the needs of any business, as long as it’s web based
|
||||||
- Good documentation, everything you need to know is explained in steps in the documentation. It is filled to the brim with code snippets and explanations.
|
- Good documentation, everything you need to know is explained in steps in the documentation. It is filled to the brim with code snippets and explanations.
|
||||||
- Developing in Symfony is actually fun. Instead of writing low level code all day long you write relatively high level code without losing customizability and you will see your app progress really quickly without having to spend too much time thinking about things like folder structure, design patterns, naming conventions, etc since most of those things are taken care off already or can be found in the documentation.
|
- Developing in Symfony is actually fun. Instead of writing low level code all day long you write relatively high level code without losing customizability and you will see your app progress really quickly without having to spend too much time thinking about things like folder structure, design patterns, naming conventions, etc since most of those things are taken care off already or can be found in the documentation.
|
||||||
|
|
||||||
## How does Symfony compare to other solutions from a business perspective
|
## How does Symfony compare to other solutions from a business perspective
|
||||||
|
|
||||||
Symfony is not the solution with the most raw performance, this however does not mean it is slow by any means. However for most businesses cost effectiveness is more important. For robust enterprise applications Symfony is ahead in being more cost effective to host, maintain and develop which is one of the main reasons why it is chosen over other major full stack frameworks.
|
Symfony is not the solution with the most raw performance, this however does not mean it is slow by any means. However for most businesses cost effectiveness is more important. For robust enterprise applications Symfony is ahead in being more cost effective to host, maintain and develop which is one of the main reasons why it is chosen over other major full stack frameworks.
|
||||||
|
|
||||||
## What previous experience do you need before making optimal use of Symfony
|
## What previous experience do you need before making optimal use of Symfony
|
||||||
|
|
||||||
It is expected that you already know the basics of PHP, HTML, CSS and JS before starting a Symfony project. If you don’t know the basics of one of the 4 mentioned above you should first learn those before checking out Symfony. Advancing without any knowledge of these basics will hinder your experience with Symfony.
|
It is expected that you already know the basics of PHP, HTML, CSS and JS before starting a Symfony project. If you don’t know the basics of one of the 4 mentioned above you should first learn those before checking out Symfony. Advancing without any knowledge of these basics will hinder your experience with Symfony.
|
||||||
|
|
||||||
## What kind of functionality can you expect from Symfony
|
## What kind of functionality can you expect from Symfony
|
||||||
|
|
||||||
Symfony is a framework that works via a MVC pattern (https://en.wikipedia.org/wiki/Model–view–controller). Which means that you can define a route and after visiting that route a function in a controller class is called that returns a response.
|
Symfony is a framework that works via a MVC pattern (https://en.wikipedia.org/wiki/Model–view–controller). Which means that you can define a route and after visiting that route a function in a controller class is called that returns a response.
|
||||||
You write the controller functions yourself and you are free to write whatever functionality needed, as long as it returns a response which can be anything like html, json or even a file.
|
You write the controller functions yourself and you are free to write whatever functionality needed, as long as it returns a response which can be anything like html, json or even a file.
|
||||||
Some of the core components of Symfony are the: templating engine, ORM, mailer, logger, form generator, dummy data generator, PHPUnit for test, security component, yaml parser, the validator and Webpack Encore which is webpack with Symfony integration for all of your frontend dependencies. With Webpack Encore it is even possible to integrate Vue or React into your project by mounting it on a Twig template. If you decide to do this you will have to choose between using frontend routing or using Symfony’s own controller routing.
|
Some of the core components of Symfony are the: templating engine, ORM, mailer, logger, form generator, dummy data generator, PHPUnit for test, security component, yaml parser, the validator and Webpack Encore which is webpack with Symfony integration for all of your frontend dependencies. With Webpack Encore it is even possible to integrate Vue or React into your project by mounting it on a Twig template. If you decide to do this you will have to choose between using frontend routing or using Symfony’s own controller routing.
|
||||||
|
|
||||||
## Symfony as a backend framework
|
## Symfony as a backend framework
|
||||||
|
|
||||||
It is not required to use Symfony’s fullstack capabilities if you want to use Symfony. In fact, thanks to Symfony’s modularity you don’t even have to have the frontend components installed. If you want to make a REST API using Symfony then API Platform (https://api-platform.com/) will help you set one up really fast thanks to its good integration with Symfony. It integrates with the ORM and the validator. Everything is fully customizable if you decide to go for API Platform but you can still write your own endpoints manually if you need custom actions.
|
It is not required to use Symfony’s fullstack capabilities if you want to use Symfony. In fact, thanks to Symfony’s modularity you don’t even have to have the frontend components installed. If you want to make a REST API using Symfony then API Platform (https://api-platform.com/) will help you set one up really fast thanks to its good integration with Symfony. It integrates with the ORM and the validator. Everything is fully customizable if you decide to go for API Platform but you can still write your own endpoints manually if you need custom actions.
|
||||||
|
|
||||||
|
|
||||||
## Required tools you need to have set up before starting a Symfony project
|
## Required tools you need to have set up before starting a Symfony project
|
||||||
|
|
||||||
First off, it is required that you have Composer installed. Composer is a package manager for PHP, if you have never heard about it I’d strongly recommend you first study it up a bit before reading any further. You can download composer at https://getcomposer.org/download/, but you will first have to have a PHP executable before being able to install Composer. By using XAMPP you will get all the other tools you need to run a PHP web server, it comes bundled with Apache, MariaDB which is an open source fork of MySQL and PhpMyAdmin which is a database viewer and a couple of other handy tools for later. You can view what is included at their site: https://www.apachefriends.org/download.html, make sure you download the version for PHP 7.4. At the time of writing this spotlight PHP 8 is still rather new and a lot of important dependencies are not yet compatible with this version.
|
First off, it is required that you have Composer installed. Composer is a package manager for PHP, if you have never heard about it I’d strongly recommend you first study it up a bit before reading any further. You can download composer at https://getcomposer.org/download/, but you will first have to have a PHP executable before being able to install Composer. By using XAMPP you will get all the other tools you need to run a PHP web server, it comes bundled with Apache, MariaDB which is an open source fork of MySQL and PhpMyAdmin which is a database viewer and a couple of other handy tools for later. You can view what is included at their site: https://www.apachefriends.org/download.html, make sure you download the version for PHP 7.4. At the time of writing this spotlight PHP 8 is still rather new and a lot of important dependencies are not yet compatible with this version.
|
||||||
|
|
||||||
|
|
||||||
Now that we have the basic requirements installed for setting up any PHP project that uses dependencies we can proceed by installing the necessary tools to comfortably work with a Symfony project.
|
Now that we have the basic requirements installed for setting up any PHP project that uses dependencies we can proceed by installing the necessary tools to comfortably work with a Symfony project.
|
||||||
|
|
||||||
- The first thing we need to install would be the Symfony CLI (command line interface) which gives you commands that you will need when starting and running your project locally, it can be downloaded at: https://symfony.com/download.
|
- The first thing we need to install would be the Symfony CLI (command line interface) which gives you commands that you will need when starting and running your project locally, it can be downloaded at: https://symfony.com/download.
|
||||||
- The second most important thing that makes life really easy when working with Symfony is PhpStorm. If you are familiar with Jetbrains you might already know of this IDE. There are designated plugins for Symfony in PhpStorm that make working with Symfony really comfortable. If you are a student you should be able to get a student license for free, if not you will get a 30 days free trial and after that you can always buy it if you like it. You can download it at https://www.jetbrains.com/phpstorm/download/. It is fine to use a different IDE like VS Code, but keep in mind that PhpStorm will be used in the tutorials linked below.
|
- The second most important thing that makes life really easy when working with Symfony is PhpStorm. If you are familiar with Jetbrains you might already know of this IDE. There are designated plugins for Symfony in PhpStorm that make working with Symfony really comfortable. If you are a student you should be able to get a student license for free, if not you will get a 30 days free trial and after that you can always buy it if you like it. You can download it at https://www.jetbrains.com/phpstorm/download/. It is fine to use a different IDE like VS Code, but keep in mind that PhpStorm will be used in the tutorials linked below.
|
||||||
|
|
||||||
## Learning resources
|
## Learning resources
|
||||||
|
|
||||||
Official documentation: https://symfony.com/doc/current
|
Official documentation: https://symfony.com/doc/current
|
||||||
|
|
||||||
Official learning videos: https://symfonycasts.com/screencast/symfony
|
Official learning videos: https://symfonycasts.com/screencast/symfony
|
||||||
|
|||||||
@@ -8,53 +8,64 @@ title: What is Vim?
|
|||||||
---
|
---
|
||||||
|
|
||||||
## What is Vim?
|
## What is Vim?
|
||||||
|
|
||||||
Slated as the 'ubiquitous text editor', "Vim is a highly configurable text editor built to make creating and changing any kind of text very efficient." according to its website at <https://www.vim.org>. It is a command-based text editor, so instead of menus and icons, it relies solely on keybinds and commands a user can type into it.
|
Slated as the 'ubiquitous text editor', "Vim is a highly configurable text editor built to make creating and changing any kind of text very efficient." according to its website at <https://www.vim.org>. It is a command-based text editor, so instead of menus and icons, it relies solely on keybinds and commands a user can type into it.
|
||||||
|
|
||||||
## Where can I get Vim?
|
## Where can I get Vim?
|
||||||
|
|
||||||
See the official Vim website, at <https://www.vim.org/download.php>
|
See the official Vim website, at <https://www.vim.org/download.php>
|
||||||
Note: If you are using a UNIX-like operating system, you are very likely to have Vi (the precursor to Vim) installed, some GNU/Linux distributions alias vim-lite or vim.tiny to be vi. You can use Vi if you’re in a pinch and can’t install Vim, but it will not be as customizable as Vim
|
Note: If you are using a UNIX-like operating system, you are very likely to have Vi (the precursor to Vim) installed, some GNU/Linux distributions alias vim-lite or vim.tiny to be vi. You can use Vi if you’re in a pinch and can’t install Vim, but it will not be as customizable as Vim
|
||||||
|
|
||||||
## Why should I use Vim?
|
## Why should I use Vim?
|
||||||
Vim is a very powerful tool that can increase your productivity and efficiency when writing anything on your computer. There *is* a common misconception about Vim being difficult to use, and confusing to learn. However, Vim is surprisingly easy to pick up once you start to develop muscle memory, and even then, it is very simple to remap commands and such to other keybinds.
|
|
||||||
|
Vim is a very powerful tool that can increase your productivity and efficiency when writing anything on your computer. There _is_ a common misconception about Vim being difficult to use, and confusing to learn. However, Vim is surprisingly easy to pick up once you start to develop muscle memory, and even then, it is very simple to remap commands and such to other keybinds.
|
||||||
|
|
||||||
## Some of the benefits of using Vim include:
|
## Some of the benefits of using Vim include:
|
||||||
- As the website suggests, Vim is *very* configurable and extensible. With a wealth of extensions and very easily picked-up configuration/scripting language, it can become any type of text editor you need.
|
|
||||||
|
- As the website suggests, Vim is _very_ configurable and extensible. With a wealth of extensions and very easily picked-up configuration/scripting language, it can become any type of text editor you need.
|
||||||
- Once you start to develop muscle memory for it, you can become incredibly quick at editing, especially when compared to something like Emacs, as the default keybinds are simple, like "dd" to delete a line.
|
- Once you start to develop muscle memory for it, you can become incredibly quick at editing, especially when compared to something like Emacs, as the default keybinds are simple, like "dd" to delete a line.
|
||||||
- Vim has plugins for everything from fuzzy search to code completion to prose editing, but even then, provides a lot of features you would want out of the box.
|
- Vim has plugins for everything from fuzzy search to code completion to prose editing, but even then, provides a lot of features you would want out of the box.
|
||||||
- Vim is very light and will run on basically any computer from the last 25 years
|
- Vim is very light and will run on basically any computer from the last 25 years
|
||||||
|
|
||||||
## What are Modes?
|
## What are Modes?
|
||||||
|
|
||||||
Vim is a “modal” editor, as opposed to a “non-modal” editor like Emacs, or Notepad. Vim’s “modes” are meant to act as finely tuned tools for interacting with documents. Some examples of modes include but are not limited to:
|
Vim is a “modal” editor, as opposed to a “non-modal” editor like Emacs, or Notepad. Vim’s “modes” are meant to act as finely tuned tools for interacting with documents. Some examples of modes include but are not limited to:
|
||||||
|
|
||||||
- Normal mode: Where you will type in your commands and do most of your keybinds
|
- Normal mode: Where you will type in your commands and do most of your keybinds
|
||||||
- Insert mode: The mode in which you can input text into the currently opened file
|
- Insert mode: The mode in which you can input text into the currently opened file
|
||||||
- Visual mode: Allows you to make selections in your files and perform actions on them, like running commands in normal mode, but for groups of text.
|
- Visual mode: Allows you to make selections in your files and perform actions on them, like running commands in normal mode, but for groups of text.
|
||||||
|
|
||||||
## But how do I exit this thing?!
|
## But how do I exit this thing?!
|
||||||
Exiting is actually incredibly simple. First, get into normal mode, you’ll know you’re in normal mode when the h,j,k, and l keys move the cursor around the document, you should try to use those keys instead of your arrow keys to navigate. If you are not in normal mode, simply press the escape (Esc) key on your keyboard. In normal mode, simply type `:q`.
|
|
||||||
|
Exiting is actually incredibly simple. First, get into normal mode, you’ll know you’re in normal mode when the h,j,k, and l keys move the cursor around the document, you should try to use those keys instead of your arrow keys to navigate. If you are not in normal mode, simply press the escape (Esc) key on your keyboard. In normal mode, simply type `:q`.
|
||||||
|
|
||||||
If you want to save and exit, type`:wq`.
|
If you want to save and exit, type`:wq`.
|
||||||
If you want to forcibly save and exit, type `:wq!`.
|
If you want to forcibly save and exit, type `:wq!`.
|
||||||
|
|
||||||
So yes, people who post *that meme* are wrong. Exiting vim is easy.
|
So yes, people who post _that meme_ are wrong. Exiting vim is easy.
|
||||||
If any of this confuses you, press Control-C twice and follow what the prompt tells you.
|
If any of this confuses you, press Control-C twice and follow what the prompt tells you.
|
||||||
|
|
||||||
## Configuring your Vim
|
## Configuring your Vim
|
||||||
|
|
||||||
While Vim comes with some reasonable defaults out of the box, a lot of people will no doubt find issues with them, and seek to modify/disable certain features. Luckily for those people, Vim is shockingly easy to configure.
|
While Vim comes with some reasonable defaults out of the box, a lot of people will no doubt find issues with them, and seek to modify/disable certain features. Luckily for those people, Vim is shockingly easy to configure.
|
||||||
|
|
||||||
For example, to enable line numbering, you can simply add `set number` to your vimrc
|
For example, to enable line numbering, you can simply add `set number` to your vimrc
|
||||||
(`~/.vimrc` or `~/.config/nvim/init.vim` on UNIX-like operating systems depending on if you’re using Vim or Neovim)
|
(`~/.vimrc` or `~/.config/nvim/init.vim` on UNIX-like operating systems depending on if you’re using Vim or Neovim)
|
||||||
|
|
||||||
## Some examples of configuration options:
|
## Some examples of configuration options:
|
||||||
|
|
||||||
```viml
|
```viml
|
||||||
set number “ enables the line number column
|
set number “ enables the line number column
|
||||||
set relativenumber “ makes the numbers in the number column be relative to the cursor
|
set relativenumber “ makes the numbers in the number column be relative to the cursor
|
||||||
set shiftwidth=2 tabstop=2 expandtab “ use 2-space indents with <tab>
|
set shiftwidth=2 tabstop=2 expandtab “ use 2-space indents with <tab>
|
||||||
```
|
```
|
||||||
|
|
||||||
If you want plugins, there's a large amount of ways to install those, too. Vim 8 comes with its own package manager as standard, but you can also any of the many community-built plugin managers out there like [vim-plug](https://github.com/junegunn/vim-plug) and [Vundle](https://github.com/VundleVim/Vundle.vim).
|
If you want plugins, there's a large amount of ways to install those, too. Vim 8 comes with its own package manager as standard, but you can also any of the many community-built plugin managers out there like [vim-plug](https://github.com/junegunn/vim-plug) and [Vundle](https://github.com/VundleVim/Vundle.vim).
|
||||||
|
|
||||||
If you want code completion, you can try packages like the humorously-named Coc.nvim (which stands for "Conquer of Completion", and can be found at https://github.com/neoclide/coc.nvim), or the more robust and well-known (though slightly less able) [YouCompleteMe](https://github.com/ycm-core/YouCompleteMe).
|
If you want code completion, you can try packages like the humorously-named Coc.nvim (which stands for "Conquer of Completion", and can be found at https://github.com/neoclide/coc.nvim), or the more robust and well-known (though slightly less able) [YouCompleteMe](https://github.com/ycm-core/YouCompleteMe).
|
||||||
|
|
||||||
## Try out vim without trying out vim
|
## Try out vim without trying out vim
|
||||||
|
|
||||||
Vim has been around for such a long time that the ideas exist in a plethora of tools outside this editor. Many modern IDEs/Text Editors like VSCode and Jetbrains have vim plugins available (called VSCodeVim, IdeaVim emulate key vim features), and whilst they’re not a complete set of what vim does, it has most of the core bindings and it goes to show the sheer community support available once you learn this tool. Emacs has a vast array of EVIL (Extensible Vi Layer) plugins, including popular vim plugins like vim surround.
|
Vim has been around for such a long time that the ideas exist in a plethora of tools outside this editor. Many modern IDEs/Text Editors like VSCode and Jetbrains have vim plugins available (called VSCodeVim, IdeaVim emulate key vim features), and whilst they’re not a complete set of what vim does, it has most of the core bindings and it goes to show the sheer community support available once you learn this tool. Emacs has a vast array of EVIL (Extensible Vi Layer) plugins, including popular vim plugins like vim surround.
|
||||||
|
|
||||||
Forks of vim also exist that tackle certain issues like async, such as Neovim (which you can look at here: https://github.com/neovim/neovim). Even popular web browsers have vim extensions. Google Chrome has vimium, that has navigational style single-key commands, and you can exclude certain websites from using it. Firefox has vimperator, and Safari has Vimari. Certain apps have vim style bindings like the feedly RSS app and Todoist on google chrome with the todoist-shortcuts extension (https://github.com/mgsloan/todoist-shortcuts).
|
Forks of vim also exist that tackle certain issues like async, such as Neovim (which you can look at here: https://github.com/neovim/neovim). Even popular web browsers have vim extensions. Google Chrome has vimium, that has navigational style single-key commands, and you can exclude certain websites from using it. Firefox has vimperator, and Safari has Vimari. Certain apps have vim style bindings like the feedly RSS app and Todoist on google chrome with the todoist-shortcuts extension (https://github.com/mgsloan/todoist-shortcuts).
|
||||||
@@ -62,6 +73,7 @@ Forks of vim also exist that tackle certain issues like async, such as Neovim (w
|
|||||||
In fact, if you use Neovim, some editors even allow you to embed it into them, running your own configuration & using your customizations. For example, the VSCode extension “Neo Vim”.
|
In fact, if you use Neovim, some editors even allow you to embed it into them, running your own configuration & using your customizations. For example, the VSCode extension “Neo Vim”.
|
||||||
|
|
||||||
## Resources
|
## Resources
|
||||||
|
|
||||||
- Vim's built-in vimtutor is great for learning the basics, which you can access by calling `:vimtutor` from within the editor.
|
- Vim's built-in vimtutor is great for learning the basics, which you can access by calling `:vimtutor` from within the editor.
|
||||||
- https://github.com/kevinSuttle/learn-vim
|
- https://github.com/kevinSuttle/learn-vim
|
||||||
- https://www.youtube.com/channel/UC8ENHE5xdFSwx71u3fDH5Xw (high energy vim enthusiast who does a ton of tutorial videos for it)
|
- https://www.youtube.com/channel/UC8ENHE5xdFSwx71u3fDH5Xw (high energy vim enthusiast who does a ton of tutorial videos for it)
|
||||||
@@ -71,5 +83,6 @@ In fact, if you use Neovim, some editors even allow you to embed it into them, r
|
|||||||
- https://vim-adventures.com/quiz/ (this is a test to see if you know vim well to cleanup this board in the least keystrokes possible)
|
- https://vim-adventures.com/quiz/ (this is a test to see if you know vim well to cleanup this board in the least keystrokes possible)
|
||||||
|
|
||||||
## Paid Resources
|
## Paid Resources
|
||||||
|
|
||||||
- Modern Vim: https://pragprog.com/titles/modvim/
|
- Modern Vim: https://pragprog.com/titles/modvim/
|
||||||
- Vim Adventures: https://vim-adventures.com/
|
- Vim Adventures: https://vim-adventures.com/
|
||||||
@@ -15,11 +15,12 @@ Windows Subsystem For Linux, or simply, WSL is a compatibility layer for running
|
|||||||
|
|
||||||
By this point you might be thinking that WSL is basically a virtual machine, and I’ve seen a lot of people think the same thing when I see it being discussed but WSL and a VM are very different.
|
By this point you might be thinking that WSL is basically a virtual machine, and I’ve seen a lot of people think the same thing when I see it being discussed but WSL and a VM are very different.
|
||||||
A VM is isolated, slow to boot and consumes more of your precious resources. Unlike a VM, WSL also integrates well with Windows, meaning you can use your Windows tools alongside Linux
|
A VM is isolated, slow to boot and consumes more of your precious resources. Unlike a VM, WSL also integrates well with Windows, meaning you can use your Windows tools alongside Linux
|
||||||
|
|
||||||
- https://docs.microsoft.com/en-us/windows/wsl/faq#why-would-i-use-wsl-rather-than-linux-in-a-vm-
|
- https://docs.microsoft.com/en-us/windows/wsl/faq#why-would-i-use-wsl-rather-than-linux-in-a-vm-
|
||||||
|
|
||||||
## What is the difference between WSL1 and WSL2?
|
## What is the difference between WSL1 and WSL2?
|
||||||
|
|
||||||
WSL1 is the older version of WSL. It essentially just allows you to run Linux applications on Windows 10 *as a new Windows process*. WSL2 on the other hand allows for a far greater integration as it has a Microsoft Linux kernel which allows you to use a larger set of commands which wouldn't have been possible on WSL1.
|
WSL1 is the older version of WSL. It essentially just allows you to run Linux applications on Windows 10 _as a new Windows process_. WSL2 on the other hand allows for a far greater integration as it has a Microsoft Linux kernel which allows you to use a larger set of commands which wouldn't have been possible on WSL1.
|
||||||
WSL2 uses a Linux kernel built by Microsoft based on the latest stable branch of the Linux kernel with special modifications to facilitate running on Windows while keeping in mind size and performance. The kernel is open source if you want to take a look: https://github.com/microsoft/WSL2-Linux-Kernel
|
WSL2 uses a Linux kernel built by Microsoft based on the latest stable branch of the Linux kernel with special modifications to facilitate running on Windows while keeping in mind size and performance. The kernel is open source if you want to take a look: https://github.com/microsoft/WSL2-Linux-Kernel
|
||||||
Generally, it is recommended that you use WSL2 rather than WSL1 but in some cases you'll be better off using WSL1 over WSL2. You can read more about which one you should use here: https://docs.microsoft.com/en-us/windows/wsl/compare-versions#exceptions-for-using-wsl-1-rather-than-wsl-2
|
Generally, it is recommended that you use WSL2 rather than WSL1 but in some cases you'll be better off using WSL1 over WSL2. You can read more about which one you should use here: https://docs.microsoft.com/en-us/windows/wsl/compare-versions#exceptions-for-using-wsl-1-rather-than-wsl-2
|
||||||
If you're interested in the underlying technology, Microsoft's DevBlogs is a good place to start: https://devblogs.microsoft.com/commandline/a-deep-dive-into-how-wsl-allows-windows-to-access-linux-files/
|
If you're interested in the underlying technology, Microsoft's DevBlogs is a good place to start: https://devblogs.microsoft.com/commandline/a-deep-dive-into-how-wsl-allows-windows-to-access-linux-files/
|
||||||
@@ -27,10 +28,11 @@ If you're interested in the underlying technology, Microsoft's DevBlogs is a goo
|
|||||||
## Cool! How do I install this?
|
## Cool! How do I install this?
|
||||||
|
|
||||||
WSL is really very easy to install! Follow the steps in Microsoft’s official documentation and you'll be done installing this in a couple of minutes (note the minimum requirements for running WSL2, i.e. version number and build number).
|
WSL is really very easy to install! Follow the steps in Microsoft’s official documentation and you'll be done installing this in a couple of minutes (note the minimum requirements for running WSL2, i.e. version number and build number).
|
||||||
|
|
||||||
- https://docs.microsoft.com/en-us/windows/wsl/install-win10
|
- https://docs.microsoft.com/en-us/windows/wsl/install-win10
|
||||||
There are multiple distributions available on the Microsoft Store including but not limited to some versions of Ubuntu, Debian and Kali Linux.
|
There are multiple distributions available on the Microsoft Store including but not limited to some versions of Ubuntu, Debian and Kali Linux.
|
||||||
If you want to work with a Linux distribution not already on the Microsoft Store, follow this link: https://docs.microsoft.com/en-us/windows/wsl/use-custom-distro. You can also build your own Linux distro: https://docs.microsoft.com/en-us/windows/wsl/build-custom-distro
|
If you want to work with a Linux distribution not already on the Microsoft Store, follow this link: https://docs.microsoft.com/en-us/windows/wsl/use-custom-distro. You can also build your own Linux distro: https://docs.microsoft.com/en-us/windows/wsl/build-custom-distro
|
||||||
Now that you are done with installing WSL, its time to start working with it! The best part of WSL is that you can use it just like you would use and work with a regular Linux command-line. It uses the same commands as Linux and it works pretty damn well.
|
Now that you are done with installing WSL, its time to start working with it! The best part of WSL is that you can use it just like you would use and work with a regular Linux command-line. It uses the same commands as Linux and it works pretty damn well.
|
||||||
|
|
||||||
## Working with WSL
|
## Working with WSL
|
||||||
|
|
||||||
@@ -54,8 +56,9 @@ If you use network applications and want to access a Linux network app from Wind
|
|||||||
Since WSL installs a brand new filesystem separate from Windows' NTFS, you will need to install your CLI apps like git on both Windows and your WSL distro(s) if you want to use it in both places.
|
Since WSL installs a brand new filesystem separate from Windows' NTFS, you will need to install your CLI apps like git on both Windows and your WSL distro(s) if you want to use it in both places.
|
||||||
**Note:** if you want a cleaner and more customizable UI than PowerShell's or WSL’s (or CMD, if you use that) default terminal emulator, I recommend getting Windows Terminal from Microsoft Store: <https://aka.ms/terminal>
|
**Note:** if you want a cleaner and more customizable UI than PowerShell's or WSL’s (or CMD, if you use that) default terminal emulator, I recommend getting Windows Terminal from Microsoft Store: <https://aka.ms/terminal>
|
||||||
|
|
||||||
### Bonus Bonus Bonus - Linux GUI apps on WSL**
|
### Bonus Bonus Bonus - Linux GUI apps on WSL\*\*
|
||||||
Remember how I said WSL does not support Linux GUI apps before? Well, I *might* have forgotten to add the word "officially" because there is a way to run Linux GUI apps on WSL. (Note that the steps below are for WSL2, not WSL1).
|
|
||||||
|
Remember how I said WSL does not support Linux GUI apps before? Well, I _might_ have forgotten to add the word "officially" because there is a way to run Linux GUI apps on WSL. (Note that the steps below are for WSL2, not WSL1).
|
||||||
Text guide: <https://medium.com/@dhanar.santika/installing-wsl-with-gui-using-vcxsrv-6f307e96fac0>
|
Text guide: <https://medium.com/@dhanar.santika/installing-wsl-with-gui-using-vcxsrv-6f307e96fac0>
|
||||||
Video guide: <https://www.youtube.com/watch?v=4SZXbl9KVsw>
|
Video guide: <https://www.youtube.com/watch?v=4SZXbl9KVsw>
|
||||||
|
|
||||||
|
|||||||
@@ -6,13 +6,17 @@ title: What is Zsh?
|
|||||||
---
|
---
|
||||||
|
|
||||||
## What is Zsh?
|
## What is Zsh?
|
||||||
|
|
||||||
Zsh, or Z Shell, is a popular alternative shell that extends the most common one, bash. It supports history enhancements, path expansion, environment variable expansion, improved tab completion, improved globbing (searching files), and hundreds more. Zsh has too many features to list here. For a developer, zsh can save tons of time while using a terminal window.
|
Zsh, or Z Shell, is a popular alternative shell that extends the most common one, bash. It supports history enhancements, path expansion, environment variable expansion, improved tab completion, improved globbing (searching files), and hundreds more. Zsh has too many features to list here. For a developer, zsh can save tons of time while using a terminal window.
|
||||||
|
|
||||||
## When should I use Zsh?
|
## When should I use Zsh?
|
||||||
|
|
||||||
If you use a terminal often, zsh can be extremely helpful. The multitude of utilities built into zsh by default alongside being able to add plugins allows anyone to customise zsh to their personal needs.
|
If you use a terminal often, zsh can be extremely helpful. The multitude of utilities built into zsh by default alongside being able to add plugins allows anyone to customise zsh to their personal needs.
|
||||||
|
|
||||||
## When shouldn't I use Zsh?
|
## When shouldn't I use Zsh?
|
||||||
|
|
||||||
For developers who you switch between/across multiple computers, setting up Zsh on each machine multiple times can be time-consuming, and thus leading to inconsistent behaviour over multiple machines with some using Zsh, and others using a different shell. If you don't work often with the terminal, installing Zsh may not be necessary.
|
For developers who you switch between/across multiple computers, setting up Zsh on each machine multiple times can be time-consuming, and thus leading to inconsistent behaviour over multiple machines with some using Zsh, and others using a different shell. If you don't work often with the terminal, installing Zsh may not be necessary.
|
||||||
|
|
||||||
## Special Features
|
## Special Features
|
||||||
|
|
||||||
Zsh has many features and community-made extensions that make it an extremely attractive shell for users. Among extensions, Oh My ZSH is by far the most popular, with hundreds of plugins and themes to extend the functionality and improve the look of Zsh. Oh My ZSH has even inspired similar frameworks for bash, such as Oh My Bash, and Bash It, but with much less robust community support. Other integrations also offer automatic suggestions, mouse support, plugin management, and more.
|
Zsh has many features and community-made extensions that make it an extremely attractive shell for users. Among extensions, Oh My ZSH is by far the most popular, with hundreds of plugins and themes to extend the functionality and improve the look of Zsh. Oh My ZSH has even inspired similar frameworks for bash, such as Oh My Bash, and Bash It, but with much less robust community support. Other integrations also offer automatic suggestions, mouse support, plugin management, and more.
|
||||||
+1
-4
@@ -17,10 +17,7 @@ function BotPage({ data }: ComponentQuery<{ md: Mdx }>) {
|
|||||||
return (
|
return (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<SEO title="BOTS" />
|
<SEO title="BOTS" />
|
||||||
<HeaderBarebone
|
<HeaderBarebone title="Bots" className={cx({ shifted: toc.length })} />
|
||||||
title="Bots"
|
|
||||||
className={cx({ shifted: toc.length })}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<PageContent content={<Markdown content={md.body!} />} toc={toc} />
|
<PageContent content={<Markdown content={md.body!} />} toc={toc} />
|
||||||
</Fragment>
|
</Fragment>
|
||||||
|
|||||||
@@ -16,14 +16,8 @@ import { buildToc } from "../utils"
|
|||||||
const ResourcePage: FC<any> = ({ data }) => {
|
const ResourcePage: FC<any> = ({ data }) => {
|
||||||
const { current: language } = useSidebar()
|
const { current: language } = useSidebar()
|
||||||
const { relativePath } = data.file
|
const { relativePath } = data.file
|
||||||
const {
|
const { body, headings, excerpt, fields, frontmatter, timeToRead } =
|
||||||
body,
|
data.file.post
|
||||||
headings,
|
|
||||||
excerpt,
|
|
||||||
fields,
|
|
||||||
frontmatter,
|
|
||||||
timeToRead,
|
|
||||||
} = data.file.post
|
|
||||||
|
|
||||||
const toc = buildToc(headings)
|
const toc = buildToc(headings)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user