Skip to content

Instantly share code, notes, and snippets.

View mehrshaddarzi's full-sized avatar

Mehrshad Darzi mehrshaddarzi

View GitHub Profile
@mehrshaddarzi
mehrshaddarzi / curl.php
Last active October 5, 2018 11:16
download file with Curl
<?php
//Curl With Getting Header
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_RETURNTRANSFER => 1,
CURLOPT_VERBOSE => 1,
CURLOPT_HEADER => array(
"cache-control: no-cache",
"content-type: application/x-www-form-urlencoded"
@mehrshaddarzi
mehrshaddarzi / Xampp Virtual Host.txt
Last active June 4, 2019 19:55
convert localhost to domain localhost.com in xampp windows
<VirtualHost *:80>
DocumentRoot "F:/Server/linuxphp7/htdocs/"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "F:/Server/linuxphp7/htdocs/package/"
ServerName package.test
</VirtualHost>
# -----------------------------------------------------------------
# .gitignore for WordPress @salcode
# ver 20160309
#
# From the root of your project run
# curl -O https://gist.githubusercontent.com/salcode/b515f520d3f8207ecd04/raw/.gitignore
# to download this file
#
# By default all files are ignored. You'll need to whitelist
# any mu-plugins, plugins, or themes you want to include in the repo.
<div style="text-align:center; font:50px Trebuchet Ms; color:#e3e3e3; margin-top:20%;">
Comming Soon ...
</div>
@mehrshaddarzi
mehrshaddarzi / Attr-product.php
Last active August 8, 2017 06:59
نمایش تمامی ویزگی های معرفی شده در ووکامرس
<?php
class Woocommerce_Bulk_Attribute_Manager_Product_Attibutes {
public function __construct() {
}
public function get_list_attributes(){
return wc_get_attribute_taxonomies();
}
public function get_list_attribute_slug(){
@mehrshaddarzi
mehrshaddarzi / add_product_in_wocom.php
Created August 8, 2017 14:00
افزودن محصول در ووکامرس
<?php
//add product dynamically
add_action('init',function(){
if(isset($_POST['pname-wordpress'])) {
//add post
$post_id = wp_insert_post( array(
'post_title' => trim($_POST['pname-wordpress']),
'post_content' => '',
'post_status' => 'draft',
@mehrshaddarzi
mehrshaddarzi / gist:61ba1265bdcc9e93b26808d25c15f8d6
Created August 9, 2017 05:38
add watchind node-sass in phpstorm
here is a simple configuration that works for me:
Program: <full path to your node-sass executable>, like ‘C:\Users\Elena.Pogorelova\AppData\Roaming\npm\node-sass.cmd’
Arguments: $FileName$ ../$FileNameWithoutExtension$.css
Working directory: $FileDir$
@mehrshaddarzi
mehrshaddarzi / bootstra-3-media-query.css
Created August 9, 2017 11:37
media query bootstrap 3
/* Large desktops and laptops */
@media (min-width: 1200px) {
}
/* Landscape tablets and medium desktops */
@media (min-width: 992px) and (max-width: 1199px) {
}
@mehrshaddarzi
mehrshaddarzi / git.php
Last active April 25, 2019 16:39
all command line git
<?php
//******************Work Wit Git Tag
//Create git tag
git tag <tagname>
//push git tag
git push origin --tags
@mehrshaddarzi
mehrshaddarzi / bash script.md
Last active November 24, 2023 11:36
all commandline in ssh linux server

Example 1

#!/bin/bash
echo "Bash version ${BASH_VERSION}..."
for i in {0..10..1}
  do 
     echo "Welcome $i times"
     sleep 2
done