Skip to content

Commit 5eafc0a

Browse files
committed
Adding more documentation and helpful notes
1 parent 1a815d9 commit 5eafc0a

File tree

11 files changed

+213
-36
lines changed

11 files changed

+213
-36
lines changed

Apache/configure-apache2.md

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
In Apache2, you need to have an apache2.conf in /etc/apache2
2+
3+
Apache2 generally requires the use of systemd, which is quite sad.
4+
5+
If you use SysVinit, in order to check status, restart, etc. you need to issue
6+
7+
sudo /etc/init.d/apache2 restart
8+
sudo /etc/init.d/apache2 status
9+
10+
Apache2 logs go into /var/log/apache2
11+
12+
The /var/log/apache2 needs to have the right owner and permissions.
13+
14+
check to see if it is
15+
16+
`ls -ld /var/log/apache2/`
17+
18+
drwxrwxr-x 2 www-data www-data 4096 Apr 16 14:27 /var/log/apache2/
19+
20+
if it is not, just issue this command
21+
22+
`sudo chown www-data:www-data /var/log/apache2/`
23+
24+
also change the perms using
25+
26+
`sudo chmod g+rw /var/log/apache2/`
27+
28+
Logs may not work if you tail them with
29+
30+
`sudo tail /var/log/apache2/error_log`
31+
32+
if that does not work you can
33+
34+
`sudo cat /var/log/apache2/error.log`
35+
36+
The logs it should create are:
37+
38+
access.log
39+
error.log
40+
other_vhosts_access.log
41+
42+
site code goes in:
43+
44+
/var/www/html
45+
/var/www
46+
/public_html
47+
/usr/share (for WebApps)
48+
49+
navigate your favorite browser to localhost: and you should see the Apache2 template page
50+

Databases/connect-to-psql.md

+30-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# Connecting to PostgreSQL.
12

23
To connect to PostgreSQL, the command in the console/terminal/shell is `psql -U postgres`
34

@@ -23,8 +24,35 @@ The PostgreSQL port is 5432
2324

2425
`sudo -u postgres createuser --interactive --pwprompt` will use the interative prompts to create a user.
2526

26-
The PostgreSQL has several configuration files:
27+
The PostgreSQL has a couple configuration files:
2728

2829
- pg_hba.conf
2930
- postgresql.conf
30-
-
31+
32+
The config files live in /var/lib/postgresql
33+
34+
This path is usually followed by the version number. Look in the following /data directory for the *two .conf files.
35+
36+
Client configs locally may probably be stored in ~/.psqlrc
37+
38+
## configuration files
39+
40+
- postgresql.conf
41+
42+
There are some parameters that this file uses:
43+
44+
- listen_addresses:
45+
- port:
46+
- shared_buffers:
47+
- max-connections:
48+
- authentication_methods:
49+
- pg_hba_conf
50+
- log_level
51+
- log_line_prefix
52+
- log_destination
53+
54+
There are others. Refer to the official configuration documents.
55+
56+
- pg_hba.conf
57+
58+
This file is mainly used for securing PostgreSQL. It's essentially a list who & what can access the database

Docker/dockerfiles.md

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1-
# Creating a `Dockerfile`
1+
# About Docker
2+
3+
## Configuring Docker
4+
5+
In order to configure Docker, there are several files that will be needed, depending how you want to use Docker.
6+
7+
docker-compose.yml
8+
.dockerignore
9+
Dockerfile
10+
devcontainer.json
11+
12+
## Creating a `Dockerfile`
213

314
A `Dockerfile` is a text file that contains a set of instructions for building a Docker image. It is used to automate the process of creating a Docker image by specifying the base image, adding files, installing packages, and configuring the environment
415

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Debugging NodeJS
2+
3+
For VSCode you can start here for documentation:
4+
5+
<https://code.visualstudio.com/docs/nodejs/nodejs-debugging>
6+
7+
We typically use console.log for debugging in Node.JS.
8+
9+
`node debug script.js`
10+
11+
The official NodeJS debugging is here<https://nodejs.org/en/learn/getting-started/debugging>
12+
13+
you can also
14+
15+
`node --inspect your_script.js`
16+
17+
This starts your application (your_script.js) with debugging enabled on the default port (usually 9229).

