Skip to content

Instantly share code, notes, and snippets.

Avatar

Dušan Mitrović dusnm

View GitHub Profile
@dusnm
dusnm / apache-wordpress.conf
Last active May 18, 2022
Example Apache configuration for wordpress
View apache-wordpress.conf
<IfModule mod_ssl.c>
<VirtualHost *:443>
# Basic config
ServerName example.org
ServerAdmin webmaster@example.org
DirectoryIndex index.php index.html /index.php
# This is a directory where wordpress is installed.
# Depending on the operating system, either http or www-data
# must have ownership and r,w permissions.
@dusnm
dusnm / openpgp.md
Created May 7, 2022
Keyoxide verification
View openpgp.md
@dusnm
dusnm / dictionary.py
Created Apr 20, 2022
Python "dictionary"
View dictionary.py
#!/usr/bin/env python3
import sys
import requests
from termcolor import colored
from requests.exceptions import JSONDecodeError
from typing import Dict, Union
def make_api_request(word: str) -> Union[Dict, None]:
url = f"https://api.dictionaryapi.dev/api/v2/entries/en/{word}"
@dusnm
dusnm / umcn_checksum.go
Last active Oct 28, 2021
A small go program calculating the UMCN (Unique Master Citizen Number) checksum for the numbers of former Yugoslav republics.
View umcn_checksum.go
/*
* SPDX-License-Identifier: GPL-3.0-or-later
*
* Licensed under the GNU General Public License, Version 3.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at:
*
* https://www.gnu.org/licenses/gpl-3.0.txt
*
* Unless required by applicable law or agreed to in writing, software
@dusnm
dusnm / http_status_codes.php
Created Oct 1, 2020
PHP constants with descriptions of the most commonly used HTTP status codes
View http_status_codes.php
<?php
declare(strict_types=1);
/**
* Standard response for successful HTTP requests.
* The actual response will depend on the request method used.
* In a GET request, the response will contain an entity corresponding to the requested resource.
* In a POST request, the response will contain an entity describing or containing the result of the action.
*/
define('HTTP_STATUS_OK', 200);