Skip to content

Instantly share code, notes, and snippets.

View JasvinderSingh1's full-sized avatar
🤘

Jasvinder Singh JasvinderSingh1

🤘
  • Lucknow, India
View GitHub Profile
@JasvinderSingh1
JasvinderSingh1 / dump.php
Created November 1, 2018 08:15
Database export using script
<?php
$host = "localhost";
$user = "odscinc.com";
$pwd = "0d5c1nc!!2014";
$db = "odscinc_com";
$mysqlUserName = "odscinc.com";
$mysqlPassword = "0d5c1nc!!2014";
$mysqlHostName = "localhost";
$DbName = "odscinc_com";
@JasvinderSingh1
JasvinderSingh1 / TYPO3
Created November 1, 2018 08:20
useful info
// reference for TYPO3
https://usetypo3.com
// i am getting blank screen on backend in typo3
To see what kind of an error produced the blank page it is very useful to alter your /typo3/typo3conf/localconf.php by adding
$TYPO3_CONF_VARS['SYS']['displayErrors'] = '1';
PDF invoice in aimeos typo3 shop
https://aimeos.org/help/help-f15/generating-a-pdf-invoice-t1036.html
@JasvinderSingh1
JasvinderSingh1 / custom options page
Created November 20, 2018 11:53
custom options page
<?php
/*
* Start::Front Page Options
*/
add_action( 'admin_enqueue_scripts', 'consultant_include_myuploadscript' );
function consultant_include_myuploadscript() {
if ( ! did_action( 'wp_enqueue_media' ) ) {
wp_enqueue_media();
https://scottbolinger.com/ionic-wordpress-app/
https://www.google.com/search?q=how+does+companies+know+if+a+doamin+is+purchaesed&rlz=1C1CHBD_enIN736IN737&oq=how+does+companies+know+if+a+doamin+is+purchaesed&aqs=chrome..69i57j33.14238j0j7&sourceid=chrome&ie=UTF-8
https://wordpress.stackexchange.com/questions/123298/term-begins-with-a-letter
https://www.quora.com/How-do-those-external-companies-know-I-bought-a-domain
<?php
define("API2PDF_BASE_ENDPOINT", 'https://v2018.api2pdf.com');
define("API2PDF_MERGE", API2PDF_BASE_ENDPOINT.'/merge');
define("API2PDF_WKHTMLTOPDF_HTML", API2PDF_BASE_ENDPOINT.'/wkhtmltopdf/html');
define("API2PDF_WKHTMLTOPDF_URL", API2PDF_BASE_ENDPOINT.'/wkhtmltopdf/url');
define("API2PDF_CHROME_HTML", API2PDF_BASE_ENDPOINT.'/chrome/html');
define("API2PDF_CHROME_URL", API2PDF_BASE_ENDPOINT.'/chrome/url');
define("API2PDF_LIBREOFFICE_CONVERT", API2PDF_BASE_ENDPOINT.'/libreoffice/convert');
<?php
// Copyright (C) 2009-2016 pdfcrowd.com
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
// restriction, including without limitation the rights to use,
// copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'http://api.resmush.it/ws.php?qlty=80&img=http://freetouse.com.dev.ceptiv.net/track-cover/thumb/Vlad-Gluschenko-Lean-On.jpg');
curl_setopt($ch, CURLOPT_POST,1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
//curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$result = curl_exec($ch);
if (curl_errno($ch)) {
$result = curl_error($ch);
}
If you want the URL rewriting as in Wordpress then PHP is the way. Here is simple example to begin with.
Folder structure
There are two files that are needed in the root folder, .htaccess and index.php, and it would be good to place the rest of the .php files in separate folder, like inc/.
root/
inc/
.htaccess
index.php
@JasvinderSingh1
JasvinderSingh1 / product-import.php
Created December 18, 2019 12:14
Custom import script for products (simple/variable) from different database to woocommerce
<?php
/*
* Custom import script for products (simple/variable) from different database to woocommerce
* custom-import-script.php
*/
//create product
function custom_import_product_shortcode_fun(){
@JasvinderSingh1
JasvinderSingh1 / order-import.php
Created December 18, 2019 12:15
Custom script to import order from a different database to WooCommerce
<?php
/*
* Custom script to import order from a different database to WooCommerce
*/
function custom_import_order_shortcode_fun2(){
ob_start();
global $wpdb;
//
// $old_orders = $wpdb->get_results( "SELECT * FROM `orders` WHERE orderid BETWEEN 68980 AND 69005");