Skip to content

Instantly share code, notes, and snippets.

View izdrail's full-sized avatar
🌲
Open to work

Stefan Bogdan izdrail

🌲
Open to work
  • Laravel Agency
  • Essex
View GitHub Profile
@izdrail
izdrail / guzzle.php
Last active May 26, 2021 21:43
Guzzle Parallel Extract
require __DIR__ . '/vendor/autoload.php';
use GuzzleHttp\Client as GuzzleClient;
use GuzzleHttp\Promise as GuzzlePromise;
$client = new GuzzleClient(['timeout' => 12.0]); // see how i set a timeout
$requestPromises = [];
$sitesArray = SiteEntity->getAll(); // returns an array with objects that contain a domain
foreach ($sitesArray as $site) {
$requestPromises[$site->getDomain()] = $client->getAsync('http://' . $site->getDomain());
*/2 * * * * php72 /home/admin/web/lzomarketing.com/public_html/bin/console mautic:segments:update > /home/admin/web/lzomarketing.com/logs/cron/segments_update.log 2>&1
*/3 * * * * php72 /home/admin/web/lzomarketing.com/public_html/bin/console mautic:campaigns:rebuild > /home/admin/web/lzomarketing.com/logs/cron/campaigns_rebuild.log 2>&1
*/4 * * * * php72 /home/admin/web/lzomarketing.com/public_html/bin/console mautic:campaigns:trigger > /home/admin/web/lzomarketing.com/logs/cron/campaigns_trigger.log 2>&1
*/5 * * * * php72 /home/admin/web/lzomarketing.com/public_html/bin/console mautic:emails:send > /home/admin/web/lzomarketing.com/logs/cron/emails_sends.log 2>&1
*/6 * * * * php72 /home/admin/web/lzomarketing.com/public_html/bin/console mautic:messages:send > /home/admin/web/lzomarketing.com/logs/cron/messages_sends.log 2>&1
*/7 * * * * php72 /home/admin/web/lzomarketing.com/public_html/bin/console mautic:broadcasts:send > /home/admin/web/lzomarketing.com/logs/cron/broadcasts.log 2>&1
*/8 * * * * php72 /home
@izdrail
izdrail / Delete-wordpress posts
Created February 16, 2021 09:23
Delete All Wordpress Posts Using SQL
DELETE a,b,c
FROM wp_posts a
LEFT JOIN wp_term_relationships b
ON (a.ID = b.object_id)
LEFT JOIN wp_postmeta c
ON (a.ID = c.post_id)
WHERE a.post_type = '{{your CPT}}';
{
"name": "roots/bedrock",
"type": "project",
"license": "MIT",
"description": "WordPress boilerplate with modern development tools, easier configuration, and an improved folder structure",
"homepage": "https://roots.io/bedrock/",
"authors": [
{
"name": "Scott Walkinshaw",
"email": "[email protected]",
@izdrail
izdrail / gist:797e505e37bced49ddbc511d1dd331e9
Created November 7, 2019 15:57 — forked from pawelmhm/gist:8917867
Scrapy spider crawling Stack Overflow
from scrapy.spider import Spider
from scrapy.contrib.spiders import CrawlSpider, Rule
from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor
from scrapy.selector import Selector
from scrapy.item import Item, Field
import urllib
class Question(Item):
tags = Field()
answers = Field()
@izdrail
izdrail / xdebug_devilbox_phpstorm_postman.md
Created July 18, 2019 08:42 — forked from marcandreappel/xdebug_devilbox_phpstorm_postman.md
Using Xdebug on Devilbox with PhpStorm and Postman

Host OS

Tested on:

  • openSUSE 15.1 Leap
  • Fedora 30

Check before setup:

  • Accept in the firewall the port 9000 TCP

Docker

@izdrail
izdrail / BotUi.vue
Created July 13, 2019 13:19 — forked from Fab1en/BotUi.vue
BotUI integration into VueJS
<template>
<div class="botui botui-container" v-botui-container>
<div class="botui-messages-container">
<div v-for="msg in messages" class="botui-message" :class="[{human: msg.human, bot: !msg.human}, msg.cssClass]" v-botui-scroll>
<transition name="slide-fade">
<div v-if="msg.visible" :class="[{human: msg.human, 'botui-message-content': true}, msg.type]">
<span v-if="msg.type == 'text'" v-text="msg.content" v-botui-markdown></span>
<iframe v-if="msg.type == 'embed'" :src="msg.content" frameborder="0" allowfullscreen scrolling="no"></iframe>
</div>
</transition>
https://media.readthedocs.org/pdf/designpatternsphp/latest/designpatternsphp.pdf
@izdrail
izdrail / forge.magento2.nginx.config
Last active January 3, 2019 11:18
This is a nginx configuration file that works for forge systems
# Magento Vars
# set $MAGE_ROOT /path/to/magento/root;
# set $MAGE_MODE default; # or production or developer
#
# Example configuration:
upstream fastcgi_backend {
# use tcp connection
# server 127.0.0.1:9000;
# or socket
server unix:/var/run/php/php7.2-fpm.sock;
@izdrail
izdrail / Schema.org
Last active November 20, 2018 18:51
Schema org for Google Seo