Skip to content

Instantly share code, notes, and snippets.

View techies23's full-sized avatar
🎧
Beep Beep

Deepen Bajracharya techies23

🎧
Beep Beep
View GitHub Profile
@techies23
techies23 / main.yml
Created March 17, 2023 09:58 — forked from cagartner/deploy.sh
Laravel Push deploy Github actions example
name: CD
on:
push:
branches: [ production ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:

How to get Composer running on SiteGround shared

  1. Download getcomposer.org/composer.phar to your account's home directory — /home/username.
  2. Edit .bashrc file in same directory by adding alias composer='/usr/local/php56/bin/php-cli ~/composer.phar' line. Update php56 part to current relevant version, if necessary.
  3. Restart SSH session or run source ~/.bashrc to reload config.
  4. Use composer command!
@techies23
techies23 / remove-cross-sell-products.php
Last active November 27, 2019 07:06 — forked from prasidhda/remove-cross-sell-products.php
Remove Cross sell or up sell products from cart alongside main WooCommerce product
add_action( 'woocommerce_cart_item_removed', 'my_plugin_remove_upsell_crossell', 10, 2);
function my_plugin_remove_upsell_crossell( $cart_item, $cart ) {
//GETTING SESSION ID PAIRS
$product_id_cart_item_pairs = WC()->session->get( 'product_id_cart_item_pairs', array() );
$cart_item_product_pairs = WC()->session->get( 'cart_item_product_pairs', array() );
// Get the product ID using session store
$product_id = isset( $product_id_cart_item_pairs[ $cart_item ] ) ? $product_id_cart_item_pairs[ $cart_item ] : false;
if ( ! $product_id ) {
@techies23
techies23 / _blank.js
Created December 3, 2018 16:27 — forked from CrocoDillon/_blank.js
Automatically open external links in new tab or window.
// vanilla JavaScript
var links = document.links;
for (var i = 0, linksLength = links.length; i < linksLength; i++) {
if (links[i].hostname != window.location.hostname) {
links[i].target = '_blank';
}
}
// or in jQuery
@techies23
techies23 / Staging&ProductionUsingGit
Created August 1, 2016 10:20 — forked from mediabeastnz/Staging&ProductionUsingGit
Staging and Production Server using Git.
If you are running a large website where you will need to test new features on a seperate url before pushing them live then the following instructions are for you ;)
For this example imagine your url is apple.com and you want a development/staging site on a subdomain which is dev.apple.com
#Setup#
1. First thing you'll want to do is go ahead and create your website in plesk and add the subdomain dev.apple.com at the same time.
2. ssh into the server e.g. $ ssh username@ipaddress
3. Once logged in cd into the private directory (this will be where all git repos are stored) e.g. $ cd ~/private
4. Create the main repo e.g. $ git init --bare apple.git
5. Now to clone this new repo on your local machine. $ git clone ssh://username@ipaddres/~/private/apple.com