Skip to content

Instantly share code, notes, and snippets.

View seramo's full-sized avatar
🏠
Working from home

Rasoul Mousavian seramo

🏠
Working from home
View GitHub Profile
@sedruski
sedruski / main.py
Created April 23, 2026 15:41
Colab / Drive (yt-dlp)
# ==============================
# Install & Fix Widgets
# ==============================
!pip install -q ipywidgets requests yt-dlp
from google.colab import output
output.enable_custom_widget_manager()
# ==============================
# Mount Drive
# ==============================
@luistinygod
luistinygod / tinygod-recover-roles.php
Created May 24, 2020 17:14
WordPress Plugin: Restores all the default roles and caps in the WordPress
<?php
/**
* Recover or Reset the default WordPress user roles and caps
* Install it as a WordPress plugin, activate it and deativate. That's it.
*
* @wordpress-plugin
* Plugin Name: tinyGod Recover User Roles
* Plugin URI:
* Author: luistinygod
* Author URI: https://tinygod.pt
@someguy9
someguy9 / disable-wordpress-admin-new-user-notification.php
Created May 14, 2020 19:05
Disable the WordPress new user email notification sent to the site admin
<?php
//Disable the new user notification sent to the site admin
function smartwp_disable_new_user_notifications() {
//Remove original use created emails
remove_action( 'register_new_user', 'wp_send_new_user_notifications' );
remove_action( 'edit_user_created_user', 'wp_send_new_user_notifications', 10, 2 );
//Add new function to take over email creation
add_action( 'register_new_user', 'smartwp_send_new_user_notifications' );
add_action( 'edit_user_created_user', 'smartwp_send_new_user_notifications', 10, 2 );
@slayer
slayer / cloudflare-delete-all-records.sh
Last active May 2, 2026 00:14
Delete all DNS records for specified zone
#!/bin/bash
TOKEN="xxxxxxxxxxxxxxxxxxx"
ZONE_ID=2222222222222222222222222
# EMAIL=me@gmail.com
# KEY=11111111111111111111111111
# Replace with
# -H "X-Auth-Email: ${EMAIL}" \
# -H "X-Auth-Key: ${KEY}" \
@manzoorwanijk
manzoorwanijk / README.md
Last active April 1, 2026 17:44
Google Script to bypass the blockage of Telegram Bot API from by webhost

WPTelegram Google Script

You can use this script to bypass the bans on Telegram API by different hosts. Simply send the request to this script instead of the Telegram Bot API after deploying it as a web app and allowing anonymous access.

Params

It accepts bot GET and POST requests with the following params

name type Description
@lukecav
lukecav / wp-config.php
Created August 23, 2017 20:29
Enable Code Snippets safe mode with this constant in WordPress
define('CODE_SNIPPETS_SAFE_MODE', true);
@ollietreend
ollietreend / acf-php-to-json.php
Last active January 12, 2026 13:55
Convert Advanced Custom Fields Pro configuration from PHP to JSON.
<?php
/**
* Plugin Name: Convert ACF PHP to JSON
* Description: Convert Advanced Custom Fields Pro configuration from PHP to JSON.
*/
namespace ConvertAcfPhpToJson;
/**
* Add submenu item under 'Custom Fields'
@cryptexvinci
cryptexvinci / remove_checkout_fields.php
Last active November 14, 2025 06:07
Remove fields from WooCommerce checkout page.
<?php
add_filter( 'woocommerce_checkout_fields' , 'custom_remove_woo_checkout_fields' );
function custom_remove_woo_checkout_fields( $fields ) {
// remove billing fields
unset($fields['billing']['billing_first_name']);
unset($fields['billing']['billing_last_name']);
unset($fields['billing']['billing_company']);
@sumanthkumarc
sumanthkumarc / filename_sanitizer.php
Created July 12, 2016 08:10
PHP function to sanitize the file name to be url safe
/*
* Function to sanitize the file name for url and file name safe.
*
* @param string $filename
* The unsafe filename is taken as input
*
* @return string
* The safe file name is returned.
*/
function filename_sanitizer($unsafeFilename){
@dmitriynet
dmitriynet / php
Created November 20, 2015 10:05
mb_unserialize
function mb_unserialize($string)
{
$recovered = preg_replace_callback(
'!(?<=^|;)s:(\d+)(?=:"(.*?)";(?:}|a:|s:|b:|d:|i:|o:|N;))!s',
function($match) {
return 's:' . mb_strlen($match[2], '8bit');
},
$string
);