Skip to content

Instantly share code, notes, and snippets.

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

Kevin kevinmamaqi

🏠
Working from home
View GitHub Profile
@oanhnn
oanhnn / using-multiple-github-accounts-with-ssh-keys.md
Last active May 6, 2024 21:40
Using multiple github accounts with ssh keys

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
@primozcigler
primozcigler / class-pt-customize-control-range.php
Created March 17, 2015 10:07
Footer widgets layout customizer control.
<?php
/**
* Range Control Class
*/
class WP_Customize_Range_Control extends WP_Customize_Control {
/**
* @access public
* @var string
@roykho
roykho / gist:1062c708af772412fe7e
Last active October 28, 2022 16:01
WooCommerce: Remove related products when up-sell products are defined
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_upsell_display', 15 );
remove_action( 'woocommerce_after_single_product_summary', 'woocommerce_output_related_products', 20 );
add_action( 'woocommerce_after_single_product_summary', 'related_upsell_products', 15 );
function related_upsell_products() {
global $product;
if ( isset( $product ) && is_product() ) {
$upsells = version_compare( WC_VERSION, '3.0', '<' ) ? $product->get_upsells() : $product->get_upsell_ids();
@chrisdigital
chrisdigital / Frontend user profile in WordPress
Created May 6, 2013 13:27
Setting up a editable user profile in WordPress on the frontend.
//How to edit a user profile on the front end?
//http://wordpress.stackexchange.com/questions/9775/how-to-edit-a-user-profile-on-the-front-end
//Forcing nickname as display_name in custom edit profile template
//http://wordpress.stackexchange.com/questions/35403/forcing-nickname-as-display-name-in-custom-edit-profile-template
///////
<?php