Skip to content

Instantly share code, notes, and snippets.

View pe7er's full-sized avatar
💭
typing...

Peter Martin pe7er

💭
typing...
View GitHub Profile
@pe7er
pe7er / remove_duplicates.py
Created November 22, 2023 12:31
Remove duplicate records from CSV
import pandas as pd
# Read the data from the exported CSV file
df = pd.read_csv('exported_data.csv')
# Remove duplicates based on user_id, mail_id, and send_date
df_cleaned = df.drop_duplicates(subset=['user_id', 'mail_id', 'send_date'])
# Write the cleaned data to a new file
df_cleaned.to_csv('cleaned_data.csv', index=False)
@pe7er
pe7er / vcf2csv.py
Created November 22, 2023 12:27
Convert names + email addresses from a VCF to a CSV file
import pandas as pd
import vobject
def vcf_to_csv(vcf_file, csv_file):
with open(vcf_file, 'r', encoding='utf-8') as file:
vcf_data = file.read()
# Parse the VCF data using vobject
vcf_parsed = vobject.readComponents(vcf_data)
@pe7er
pe7er / nginx.conf
Created May 11, 2021 13:57 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@pe7er
pe7er / checkfiles.php
Created February 19, 2021 17:14
PHP website script to send an email notification about the changed .php files in the last 24 hours
<?php
/**
* @package CheckChangedFiles
*
* @copyright Copyright (C) 2021 db8.nl. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
/**
* A script to check new files and mail them to an e-mail address
@pe7er
pe7er / rsformcleanup.php
Last active July 10, 2018 09:45
Joomla PHP CLI script to remove old RSFormPro submissions from the RSFormPro database tables
<?php
/*
Joomla PHP CLI script to remove old form submissions in RSFormPro database tables
by Peter Martin, https://db8.nl (Twitter: @pe7er)
You can use RSFormPro in your Joomla website as form component to interact with your visitors.
It can be configured to send an email notification to the visitor and the site admin.
By default RSFormPro adds the submitted form data in the database.
@pe7er
pe7er / hikashop-EU-vat-rates-2015
Last active January 23, 2019 14:28
EU country VAT rates + tax zones for Hikashop (webshop for Joomla)
/*! European Union country VAT rates + tax zones for Hikashop (webshop for Joomla)
by Peter Martin
Company: http://www.db8.nl
Twitter: @pe7er
Currently, before January 1st 2015, VAT on e-services (like telecommunications, radio & television
broadcasting and electronic services) to consumers (and businesses without VAT number) within the EU,
is charged based on the location (EU country) of the seller.
Starting on January 1st 2015, the VAT on e-services must be calculated based on the end customer’s