Search Filters
Content Type

Exact Matches
Tag Searches
Date Options
Updated after
Updated before
Created after
Created before

Search Results

35 total results found

Programming

Sanitizing and Validating User Data

PHP

When users submit data, you need to make sure that they've provided something you expect. Saniti...

Cockpit - installation and certificates

Linux

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

Capture stdout

Python

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

Cron and Python

Python

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

Using bytes with files

Python

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

Generator expressions

Python

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

Vertically and horizontally center an element

CSS/HTML

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

Get creation date of a file

Python

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

Send POST data using a HTTP request

Javascript

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

Flash taskbar icon

Python

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

Create a download

PHP

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

Content-Type headers

CSS/HTML

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

Postpone JS import until DOM is loaded

CSS/HTML

Sometimes when using Javascript on a webpage, you need to wait until the entire page has loaded i...

Parameterised SQL

PHP

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

SysAdmin

Including files

PHP

Files can be included in other PHP files using include.  Including a file will run any code withi...

Get contents of remote file

Javascript

Using Javascript, it is often useful to request the contents of a file and then process that file...

GET/POST variables

PHP

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

Hide/show elements

Javascript

Hiding and showing elements using Javascript is done by modifying the CSS of elements. Hiding an...

Get items from the query string

Javascript

First start by defining a constant that references the query string. const queryString = new URL...

Programming theory

Git

Linux

CSS/HTML

PHP

Python

Javascript

The best Cron timings tool

Linux

https://crontab.guru