Node_JavaScript_Programming/nodejs-server.md

Whitespace-only changes.

Python/debugging-python.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Debugging Python
2+
3+
Here are some tips for debugging Python.
4+

WebDevelopment/css.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ Typical CSS files that are used to contain global styles are `index.css` and `ap
5353

5454
In CSS, there are special characters:
5555

56-
- ";" is used to separate individual declarations in a style rule.
56+
- ";" is used to separate individual declarations in a style rule. They are required.
5757

5858
- "$" is not a valid character in CSS and is typically used in preprocessors like Sass for variables.
5959

60-
- "#" is used to denote an ID selector in CSS.
60+
- "#" is used to denote an ID selector in CSS. It targets the id="" in the line of html tag.
6161

6262
- "~" is used in CSS to select sibling elements that are preceded by a specified element.
6363

@@ -73,11 +73,11 @@ In CSS, there are special characters:
7373

7474
- "!" is used in CSS to denote the important flag, which gives a declaration higher priority.
7575

76-
- "{" and "}" are used to enclose the declarations within a style rule.
76+
- "{" and "}" are used to enclose the declarations within a style rule. This is required.
7777

7878
- ":" are used for pseudo-classes, which are used to define the special state of an element. For example, ":hover" is a pseudo-class that
7979
matches when the user designates an element (with some pointing device), but does not activate it. Another example is ":visited", which
80-
matches links that have been visited by the user.
80+
matches links that have been visited by the user. This is required.
8181

8282
- "::" are used for pseudo-elements, which are used to style specified parts of an element. For example, "::first-line" is a pseudo-element that matches the first formatted line of a paragraph.
8383

@@ -90,6 +90,8 @@ matches links that have been visited by the user.
9090

9191
- "*" is used as the universal selector in CSS to select any element.
9292

93+
- "--" double hyphen is used in CSS variables for custom declarations of variable names inside a var().
94+
9395
There are various types of selectors in CSS that are used to target HTML elements for styling. Some of the key types of selectors include
9496

9597
- Type selectors: Select elements based on their element type (e.g., p for paragraphs, h1 for headings).

WebDevelopment/html.md

+32-1
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,35 @@ These are some of the things I have learned doing web development and creating .
1212

1313
Hopefully this will help you with some baseline knowledge, that may at least help you debug some issues.
1414

15-
First of all, we will need to
15+
First of all, we will need to
16+
17+
## HTML 5 symantic tags
18+
19+
`<nav>`
20+
`<aside>`
21+
`<header>`
22+
`<section>`
23+
`<article>`
24+
`<footer>`
25+
`<main>`
26+
27+
## HTML 5 content elements
28+
29+
`<h1>` to `<h6>`: Define headings of varying levels, with `<h1>` being the most important and `<h6>` the least.Use these tags to structure your content hierarchically. For good SEO, I would not recommend using any thing more than `<h1>` to `<h3>`.
30+
`<p>`: Represents a paragraph of text within your content.
31+
`<pre>`: Formats preformatted text, preserving whitespace and line breaks. Often used for code snippets or poems.
32+
`<ul>`: Defines an unordered list of items.
33+
`<ol>`: Defines an ordered list of items, typically numbered.
34+
`<table>`: Creates a table for presenting data in a structured format with rows and columns.
35+
`<caption>`: Provides a caption for a table, summarizing its content.
36+
`<figure>`: Groups an image or other visual content with an optional caption `<figcaption>` to provide context.
37+
`<blockquote>`: Represents a long excerpt from another source, typically indented and with quotation marks.
38+
39+
## HTML 4 form elements
40+
41+
`<form>`: Defines a section of a webpage that allows users to submit data to the server.
42+
`<label>`: Associates a label with a form element (like an input field) to explain its purpose.
43+
`<input>`: Represents a single-line input field for various user interactions (text, password, checkbox, etc.).
44+
`<textarea>`: Defines a multi-line text input area for users to enter larger amounts of text.
45+
`<button>`: Creates a clickable button that can trigger actions when clicked.
46+
`<fieldset>`: Groups related form elements visually, often with a common legend `<legend>` explaining the purpose of the group

about-manifest-json.md

+19-19
Original file line numberDiff line numberDiff line change
@@ -33,24 +33,24 @@ At a minimum, a manifest file should contain the following manifest members: "na
3333

3434
An example manifest.json,
3535

36-
```json
37-
{
36+
```json
37+
{
3838
"name": "My Web App",
3939
"displayName": "My Web App",
4040
"background_color": "#ffffff",
4141
"dir": "ltr",
4242
"display": "standalone",
4343
"icons": [
44-
{
45-
"src": "icon-192.png",
46-
"sizes": "192x192",
47-
"type": "image/png"
48-
},
49-
{
50-
"src": "icon-512.png",
51-
"sizes": "512x512",
52-
"type": "image/png"
53-
}
44+
{
45+
"src": "icon-192.png",
46+
"sizes": "192x192",
47+
"type": "image/png"
48+
},
49+
{
50+
"src": "icon-512.png",
51+
"sizes": "512x512",
52+
"type": "image/png"
53+
}
5454
],
5555
"lang": "en-US",
5656
"orientation": "portrait",
@@ -60,19 +60,19 @@ An example manifest.json,
6060
"manifest_version": 2,
6161
"type": "web_app",
6262
"meta": {
63-
"author": "John Doe",
64-
"description": "A simple web app",
65-
"version": "1.0.0"
63+
"author": "John Doe",
64+
"description": "A simple web app",
65+
"version": "1.0.0"
6666
},
6767
"dependencies": {
68-
"react": "^17.0.2",
69-
"react-dom": "^17.0.2"
68+
"react": "^17.0.2",
69+
"react-dom": "^17.0.2"
7070
},
7171
"defaultWidth": 800,
7272
"defaultHeight": 600,
7373
"resizeX": true
74-
}
75-
```
74+
}
75+
```
7676

7777
The manifest.json file is used in web development to define the properties and behavior of web applications and extensions. It is written in JSON (JavaScript Object Notation) format and contains various metadata and configuration settings that help browsers and platforms understand and interact with the application or extension. This file typically includes information such as the application or extension name, version number, description, icons, permissions, and background scripts
7878

configure-eslint.md

+40-8
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ For example, you can use a .eslintrc.js file to export an object containing your
2020
.eslintrc.json file to define the configuration structure.
2121

2222
ESLint is primarily designed for linting JavaScript. However, it can also be configured to support other
23-
languages through parser options. By default, ESLint expects ECMAScript 5 syntax, but you can override
23+
languages through parser options. By default, ESLint expects ECMAScript 5 syntax, but you can override
2424
this setting to enable support for other ECMAScript versions and JSX using parser options
2525

2626
Besides the .eslintrc file, ESLint also recognizes the following files as configuration files:
@@ -39,8 +39,8 @@ The priority order is as follows: .eslintrc.js, .eslintrc.cjs, .eslintrc.yaml, .
3939

4040
These files provide flexibility in how you can define and manage your ESLint configurations.
4141

42-
As you gain familiarity with ESLint, You should build a baseline configuration and store the rather than just
43-
rely on the defaults so that you can get to work easily on your project and store it somewhere handy so that
42+
As you gain familiarity with ESLint, You should build a baseline configuration and store the rather than just
43+
rely on the defaults so that you can get to work easily on your project and store it somewhere handy so that
4444
you can copy and paste it into your project. If you work on various types of JavaScript projects and frameworks,
4545
you might even have several configurations you can rely on.
4646

@@ -60,7 +60,11 @@ module.exports = {
6060
"rules": {
6161
"indent": ["error", 2],
6262
"quotes": ["error", "single"],
63-
"semi": ["error", "always"]
63+
"semi": ["error", "always"],
64+
},
65+
"root": true,
66+
"parserOptions": {
67+
6468
}
6569
};
6670
```
@@ -93,6 +97,30 @@ The docs for configuration are: [Config]<https://eslint.org/docs/latest/use/conf
9397

