Skip to content

Instantly share code, notes, and snippets.

View barbotkin's full-sized avatar

Roman Barbotkin barbotkin

View GitHub Profile
@barbotkin
barbotkin / upgrade_magento_2.0_to_2.15.sh
Last active February 22, 2017 13:32
upgrade magento 2.0 to 2.1.5 (magento 2 cli)
composer require magento/product-community-edition 2.1.5 --no-update
composer update
rm -rf var/di var/generation
php bin/magento cache:clean
php bin/magento cache:flush
php bin/magento setup:upgrade
php bin/magento setup:di:compile
php bin/magento indexer:reindex
php bin/magento --version
@barbotkin
barbotkin / custom_class_image.php
Last active February 7, 2017 15:45
Add Custom class image (in the_content attached images) - Wordpress
<?php
// Input:
// <img src="...">
// Output:
// <a href="../wp-content/uploads/2016/09/2016-012_0005.jpg" data-lightbox="roadtrip">
// <img src=".../wp-content/uploads/2016/09/2016-012_0005-150x150.jpg" alt="2016-012_0005" width="150" height="150" class="custom-class alignleft size-thumbnail wp-image-1048">
// </a>
@barbotkin
barbotkin / mailchimp-subscribe-api-3.php
Last active February 2, 2017 15:15
Mailchimp subscribe php api 3
<?php
$data = [
'email' => $_POST['email'],
'status' => 'subscribed',
'firstname' => $_POST['name'],
];
// accesses key and list
$apiKey = '11111111111111111111111111111111-1234';
$listId = '1234567890';
@barbotkin
barbotkin / curl-bullhorn-apI.php
Last active February 2, 2017 15:17
Code File Upload Resume to Bullhorn PHP API
<?php
// File Upload Resume
$data = "file/Candidate/".$candidate->changedEntityId."/raw?externalID=UserHeadshot&fileType=CV&type=CV&BhRestToken=".$token;
$fileName = $_FILES['file']['name'];
$filePath = $_FILES['file']['tmp_name'];
$post = file_get_contents(''.$filePath.'');
$eol = "\r\n";
$separator = ''.md5(microtime()).'';
@barbotkin
barbotkin / install_intl_php7.sh
Created December 16, 2015 13:16
Add packege intl in php7
cd intl
phpize
./configure --enable-intl
make
sudo make install
# in php.ini uncomment extension=php_intl.dll and replaced by extension=intl.so
@barbotkin
barbotkin / protecting_wordpress.sh
Last active January 7, 2016 16:47
Protecting wordpress folders and files
# Protect Folders
find wp-content -type d -exec chmod 555 {} +
# Protect Files
find wp-content -type f -exec chmod 444 {} +
# Allow write only in needed folder
find wp-content/uploads -type d -exec chmod 755 {} +
find wp-content/uploads -type f -exec chmod 644 {} +
@barbotkin
barbotkin / install_php7_lamp.sh
Last active April 27, 2016 09:50
Install php7 in Linux (Mint/Ubuntu) LAMP Server
#! /bin/bash
# PHP 7 Initial Compile (Install php7 Linux (Mint/Ubuntu) LAMP) ##
# Author: Roman Barbotkin
# Fixed error and simplified, I tested for Linux Mint 7.3.
# Install: just run this file, it will do everything for you :)
# If make error uncoments 2 line.
#sudo apt-get purge make
#sudo apt-get install make