Skip to content

Instantly share code, notes, and snippets.

View Aleksandar-Mitic's full-sized avatar
🏠
Working from home

Aleksandar Mitic Aleksandar-Mitic

🏠
Working from home
View GitHub Profile
@Aleksandar-Mitic
Aleksandar-Mitic / .htaccess
Created December 8, 2017 11:04 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@Aleksandar-Mitic
Aleksandar-Mitic / woocommerce-create-order.md
Created January 17, 2018 10:34 — forked from stormwild/woocommerce-create-order.md
WooCommerce Creating Order Programmatically

WooCommerce Creating Order Programmatically

WooCommerce Create Order

creating Woocommerce order with line_item programatically

// http://stackoverflow.com/questions/26581467/creating-woocommerce-order-with-line-item-programatically
$address = array(
            'first_name' => 'Fresher',
@Aleksandar-Mitic
Aleksandar-Mitic / gist:581e56b093650d7743e8103e427025e2
Created February 26, 2018 14:17 — forked from Yame-/gist:d154d574ee7df2f5b3eb
Retrieving billing_first_name, billing_last_name, ... via Sessions - WooCommerce
<?php
/*
Add this code to your functions.php
*/
add_action('woocommerce_checkout_update_order_review', 'get_customer_details');
function get_customer_details($post_data){
global $woocommerce;
// Details you want injected into WooCommerce session.
@Aleksandar-Mitic
Aleksandar-Mitic / webdev_online_resources.md
Created July 18, 2018 11:26 — forked from bradtraversy/webdev_online_resources.md
Online Resources For Web Developers (No Downloading)
@Aleksandar-Mitic
Aleksandar-Mitic / fromfolder.php
Created August 21, 2018 06:03 — forked from projectxcappe/fromfolder.php
Display Images From A Folder with PHP
//Display Images From A Folder with PHP
<?php
$files = glob("images/*.*");
for ($i=1; $i<count($files); $i++)
{
$num = $files[$i];
echo '<img src="'.$num.'" alt="random image">'."&nbsp;&nbsp;";
}
?>
@Aleksandar-Mitic
Aleksandar-Mitic / add-product-to-cart.php
Created October 2, 2018 13:50 — forked from sc0ttkclark/add-product-to-cart.php
WooCommerce Automatically add product to cart on site visit
<?php
/*
* This code goes into theme functions.php or a custom plugin
*/
/**
* Add product to cart on page load
*/
function add_product_to_cart() {
@Aleksandar-Mitic
Aleksandar-Mitic / ubuntu-lamp.md
Created March 12, 2019 20:45 — forked from kbond/post.md
Ubuntu LAMP Development Environment Setup

Install git:

sudo apt-get install git

Configure Git:

touch ~/.gitignore_global
git config --global core.excludesfile ~/.gitignore_global
git config --global user.name "Your Name"

git config --global user.email "Your Email"

@Aleksandar-Mitic
Aleksandar-Mitic / deployment_guide.md
Created November 20, 2019 13:19 — forked from vicgonvt/deployment_guide.md
Deployment Guide for Ubuntu Server from Scratch with Laravel
@Aleksandar-Mitic
Aleksandar-Mitic / RegistrationController.php
Created February 25, 2020 09:40 — forked from oranges13/RegistrationController.php
Populate external drop downs for datatable filtering
/**
* Process datatables ajax request.
*
* @return \Illuminate\Http\JsonResponse
*/
public function allData(Request $request)
{
$registrations = Registration::with('product')->with('reg_type')->select('registrations.*');
$datatable = Datatables::of($registrations);
@Aleksandar-Mitic
Aleksandar-Mitic / bashinit.bash
Created May 13, 2020 10:27
POPos Install Script
## This Script is My Personal Quick Install for Ubuntu/Mint based systems for Dev Purposes
##
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install *snapd*
sudo apt-get install *flatpak*
sudo apt-get update
sudo apt-get upgrade