Recently Updated Pages

Content-Type headers

Depending on what types of media you want to display using PHP, you need to set different values ...

Preventing against timing attacks

Timing attacks are pretty horrible from the perspective of someone trying to write a secure crypt...

To change the name and/or email address recorded in existing commits

This action is destructive to your repository's history. If you're collaborating on a repository ...

Meta and embeds for Discord (and other social media sites)

Introduction From services (Servers Lists, as an example) to server/bot websites, there are many...

Hashing in Python

A hashing function is a one way function that can be used to map data of arbitrary size to a fixe...

sqlite3 basics in Python

Using databases is a really effective way to store data. In python, we can import sqlite3 to get ...

Parameterised SQL

Parameterised SQL should be used whenever you are querying a SQL database using external input (s...

The best Cron timings tool

https://crontab.guru

Sorting an array

Say we have an array of words, for example. We can alphabetically sort this array using the sort ...

Send POST data using a HTTP request

Sometimes the need arises to send POST data in a HTTP request. This is (relativley) simply achiev...

Cockpit - installation and certificates

Installing cockpit Instructions are for Ubuntu 17.04 onwards. Run - sudo apt-get install cockp...

Capture stdout

Sometimes, it's required to capture the stdout from a function or module import. This is natively...

Flash taskbar icon

To flash the Windows taskbar icon, use the bundled Python library ctypes. import ctypes ctypes....

Get creation date of a file

Uses os and datetime. import os from datetime import datetime def getCreateDate(filepath): ...

Generator expressions

Generator expressions can be used to generate lists and dictionaries based on a condition in Pyth...

Using bytes with files

To open a bytes-like file for writing, use wb. open(file, "wb") To open a bytes-like file for r...

Cron and Python

Very often I end up using and working with external files in Python, and occasionally I use the t...

Vertically and horizontally center an element

Will center an element both vertically and horizontally in the element's parent element. Element....

GET/POST variables

GET and POST are two methods used to request data as part of the HTTP protocol. GET variables G...

Create a download

To download a file instead of just displaying it requires multiple specific headers to be set. $...