mirror of
https://github.com/andwati/andwati.com.git
synced 2026-10-18 01:12:53 +00:00
edited blogs
This commit is contained in:
@@ -10,8 +10,6 @@ tags = ["obsidian", "entropy", "notes"]
|
||||
|
||||
Take control of your artifacts
|
||||
|
||||
|
||||
|
||||
In my endless endevours to find the perfect note taking app led me to obsidian, a note taking software that uses markdown files as the file format. All software is ephemereal in nature and yoour artifacts need to survive the decline of your favorite app. The files you create should be available to you and shouldt rrequire specialized software to access.
|
||||
|
||||
Your data shouldt be locked behind a paywall or an authentication system that is not under your control.
|
||||
Your data shouldt be locked behind a paywall or an authentication system that is not under your control.
|
||||
|
||||
@@ -9,8 +9,6 @@ tags = ["tutorial", "django", "python", ".env"]
|
||||
|
||||
Managing the Django SECRET_KEY variable.
|
||||
|
||||
|
||||
|
||||
The Django `SECRET_KEY` variable is very crucial to your Django application. The secret key must be a large random value and it must be kept secret. Leaking this value to unauthorized people could lead to a security breach. The SECRET_KEY is used in Django for cryptographic signing. It is used to generate tokens and hashes, they can be recreated using this variable. If it is not configured Django throws a `django.core.exceptions.ImproperlyConfigured: The SECRET_KEY setting must not be empty` error
|
||||
|
||||
# Using Environment Variables
|
||||
|
||||
@@ -9,8 +9,6 @@ tags = ["hugo", "blog", "go"]
|
||||
|
||||
How it begins
|
||||
|
||||
|
||||
|
||||
In this post-web2.0 age, people seem to blog less and less, and blogs seem to be dying slowly. People are separated in different Apps where the content is not searchable by search engines.
|
||||
|
||||
However, I still prefer to write using a blog.
|
||||
|
||||
@@ -9,15 +9,12 @@ tags = ["cognition"]
|
||||
|
||||
Staring at the void
|
||||
|
||||
|
||||
|
||||
Cognitive inertia is the reason changing our habits can be difficult. If you want to overcome inertia you have to apply a force. I consider myself an eternal student, who is ready to learn anything, or so I thought. It happened but I had not noticed, I had stopped moving forward.
|
||||
|
||||
## Metawork
|
||||
|
||||
I will define this as the things we do before getting the "real" work doe. Its things like choosing the best IDE or text editor, setting up your coding environment, choosing the best note taking app, or even the 'best' operating system. They are the prerequisites of the actual work.
|
||||
|
||||
I had been stuck on this loop, always trying to craft the perfect workflow. Setting up the best personalized linux distro, switching note taking apps, trying out multiple layouts, stylings and technologies for my blog, the list is endless.
|
||||
I had been stuck on this loop, always trying to craft the perfect workflow. Setting up the best personalized linux distro, switching note taking apps, trying out multiple layouts, stylings and technologies for my blog, the list is endless.
|
||||
|
||||
All of these metawork took more time thn the actual work; building, active learning and writing. Im going to stop all of these and start doing the important stuff.
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ You can switch to the PostgreSQL user by executing the following command:
|
||||
|
||||
Before PostgreSQL can function correctly, the database cluster must be initialized.
|
||||
|
||||
### 2.1 We can confirm the installed PostgreSQL version by running:
|
||||
### 2.1 We can confirm the installed PostgreSQL version by running
|
||||
|
||||
```sh
|
||||
postgres --version ─╯
|
||||
@@ -102,7 +102,7 @@ You must first log in as the **postgres** user using the following command bef
|
||||
sudo su - postgres
|
||||
```
|
||||
|
||||
### 2.5 With the following command, you can now initialize PostgreSQL’s data directory:
|
||||
### 2.5 With the following command, you can now initialize PostgreSQL’s data directory
|
||||
|
||||
```sh
|
||||
[postgres]$ initdb -D /var/lib/postgres/data
|
||||
@@ -110,7 +110,7 @@ sudo su - postgres
|
||||
|
||||
### Step 3: PostgreSQL Service Management
|
||||
|
||||
### 3.1 Check PostgreSQL status with the following command:
|
||||
### 3.1 Check PostgreSQL status with the following command
|
||||
|
||||
```sh
|
||||
systemctl status postgresql ─╯
|
||||
@@ -119,19 +119,19 @@ systemctl status postgresql
|
||||
Active: inactive (dead)
|
||||
```
|
||||
|
||||
### 3.2 Start the PostgreSQL service by running the following command:
|
||||
### 3.2 Start the PostgreSQL service by running the following command
|
||||
|
||||
```sh
|
||||
sudo systemctl start postgresql
|
||||
```
|
||||
|
||||
### 3.3 Enable the PostgreSQL service to start automatically at boot by running the following command:
|
||||
### 3.3 Enable the PostgreSQL service to start automatically at boot by running the following command
|
||||
|
||||
```sh
|
||||
sudo systemctl enable postgresql
|
||||
```
|
||||
|
||||
### 3.4 Verify that PostgreSQL is running by running the following command:
|
||||
### 3.4 Verify that PostgreSQL is running by running the following command
|
||||
|
||||
```sh
|
||||
sudo systemctl status postgresql ─╯
|
||||
|
||||
@@ -9,8 +9,6 @@ tags = ["blog", "hugo", "netlify","netlify-cms","github"]
|
||||
|
||||
Migrating to a better content management system through Netlify CMS
|
||||
|
||||
|
||||
|
||||
# Heavy Lifting
|
||||
|
||||
I use [Visual Studio Code](https://code.visualstudio.com/) to manually edit the blog post content on this website. This is quite a hassle because I have to deal with
|
||||
|
||||
@@ -9,15 +9,14 @@ tags = ["javascript", "node"]
|
||||
|
||||
Modules are the building blocks of modern JavaScript applications, allowing for the encapsulation of code into reusable components. Two primary systems govern the exportation of these modules: export default in ES6 and module.exports in CommonJS.
|
||||
|
||||
|
||||
|
||||
Javascript is a popular programming language that can run both in the browser and on the server. However, different environments may have different ways of organizing and importing Javascript modules. In this article, we will compare two common methods of exporting and importing modules: **export default** and **module.exports**.
|
||||
|
||||
|
||||
## What are modules?
|
||||
|
||||
Modules are reusable pieces of code that can be separated into different files. Modules can export values, functions, classes, or objects that can be imported by other modules. This way, modules can avoid polluting the global scope and enable code reuse and modularity.
|
||||
|
||||
## How to export modules in Node.js?
|
||||
|
||||
Node.js is a runtime environment that allows Javascript to run on the server. Node.js uses a module system called CommonJS, which is based on the require and module.exports syntax.
|
||||
|
||||
To export a module in Node.js, you can assign the value that you want to export to the module.exports object. For example:
|
||||
@@ -53,6 +52,7 @@ console.log(person.age); // 25
|
||||
Note that Node.js will cache the modules that are imported with require, so if you import the same module multiple times, you will get the same instance of the module.
|
||||
|
||||
## How to export modules in ES6?
|
||||
|
||||
ES6 is the version of Javascript that introduced many new features, including a native module system. ES6 modules use the `import` and `export` syntax.
|
||||
|
||||
To export a module in ES6, you can use the `export` keyword followed by the declaration of the value that you want to export. You can also use the export keyword with curly braces to export a list of named values. For example:
|
||||
@@ -98,9 +98,11 @@ import { person as Alice } from "./my-module.js";
|
||||
console.log(Alice.name); // Alice
|
||||
console.log(Alice.age); // 25
|
||||
```
|
||||
|
||||
Note that ES6 modules are imported and executed only once, so if you import the same module multiple times, you will get the same instance of the module.
|
||||
|
||||
## What is the difference between export default and module.exports?
|
||||
|
||||
One of the main differences between export default and module.exports is that export default is an ES6 feature, while module.exports is a CommonJS feature. Therefore, they are not compatible with each other by default. However, some tools like Babel or Webpack can transpile ES6 modules to CommonJS modules, or vice versa, to make them work together.
|
||||
|
||||
Another difference is that export default can only export one value per module, while module.exports can export any value, including multiple values. For example:
|
||||
@@ -172,6 +174,7 @@ console.log(person.age); // 30
|
||||
```
|
||||
|
||||
To import a module.exports value, you can use the require function and assign any name to the imported value. For example:
|
||||
|
||||
```javascript
|
||||
// main.js
|
||||
// import a module.exports value
|
||||
@@ -189,4 +192,5 @@ const person = new Person("Bob", 30);
|
||||
console.log(person.name); // Bob
|
||||
console.log(person.age); // 30
|
||||
```
|
||||
Node’s JavaScript has diverged from that of the browser. Understanding both CommonJS modules and ES6 modules is your first step in becoming a 10X developer. Happy coding!
|
||||
|
||||
Node’s JavaScript has diverged from that of the browser. Understanding both CommonJS modules and ES6 modules is your first step in becoming a 10X developer. Happy coding!
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
+++
|
||||
title = "Linux Permissions"
|
||||
description = "no you can't do that says root"
|
||||
author = "mockingspectre"
|
||||
date = 2025-01-27
|
||||
draft=true
|
||||
[taxonomies]
|
||||
tags = ["linux"]
|
||||
+++
|
||||
|
||||
>To be, or not to be, that is the question:
|
||||
Whether 'tis nobler in the mind to suffer
|
||||
The slings and arrows of outrageous fortune,
|
||||
Or to take arms against a sea of troubles
|
||||
And, by opposing, end them. (Shakespeare, 1603/2003, 3.1.56)
|
||||
@@ -9,8 +9,6 @@ tags = ["obsidian", "git","sync", "windows", "cron", "task scheduler", "powershe
|
||||
|
||||
Syncing Obsidian in Windows with Windows Task Scheduler and git
|
||||
|
||||
|
||||
|
||||
[Obsidian](https://obsidian.md/) is a powerful note-taking and knowledge management tool that has gained a dedicated following among researchers, writers, and knowledge workers. To make the most of Obsidian, it's essential to keep your notes synchronized across devices and ensure your data is regularly backed up.Obsidian is the private and flexible writing app that adapts to the way you think.
|
||||
|
||||
Obsidian is free for personal use.It does not charge based on features or usage.You only pay if you use Obsidian commercially.
|
||||
|
||||
@@ -9,8 +9,6 @@ tags= ["git", "semver","workflow", "conventional commits"]
|
||||
|
||||
Adopting best practices in your git and build workflows.
|
||||
|
||||
|
||||
|
||||
# What is Semver?
|
||||
|
||||
Semantic versioning or just SemVer is a dependency naming guidline that aims to bring some sanity into naming libraries and packages in software development. It is a standard versioning system created by **Tom Preston Werner** (co-founder of Github) that’s used to communicate what changes are in a release.
|
||||
@@ -85,5 +83,5 @@ The commit contains the following structural elements, to communicate intent to
|
||||
|
||||
# Resources
|
||||
|
||||
https://semver.org/
|
||||
https://www.conventionalcommits.org/en/v1.0.0/
|
||||
<https://semver.org/>
|
||||
<https://www.conventionalcommits.org/en/v1.0.0/>
|
||||
|
||||
@@ -9,8 +9,6 @@ tags= ["subresource integrity", "csp", "cors"]
|
||||
|
||||
Understanding Subresource Integrity
|
||||
|
||||
|
||||
|
||||
In my junior year while I was learning HTML and CSS I got to use the Bootstrap css library.The easiest way to obtain the files was from a Content Delivery Network(CDN). I could see links such as:
|
||||
|
||||
```html
|
||||
@@ -119,4 +117,4 @@ If the script or stylesheet fails to match its associated integrity value, the b
|
||||
- [https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity](https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity)
|
||||
- [https://html.spec.whatwg.org/multipage/semantics.html#attr-script-integrity](https://html.spec.whatwg.org/multipage/semantics.html#attr-script-integrity)
|
||||
- [https://html.spec.whatwg.org/multipage/semantics.html#attr-link-integrity](https://html.spec.whatwg.org/multipage/semantics.html#attr-link-integrity)
|
||||
- [https://w3c.github.io/webappsec-subresource-integrity/#the-integrity-attribute](https://w3c.github.io/webappsec-subresource-integrity/#the-integrity-attribute)
|
||||
- [https://w3c.github.io/webappsec-subresource-integrity/#the-integrity-attribute](https://w3c.github.io/webappsec-subresource-integrity/#the-integrity-attribute)
|
||||
|
||||
@@ -9,8 +9,6 @@ tags = ["blog", "utterances"]
|
||||
|
||||
Free speech enhanced
|
||||
|
||||
|
||||
|
||||
There is no point in writing online if your readers cannot provide feedback for your writings. You might as well be shouting at a void. My ideal commenting system has to be free, open source and should not be a hassle to setup. Luckily, [utterances 🔮](https://github.com/utterance/utterances) checks all of these conditions
|
||||
|
||||
It is a lightweight comments widget built on GitHub issues. Use GitHub issues for blog comments, wiki pages and more! The notable features are:
|
||||
|
||||
@@ -8,20 +8,21 @@ tags = ["javascript", "vuejs" , "tailwindcss"]
|
||||
+++
|
||||
A guide on how to use [Tailwind CSS](https://tailwindcss.com/) in your Vue project.
|
||||
|
||||
|
||||
>**Note**
|
||||
> This article was originaly published on my old medium blog. I moved it here for archival purposes.
|
||||
> This article was originaly published on my old medium blog. I moved it here for archival purposes.
|
||||
|
||||
Tailwind is a utility-first CSS framework for rapidly building custom user interfaces. It is an un-opinionated framework which means that it doesn't come with custom configurations like Bootstrap or Bulma(Yeah, I know, no one should tell you how to live your life).
|
||||
|
||||
Now let's get to the juicy part that brought us all here. I'll assume that we are using Vue 3 and the Vue CLI is already installed.
|
||||
|
||||
## Create a new Vue project
|
||||
|
||||
Open a terminal window and type the following commands to create a new Vue project in the current directory.
|
||||
|
||||
```sh
|
||||
vue create vue-app
|
||||
```
|
||||
|
||||
wait for the dependencies installation to finish then
|
||||
|
||||
```sh
|
||||
@@ -37,6 +38,7 @@ npm install -D tailwindcss@latest postcss@latest autoprefixer@latest
|
||||
```
|
||||
|
||||
## Create your configuration files
|
||||
|
||||
Next, generate your `tailwind.config.js` and `postcss.config.js` files:
|
||||
|
||||
```sh
|
||||
@@ -73,6 +75,7 @@ module.exports = {
|
||||
```
|
||||
|
||||
## Configure Tailwind to remove unused styles in production
|
||||
|
||||
In your tailwind.config.js file, configure the purge option with the paths to all of your pages and components so Tailwind can tree-shake unused styles in production builds:
|
||||
|
||||
```js
|
||||
@@ -91,6 +94,7 @@ In your tailwind.config.js file, configure the purge option with the paths to al
|
||||
```
|
||||
|
||||
## Include Tailwind in your CSS
|
||||
|
||||
Navigate to `src/assets/css` and create a new `tailwind.css` file in the folder, and use the @tailwind directive to include Tailwind’s base, components, and utilities styles in the file.
|
||||
|
||||
```css
|
||||
@@ -103,6 +107,7 @@ Navigate to `src/assets/css` and create a new `tailwind.css` file in the folder,
|
||||
Tailwind will swap these directives out at build-time with all of the styles it generates based on your configured design system.
|
||||
|
||||
## Import Tailwind into your Vue app
|
||||
|
||||
Finally, ensure your CSS file is being imported in your `./src/main.js` file:
|
||||
|
||||
```js
|
||||
@@ -115,4 +120,3 @@ createApp(App).mount('#app')
|
||||
```
|
||||
|
||||
You're finished! Now when you run npm run dev, Tailwind CSS will be ready to use in your Vue app! You can now proceed to create awesome stuff
|
||||
|
||||
|
||||
Reference in New Issue
Block a user