9498
"workspaces" - This configuration is used in a monorepo setup to specify the workspaces to apply the ESLint configuration to.
9599

100+
"ecmaFeatures" - This is an object. This specifies support for ECMAScript (JavaScript) features like jsx and classes.
101+
102+
"ecmaVersion" - number value: A number representing the ECMAScript version to parse the code against (e.g., 2023)
103+
104+
"codeFrame" - This is a boolean value, true to include code frames, false to omit them
105+
106+
"settings" - Provides settings for ESLint to interpret code in specific contexts.
107+
108+
"react" - An object or a boolean, depending on where used in the configuration, enables ESLint's built-in rules for React applications.
109+
110+
"version" - This is a string and an optional property that can be used to specify an ESLint shareable config version.
111+
112+
"jest"- An object or a boolean, depending on where used in the configuration, enables rules specific to Jest testing environments.
113+
114+
"browser" - A boolean value, this enables rules for code running in a browser environment
115+
116+
"commonjs" - A boolean value, this nables rules for code using the CommonJS module system
117+
118+
"amd" - Enables rules for code using the Asynchronous Module Definition (AMD) format.
119+
120+
"es6" - An object or boolean, Enables or configures rules for ECMAScript 6 (ES6) features.
121+
122+
"allowImportExportEverywhere" - This is a boolean value to allow imports and exports anywhere, false to restrict them to module top-level.
123+
96124
## Configurations
97125

