Skip to content

Instantly share code, notes, and snippets.

View hAbd0u's full-sized avatar
👀
Looking for new opportunities and challenges

Ilyes Abdelrazak Beladel hAbd0u

👀
Looking for new opportunities and challenges
View GitHub Profile
@igorbenic
igorbenic / functions-2.php
Last active July 31, 2022 22:26
How to Move Payments on WooCommerce Checkout | https://www.ibenic.com/move-payments-woocommerce-checkout
<?php
/**
* Adding the payment fragment to the WC order review AJAX response
*/
add_filter( 'woocommerce_update_order_review_fragments', 'my_custom_payment_fragment' );
/**
* Adding our payment gateways to the fragment #checkout_payments so that this HTML is replaced with the updated one.
*/
function my_custom_payment_fragment( $fragments ) {
@enl
enl / 01-pure-immutable.php
Last active May 9, 2022 19:13
Immutable classes in PHP
/**
* This class is purely immutable.
* PHP protects the string from changing by its copy-on-change mechanics
* If you do `$str = $immutable->getField();` and then change `$str`
* PHP will copy the value and change only second one.
*/
class Immutable
{
/** @var string */
private $field;
@ammgws
ammgws / letsencrypt-acme-guide.md
Last active July 23, 2023 17:19
Using acme.sh script to renew LetsEncrypt certs using non-standard SSL port

1. Install acme.sh shell script

git clone https://github.com/Neilpang/acme.sh.git
cd acme.sh
./acme.sh --install

Optionally, set the home dir and/or account info (if already have one).
If was previously using LetsEncrypt's certbot, can probably get account info from /etc/letsencrypt/accounts/acme-v01.api.letsencrypt.org/directory/*/regr.json.

@igorbenic
igorbenic / checkout-form-final.php
Last active February 21, 2024 21:34
How to Customize WooCommerce Checkout Pages like a Hero | https://www.ibenic.com/customize-woocommerce-checkout-pages
<?php
/**
* Checkout Form
*
* This template can be overridden by copying it to yourtheme/woocommerce/checkout/form-checkout.php.
*
* HOWEVER, on occasion WooCommerce will need to update template files and you
* (the theme developer) will need to copy the new files to your theme to
* maintain compatibility. We try to do this as little as possible, but it does
* happen. When this occurs the version of the template file will be bumped and
@amupoti
amupoti / Resources.md
Last active November 17, 2021 00:32
Useful links regarding different programming activities
@blemoine
blemoine / gist:e6045ed93b3d90a52891
Last active August 3, 2023 15:18
Convert Lambert 93 to GPS Coordinates Latitude / Longitude (wgs84)
Math.tanh = Math.tanh || function(x) {
if(x === Infinity) {
return 1;
} else if(x === -Infinity) {
return -1;
} else {
return (Math.exp(x) - Math.exp(-x)) / (Math.exp(x) + Math.exp(-x));
}
};
@rxaviers
rxaviers / gist:7360908
Last active April 25, 2024 11:15
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@plentz
plentz / nginx.conf
Last active April 24, 2024 11:15
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@adamjohnson
adamjohnson / publickey-git-error.markdown
Last active April 18, 2024 01:00
Fix "Permission denied (publickey)" error when pushing with Git

"Help, I keep getting a 'Permission Denied (publickey)' error when I push!"

This means, on your local machine, you haven't made any SSH keys. Not to worry. Here's how to fix:

  1. Open git bash (Use the Windows search. To find it, type "git bash") or the Mac Terminal. Pro Tip: You can use any *nix based command prompt (but not the default Windows Command Prompt!)
  2. Type cd ~/.ssh. This will take you to the root directory for Git (Likely C:\Users\[YOUR-USER-NAME]\.ssh\ on Windows)
  3. Within the .ssh folder, there should be these two files: id_rsa and id_rsa.pub. These are the files that tell your computer how to communicate with GitHub, BitBucket, or any other Git based service. Type ls to see a directory listing. If those two files don't show up, proceed to the next step. NOTE: Your SSH keys must be named id_rsa and id_rsa.pub in order for Git, GitHub, and BitBucket to recognize them by default.
  4. To create the SSH keys, type ssh-keygen -t rsa -C "your_email@example.com". Th