Skip to content

Instantly share code, notes, and snippets.

@Rmanaf
Rmanaf / TaskExtensions.cs
Last active September 11, 2024 04:58
A collection of extension methods for the Task class
/// <summary>
/// A collection of extension methods for the Task class
/// </summary>
public static class TaskExtensions
{
/// <summary>
/// Introduces a delay before continuing with the next task.
/// This method is used for non-generic tasks (Task without a result).
/// </summary>
@Rmanaf
Rmanaf / wp-installer.sh
Last active September 5, 2024 11:30
This script will set up a basic WordPress installation on an Ubuntu server and is designed to be simple and straightforward, suitable for quick deployments.
#!/bin/bash
# Function to generate a random password
generate_password() {
echo $(openssl rand -base64 12)
}
# Ask for server name (FQDN) and validate
while true; do
read -p "Enter server name (e.g., server1.example.com): " server_name
@Rmanaf
Rmanaf / collection-banner-generator.py
Created November 17, 2023 09:15
This code is for generating a banner image with randomly selected and resized images from a directory.
'''
This code is for generating a banner image with randomly selected and resized images from a directory.
Usage:
- Run the code in a Python interpreter or an IDE.
- Enter the relative path to the image directory that contains the images you want to use for the banner.
- Enter the desired output width and height of the banner image in pixels. For example, “1400” and “400”.
- The code will create and save the banner image in the same directory as the input images, with a random filename starting with “banner_”
- The code will also show the banner image in a new window. You can close the window when you are done.
'''
@Rmanaf
Rmanaf / svn_auto_commit.sh
Created November 6, 2023 08:11
SVN Commit Automation for Unix-like environment
#!/bin/bash
# SVN Automation Script
# Usage:
# 1. Save this script to a file (e.g., svn_auto_commit.sh)
# 2. Make it executable by running 'chmod +x svn_auto_commit.sh' in the terminal
# 3. Run it to commit the changes
read -e -p "Enter the SVN working copy directory: " svn_dir
@Rmanaf
Rmanaf / research.js
Last active January 17, 2024 10:46
This JavaScript code is designed to scrape data from a Google Scholar profile page and calculate various research indices for a researcher.
/**
* This JavaScript code is designed to scrape data from a Google Scholar profile page and calculate
* various research indices for a researcher. It extracts information such as publication years,
* citations, and the h-index, and then computes several research metrics, including the R-index,
* A-index, G-index, M-index, E-index, AR-index, and HG-index. The code also provides statistics
* about the researcher's publications, total citations, h-core citations, and more.
*
*
* ** Usage: **
*