98126
Common configurations in "rules" are, and they should be:
@@ -109,8 +137,8 @@ There are more configurations in "rules" that you can set. Tailor these to your
109137

110138
## ESLint Plugins
111139

112-
There are plugins for ESLint. An ESLint plugin is an npm module that can contain a set of ESLint rules, configurations,
113-
processors, and environments. These plugins often include custom rules and can be used to enforce a style guide and support
140+
There are plugins for ESLint. An ESLint plugin is an npm module that can contain a set of ESLint rules, configurations,
141+
processors, and environments. These plugins often include custom rules and can be used to enforce a style guide and support
114142
JavaScript extensions, libraries, and frameworks such as TypeScript, React, and Angular
115143

116144
Each plugin is an npm module with a name in the format of eslint-plugin-<plugin-name>, such as eslint-plugin-react and there
@@ -149,13 +177,17 @@ As for config.. install these packages:
149177
If you are doing React development, I would suggest installing both the plugin and config for React. You can look up each one of these on
150178
npmjs.com and find out what they do. I would suggest only installing eslint-plugin-prettier, eslint-plugin-react, eslint-config-react and eslint-config-prettier when you are first starting out as a beginner. You can add more. The others may not be helpful to you, but you should be aware of them.
151179

180+
## Ignoring files
181+
182+
You can tell ESLint to ignore file parsing of any file you do not want ESLint to parse by using .eslintignore which has a format similar to a .gitignore file.
183+
It has been suggested that you should ignore parsing of node_modules.
184+
152185
## Disabling ESLint rules
153186

154187
You can inline disable ESLint's rules when necessary.
155188

156-
use the // eslint-disable-rulename or /* eslint-disable-rulename */
189+
use the // eslint-disable-rulename or /*eslint-disable-rulename*/
157190

158191
## ESLint in the Command Line
159192

160193
To run ESLint in the command line, two things can happen but most of the time all you will need to do is run `eslint --fix .` in whatever directory you are in.
161-

configure-prettier.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ Here is an example `.prettierrc` which you can code in JSON or YAML..
3636
"semi": false,
3737
"endOfLine": "auto",
3838
"bracketSpacing": false,
39+
"bracketSameLine": true,
3940
"jsxSingleQuote": true,
4041
"quoteProps": "as-needed",
4142
"htmlWhitespaceSensitivity": "css",
@@ -57,7 +58,8 @@ Here is an example `.prettierrc` which you can code in JSON or YAML..
5758
}
5859
}
5960
],
60-
"plugins": ["prettier-plugin-foo"]
61+
"plugins": ["prettier-plugin-foo"],
62+
"react/jsx-max-props-per-line": [1, { "when": "always" }]
6163
}
6264

6365
I prefer JSON. There could be more settings. This covers most of them. Most of the settings are or at least should be somewhat self-explanatory

0 commit comments

Comments
 (0)