Click-worthy styles in a single class Buttons are made easy with Bootstrap. The team at Bootstrap has taken the guesswork out of button design and has created a set of styles that look modern. Only rarely do I sway away from the default bootstrap design. Buttons were briefly looked at in our previous article. We’ll go into further detail in this section. https://www.dinocajic.com/bootstrap-p3-margin-and-padding/ The btn class must be applied to each button in order to start using bootstrap’s button styles. Let’s see the changes between the default button style and bootstrap’s version. <button>Unstyled</button> <button class=”btn”>Styled with Bootstrap</button> When the btn class is applied to
Tag: Laravel Database
Stop script injections cold Cross Site Scripting is a common vulnerability in web applications. It’s estimated that 60% of all websites are susceptible to this attack. What is cross site scripting (XSS)? Cross Site Scripting, or XSS, is a technique for injecting malicious code into another website. Persistent Cross Site Scripting Let’s say that an attacker is able to send a piece of JavaScript code through a form on a legitimate website that stores the malicious code within the database of the website. That JavaScript code can then wreak havoc on other users since that JavaScript code is then returned to the
Don’t take the bait—spot phishing fast If you use email, you most likely heard about Phishing attacks. Although it sounds just like Fishing, it’s not as relaxing. If you’ve been phished, you’re going to have a bad day. If you caught a fish, you’re going to be smiling. Why call it phishing? The idea is that the hacker sends a baited email to the target user and hopes that the target takes the bait. Just like the bait in fishing is supposed to resemble something that the fish wants, the bait in phishing is masked as something that the user
When traffic turns into a weapon A Denial of Service (DoS) attack is when an attacker attempts to make a site unavailable to users by sending so much traffic to it that the site cannot respond. The idea is to disrupt the normal operations of a server or network with a cyber attack on that server or network. This cyber attack is coming from one source, such as the attackers computer. There are different types of DoS attacks, including a Distributed Denial of Service (DDoS) attack, which uses multiple sources to attack a network or server. Recently, nearly all DoS
Write, run, repeat Now, I know that we’ve already covered a Python script in the previous article, but that was used simply for testing in order to set our environment up. We’re here to learn Python, so lets take a step back and do this the right way. I like themes with my series, and here are a few that I was thinking about following: Cars (always my favorite) Doom and destruction (seems appropriate with all the AI warning signs going off) Just pure fun (sometimes I go overboard) I think we’ll stick to cars. My hope is to not
Debug inside the container—directly from PyCharm In the previous article, we looked at setting up Python with Docker. We skipped all of the environment headaches. If you’re using PyCharm, you might have noticed that everything is underlined red, like your code is broken. Let’s fix that with Docker again. https://www.dinocajic.com/python-p1-getting-started-with-python-and-docker-compose/ Open up PyCharm and go to your interpreter. It should be at the bottom right of your screen. Select Add New Interpreter and then Docker. We already have a Dockerfile inside of our project so we can simply leave the settings as is. If you don’t see Docker on
Containerize your first Python project in minutes Docker is one of those environments that I can’t live without anymore. It’s interesting that there aren’t many resources that discuss getting a basic Python script going with Docker and docker-compose. Let’s see how simple this is to do with Python. Create a new directory for your project and navigate into it: mkdir python_test cd python_test Create a new file called Dockerfile with the following content: FROM python:3.11-slim-buster WORKDIR /app COPY requirements.txt ./ RUN pip install –no-cache-dir -r requirements.txt COPY . . CMD [ “python”, “app.py” ] This Dockerfile sets up a Python 3.11 environment,
The language that does it all I jumped into this Python tutorial series without explaining why one might want to learn Python in the first place. Python is a high-level, interpreted programming language that was first released in 1991 by Guido van Rossum. It is named after Monty Python, the British comedy group, which explains why many of its tutorials and examples use humorous references. https://www.dinocajic.com/python-p1-getting-started-with-python-and-docker-compose/ Python is designed to be easy to learn and read, with a syntax that emphasizes readability and reduces the cost of program maintenance. Its simple and elegant syntax has made it popular among beginners,
Setting the Stage: Database Configuration for the Car Management Project Time to get our hands dirty and start working on this project. What we want to do is have a Car Management system for our car collection. We’ll add items like the image of our car, the year, make, model, estimated value, etc. Laravel — P34: Introduction to the Car Management Project Database Schema Let’s see what this system schema needs to look like. To generate the content, we’ll need to create 5 different migrations. To help speed up the process, we know that we’ll need 4 models along with
Laravel Database Mastery: Starting Your Data Journey Why database and not a model intro you may ask. A model is just class that communicates with a specific table in the database. I’m a true believer that you should understand a topic at a high level before you jump into creating code for it. Let’s take a moment to discuss the database and how Laravel interacts with it. What is a Database? It’s not going to be that type of basic article, but just so that we’re all on the same page, a database is a place where you store data.