Skip to content

Instantly share code, notes, and snippets.

View nax3t's full-sized avatar

Ian Schoonover nax3t

  • Fort Worth, TX
View GitHub Profile
@nax3t
nax3t / arrayEvery.js
Last active April 12, 2024 22:22
Array every() method in JS
// docs: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every
const phrases = [
"I LOVE PIZZA",
"WHY IS THE SKY BLUE?!",
"WHERE AM I?",
];
function isYelled(phrase) {
return phrase.toUpperCase() === phrase;
}
@nax3t
nax3t / python_functions.py
Created March 14, 2024 02:06
Source code from Web Dev FUNdamentals Ep. 5
dict = {"a": 0, "b": 2, "c": 3}
def print_dict(d):
for key in d:
print(d[key])
return d
new_dict = print_dict(dict)
print_dict(new_dict)
@nax3t
nax3t / python_basics.md
Last active February 28, 2024 20:29
Python Basics Lesson for Web Development FUNdamentals Episode 3.

Python Basics

Welcome to the exciting world of Python programming!

Python's simplicity and power make it a top choice for software engineering, data analysis, and beyond. With Python, you can automate tasks, analyze data, build web applications, and even create AI. Today, we'll delve into the basics, setting the stage for your exploration of Python's endless possibilities. Let's dive in and unlock the potential of Python together!

Objectives

By the end of this lecture, you will:

  1. Understand essential programming concepts in Python.
@nax3t
nax3t / basic_python.md
Last active September 11, 2023 16:59
Basic constructs in Python

1. Variable Assignment:

my_variable = 42 # now my_variable references 42

2. Primitive Data Types:

my_integer = 42              # int
@nax3t
nax3t / study-guide.md
Created September 8, 2023 18:38
Module 1 Study Guide

Study Guide / Review

HTML Basics

HTML (Hypertext Markup Language) is the standard markup language for creating web pages. It defines the structure and content of a web page using a system of tags and attributes.

Key Concepts:

  • HTML Document Structure: An HTML document consists of a <!DOCTYPE>, <html>, <head> (with <title>), and <body> sections.
  • Elements and Tags: HTML elements are represented by tags (e.g., <p>, <a>, <div>).
  • Attributes: Elements can have attributes (e.g., href, src, class) that provide additional information.
  • Text Content: You can add text content using elements like <p>, <h1>, <span>, etc.
  • Links: Create hyperlinks using the <a> tag with the href attribute.
@nax3t
nax3t / sentiment.md
Created August 31, 2023 21:51
Old School Sentiment
def sentiment(message):
    happy_count = 0
    sad_count = 0
    if len(message) < 3:
        return "none"
    
    for i in range(len(message) - 2):
        if message[i] == ":" and message[i+1] == "-":
 if message[i+2] == ")":
@nax3t
nax3t / rabbitmq.md
Created August 30, 2023 15:35
RabbitMQ Explanation

RabbitMQ is a message broker that facilitates communication between different parts of a software application or multiple applications. It's particularly useful when building a React app with a Django backend, especially in a containerized environment using Docker. Let's break down its benefits in this context:

  1. Asynchronous Communication: In a web application, there are tasks that can be performed asynchronously, such as sending emails, processing data, or handling background jobs. RabbitMQ enables you to decouple these tasks from the main application flow. For instance, when a user submits a form in your React app, you can send a message to RabbitMQ, which the Django backend can pick up and process. This ensures that your main application remains responsive even during resource-intensive operations.

  2. Scalability: Docker containers allow you to scale your application components as needed. When you have multiple instances of your Django backend running in containers, RabbitMQ can help distribute

@nax3t
nax3t / powershell-commands.md
Created June 19, 2023 22:50
Bash Equivalent Commands for Powershell
Task PowerShell Command macOS Bash Terminal Command
Current directory Get-Location pwd
List files and folders Get-ChildItem ls
Change directory Set-Location <path> cd <path>
Create a directory New-Item -ItemType Directory -Name <name> mkdir <name>
Create an empty file New-Item -ItemType File -Name <name> touch <name>
Copy a file Copy-Item <source> <destination> cp <source> <destination>
Move/rename a file Move-Item <source> <destination> mv <source> <destination>
Remove a file Remove-Item <file> rm <file>
@nax3t
nax3t / selfDescribingNum.js
Created February 16, 2022 18:13
Self Describing Number - Algorithm Solution
function isSelfDescribing(num) {
let numArray = String(num).split('').map(str => Number(str));
// 123 => '123' => ['1', '2', '3'] => [1, 2, 3]
let i = 0;
for (const num of numArray) {
// check to see how many times the current index appears in the numArray
// and does that total match the current element/number for this iteration
if (numArray.filter(n => n === i).length !== num) {
return false;
}
@nax3t
nax3t / guessing-game-original.js
Created August 1, 2021 20:19
Guessing Game Refactor
let maximum = parseInt(prompt("Enter the maximum number!"));
while (!maximum) {
maximum = parseInt(prompt("Enter a valid number!"));
}
const targetNum = Math.floor(Math.random() * maximum) + 1;
let guess = parseInt(prompt("Enter your first guess!"));
let attempts = 1;