Skip to content

Instantly share code, notes, and snippets.

View manutheblacker's full-sized avatar
🎯
Focusing

Emmanuel A. manutheblacker

🎯
Focusing
View GitHub Profile
<?php
/**
* Escape all translations with
*/
__( ‘Some String’, ‘text-domain’ ); _e( ‘Some string’, ‘text-domain’ );.
/**
* When there is no HTML use:
*/
@manutheblacker
manutheblacker / add-custom-sms-gateway.php
Last active September 28, 2022 11:03
How to add custom sms gateway to Ultimate SMS Notifications for WooCommerce ?
<?php
// Use this filter to hide the default API settings.
add_filter('woo_usn_display_sms_api', '__return__false');
// Add your fields for filling SMS Gateways API Keys.
add_action('woo_usn_options_before_sms_api_fields', your_function_here(){
// display your fields here and make sure to add button to save the settings
});
@manutheblacker
manutheblacker / phpcs.md
Created September 16, 2022 03:02 — forked from PatelUtkarsh/phpcs.md
PHPCS for Linux

Installation

Install PEAR

sudo apt-get install php-pear

Install PHP_CodeSniffer

@manutheblacker
manutheblacker / index.html
Created August 3, 2022 06:07
Tailwind Navbar
<!-- navbar goes here -->
<nav class="bg-gray-100">
<div class="max-w-6xl mx-auto px-4">
<div class="flex justify-between">
<div class="flex space-x-4">
<!-- logo -->
<div>
<a href="#" class="flex items-center py-5 px-2 text-gray-700 hover:text-gray-900">
<svg class="h-6 w-6 mr-1 text-blue-400" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<div id="meet"></div>
@manutheblacker
manutheblacker / fix-wordpress-permissions.sh
Created February 11, 2022 20:05 — forked from Adirael/fix-wordpress-permissions.sh
Fix wordpress file permissions
#!/bin/bash
#
# This script configures WordPress file permissions based on recommendations
# from http://codex.wordpress.org/Hardening_WordPress#File_permissions
#
# Author: Michael Conigliaro <mike [at] conigliaro [dot] org>
#
WP_OWNER=www-data # <-- wordpress owner
WP_GROUP=www-data # <-- wordpress group
WP_ROOT=$1 # <-- wordpress root directory
@manutheblacker
manutheblacker / nginx-tuning.md
Created November 16, 2021 05:27 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@manutheblacker
manutheblacker / embed gist.md
Created July 7, 2021 07:04 — forked from Albert-W/embed gist.md
embed gist in iframe

Embed gist in iframe

it is used to embed gist to an asynchronously-loaded web pages.

<iframe 
    width="100%"
    height="350"    
    src="data:text/html;charset=utf-8,
 
<?php
//this hook take 3 parameters
// api_used : the api name selected into the SMS Gateway screen
// phone_number : the phone number who will receive the message
// message_to_send : the message that will be sent to the phone number
// you must return 200 if the delivery is successfully or 40X if it fails
add_filter('woo_usn_send_sms_to_customer', api_used, phone_number, message_to_send);
<?php
// api_choosed : the name of the sms gateway that will be saved
// data : the list of data that you have edited with the JS filter (woo_usn_save_gateways_data)
add_action('woo_usn_save_sms_gateway_credentials', api_choosed, data );