Skip to content

Instantly share code, notes, and snippets.

View JoNilsson's full-sized avatar
🤖
Watching AI

Jø Nilsson JoNilsson

🤖
Watching AI
View GitHub Profile
//-------------------------------------
// https://www.johannessnilsson.cc/blog/lazy-youtube
//-------------------------------------
// Apache License, Version 2.0
// Copyright (c) 2024 Johanness Nilsson
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
@JoNilsson
JoNilsson / Hacker_Enchilada_Sauce.md
Last active March 15, 2024 17:50
A Hacker's Home Made Enchilada Sauce

Hacker Home Made Enchilada Sauce


Ingredients List

Round up all the necessary ingredients for the sauce:

  • 1/4 cup virgin olive, or substitute sunflower oil
  • 1/4 cup white or yellow onion fine chopped
  • 2 tablespoons organic flour
  • 1/2 teaspoon baking soda (sodium bicarbonate)
@JoNilsson
JoNilsson / BOOTLOADERS.MD
Last active October 16, 2023 17:41
To GRUB, or not to GRUB?

To GRUB, or not to GRUB?

Discussion

Choosing the right bootloader for your Linux system is a critical decision that will impact system boot time, system stability, and ease of maintenance. The bootloader serves as the launchpad for your operating system, affecting how quickly and reliably it starts up, as well as how easily you can manage multiple operating systems if you have a dual-boot setup. The two most common boot loader options are GRUB and Systemd-boot. This document is here to help you understanding the pros and cons of each option, and to help you tailor your system to your specific needs.


Systemd-boot Benefits:

- Simplicity: Easier to configure.
- Speed: Generally faster boot times.
@JoNilsson
JoNilsson / main.go
Created September 23, 2023 06:10
Curious tests the performance enhancement of slice pre-allocation in GO
// Because curious: program demonstrating the performance difference
// between appending to a slice without preallocating its capacity
// versus one with preallocation. Preallocation is more efficient
// because it minimizes the number of memory reallocations required
// when the slice grows.
// 🄯 2023 JoNilsson
package main
import (
@JoNilsson
JoNilsson / SQL_QnA.md
Created August 17, 2023 01:12
SQL Interview Q & A

SQL related inverview questions, and my answers.

Q: What is a self-join and why might it be useful? Provide an example scenario where this could be used effectively?

A self-join is a type of join in SQL where a table is joined with itself. It's useful when you want to compare rows within the same table based on a common column or relationship. Self-joins can help retrieve hierarchical or related data stored within a single table. Self-joins are valuable for tasks like organizational hierarchy, network modeling, or tracing relationships within the same dataset.

E.G. a table named Employees with columns EmployeeID, Name, and ManagerID, where ManagerID references another employee's EmployeeID. So to find each employee's manager, you can use a self-join that connects employees with their respective managers using the ManagerID relationship.

@JoNilsson
JoNilsson / SQL_vs_NoSQL.md
Created August 16, 2023 20:37
To SQL or to NoSQL, that is the question.

Preface, what is SQL and NoSQL?

SQL (Structured Query Language) and NoSQL (Not Only SQL) are two main categories of databases, each with its own characteristics, strengths, and weaknesses.
Here I endevor to explore the differences between them and help you determine in scenarios where one might be prefered over the other.

SQL Databases

  1. Structured Data: SQL databases are based on a structured schema where data is organized into tables with predefined columns and data types. This structured approach enforces data consistency and helps maintain data integrity.

  2. ACID Compliance: SQL databases follow the ACID (Atomicity, Consistency, Isolation, Durability) properties, ensuring transactions are reliable, and data remains in a consistent state even in the face of failures.

@JoNilsson
JoNilsson / postgresql-python.md
Last active August 16, 2023 05:22
Beginner introduction to SQL interactions using PostgreSQL and Python:

Beginner introduction to SQL interactions using PostgreSQL and Python:

Setup (Mac OS)

  1. Install PostgreSQL
    First install PostgreSQL on your machine. Download it from the official PostgreSQL website: https://www.postgresql.org/download/
    Or, the Homebrew package manager can be used to build the present PostgreSQL release from its source code. As of this writing, it's @ version 14. This is my recommended install method.
$ brew install postgresql@14
@JoNilsson
JoNilsson / simulate-45-rpm.md
Created August 14, 2023 00:47
Simulate 33 1/3 rpm vinyl record audio playing at 45 rpm

To simulate playing an analog 33 1/3 rpm record at 45 rpm, use the formula:

(45 - 33.33) / 33.33 * 100 ≈ 35.71%

Therefore, the digital audio would need to be sped up by approximately 35.71% to simulate playing the record at 45 rpm.

To translate a percentage increase into cents, use the following formula:

@JoNilsson
JoNilsson / README.md
Created August 7, 2023 18:55
Q: What is the hardest problem you've solved as an engineer, and how did you solve it?

Q: What is the hardest problem you've solved as an engineer, and how did you solve it?

As an Engineer of solutions in Software and Micro-Electronics;


I've discovered that uncertainties are a constant and learning is perpetual. Despite many times solving complex problems where others faltered, the humility of not finding the solution sooner almost always remains. Thus, my greatest challenges lie ahead. My technological proficiency and adaptability have allowed me to thrive in problem-solving scenarios; nothing is "hard", merely unlearned. This acceptance of inevitable knowledge gaps has been instrumental in my career progression. The daunting becomes manageable once confronted—an unconventional truth I've come to appreciate. As a seasoned engineer with experiences across a diverse spectrum of industrial sectors, this question prompts profound reflection; yet pinpointing or more aptly—quantifying the hardest challenges or their resolution eludeds me.

@JoNilsson
JoNilsson / README.md
Created August 4, 2023 20:02
Web-Application Three Tier Architecture

Web-Application Three Tier Service Architecture

A three-tier web service, also known as a three-tier architecture or three-tier application, is a very common design pattern used in web applications engineering to structure and organize a web-app into three distinct layers or tiers. Each tier has a specific role and interacts with the other tiers to provide a scalable, modular, and maintainable solution.

Three-tier architectures are preferable as they offer several benefits, including modular development, easier maintenance, scalability, and separation of concerns. Each tier can be developed, deployed, and managed independently, which enhances flexibility and allows for easier updates or changes to specific components without affecting the entire application. This architecture is widely used in web applications to achieve a balance between performance, maintainability, and user experience.


Presentation Tier (Front-end):

This is the top layer that interacts directly with users and handl