Skip to content

Instantly share code, notes, and snippets.

View saber13812002's full-sized avatar
💭
stackoverflow+codegrepper.com

Saber tabatabaee yazdi saber13812002

💭
stackoverflow+codegrepper.com
View GitHub Profile
@saber13812002
saber13812002 / php hello world
Created May 17, 2018 10:13
first php tutorial when you install xampp on windows and put this file in xampp html folders . by default C:\xampp\htdocs
<?php
echo 'hello world';
?>
Installing WP-CLI in Windows
WP-CLI is a tool for controlling WordPress through a console window.
thanks to author of this page on wensolutions.com
http://wensolutions.com/installing-wp-cli-in-windows/
For linux : https://www.jetbrains.com/help/idea/using-the-wordpress-command-line-tool-wp-cli.html
Although it is said that wp-cli requires UNIX-like environment (OS X, Linux, FreeBSD, Cygwin) environment however it is still possible to install in Windows environment.
cd install-directory/
#wget --no-check-certificate http://www.wordpress.org/latest.tar.gz
#tar xfz latest.tar.gz
#mv wordpress/* ./
#rmdir ./wordpress/
#rm -f latest.tar.gz
wp core download
@saber13812002
saber13812002 / parse-url.php
Created June 14, 2018 09:25 — forked from bryanwillis/parse-url.php
Parse url. Break down a url to get the parameters / arguments. Very helpful....
<?php
$url = 'http://usr:pss@example.com:81/mypath/myfile.html?a=b&b[]=2&b[]=3#myfragment';
if ($url === unparse_url(parse_url($url))) {
print "YES, they match!\n";
}
function unparse_url($parsed_url) {
$scheme = isset($parsed_url['scheme']) ? $parsed_url['scheme'] . '://' : '';
$host = isset($parsed_url['host']) ? $parsed_url['host'] : '';
<?php
namespace App\Console\Commands;
use Illuminate\Console\Command;
use File;
class MakeViewCommand extends Command
{
/**
@saber13812002
saber13812002 / mellat.php
Created June 7, 2019 15:44
Laravel when add larabook/gateway (Mellat gateway), but I get below error: SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://bpm.shaparak.ir/pgwchannel/services/pgw?wsdl' :
<?php
namespace Larautility\Gateway\Mellat;
use DateTime;
use Illuminate\Support\Facades\Input;
use Larautility\Gateway\Enum;
use SoapClient;
use Larautility\Gateway\PortAbstract;
use Larautility\Gateway\PortInterface;
@saber13812002
saber13812002 / bankmellat plugin connect to banktest.ir
Created June 13, 2019 12:00
bankmellat wp plugin connect to banktest.ir
<?php
defined('ABSPATH') or die("-1");
if (!class_exists('nusoap_base')) {
require_once(plugin_dir_path(__FILE__) . '/lib/nusoap.php');
}
function WPBEGPAY_ShortCode()
{
@saber13812002
saber13812002 / 1. autoplay-video.directive.ts
Created July 9, 2019 23:18 — forked from Bengejd/1. autoplay-video.directive.ts
Ionic - Auto play/pause videos on scroll.
import { Directive } from '@angular/core';
@Directive({
selector: 'video'
})
export class AutoplayVideoDirective { }
@saber13812002
saber13812002 / Dockerfile
Created July 11, 2019 16:36 — forked from mhemrg/Dockerfile
Nodejs + puppeteer + docker
FROM liararepo/node-platform
RUN apt-get update \
# See https://crbug.com/795759
&& apt-get install -yq libgconf-2-4 \
# Install latest chrome dev package, which installs the necessary libs to
# make the bundled version of Chromium that Puppeteer installs work.
&& apt-get install -y wget --no-install-recommends \
&& wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
FROM liararepo/laravel-platform:frontend
FROM liararepo/laravel-platform:backend
RUN chgrp -R www-data /var/www/html/lib/vendor
RUN chmod -R ug+rwx /var/www/html/lib/vendor