Skip to content

Instantly share code, notes, and snippets.

@kaioken
kaioken / updateShopifyOrder.php
Created December 14, 2023 20:55
Update a shopify Order
<?php
declare(strict_types=1);
require 'vendor/autoload.php';
// Set up your Shopify credentials
$config = [
'ShopUrl' => '{store}.myshopify.com',
location @prerender {
proxy_set_header X-Prerender-Token {token};
set $prerender 0;
if ($http_user_agent ~* "googlebot|bingbot|yandex|baiduspider|twitterbot|facebookexternalhit|rogerbot|linkedinbot|embedly|quora link preview|showyoubot|outbrain|pinterest\/0\.|pinterestbot|slackbot|vkShare|W3C_Validator|whatsapp") {
set $prerender 1;
}
if ($args ~ "_escaped_fragment_") {
set $prerender 1;
}
@kaioken
kaioken / .php_cs
Last active May 3, 2020 16:28
MC PHP-CS-Fixer configuration file.
<?php
return PhpCsFixer\Config::create()
->setRules([
'@PSR2' => true,
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'combine_consecutive_unsets' => true,
'method_separation' => true,
'no_multiline_whitespace_before_semicolons' => true,
@kaioken
kaioken / elastic-cluster-settings.md
Last active December 29, 2019 23:51
AWS Elasticsearch Update Settings
curl --location --request PUT 'https://elasticclustre.amazonaws.com/_cluster/settings'  -H 'Content-Type: application/json' \
--data '{
    "persistent": {
        "action.auto_create_index": "true"
    }
}'
@kaioken
kaioken / wp_post_migration.php
Last active September 9, 2019 02:49
Wordpress Post Migration
<?php
/**
* Wordpress migration from another wordpress site via its API
*/
$path = '/home/websitefolder/public';
$wordpressUrl = 'https://migratingwordpresssite.com';
$redisHost = '127.0.0.1';

Install RabbitMQ on CentOS 7

sudo yum -y install epel-release
sudo yum -y update

Install Erlang

Download repository

@kaioken
kaioken / cloudSettings
Last active August 11, 2021 20:42
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-08-18T23:46:13.723Z","extensionVersion":"v3.4.3"}
@kaioken
kaioken / .php_cs
Created June 17, 2019 13:39
.php_cs
<?php
return PhpCsFixer\Config::create()
->setRules([
'@PSR2' => true,
'array_indentation' => true,
'array_syntax' => ['syntax' => 'short'],
'combine_consecutive_unsets' => true,
'method_separation' => true,
'no_multiline_whitespace_before_semicolons' => true,
@kaioken
kaioken / postmortem.md
Created January 17, 2019 22:32 — forked from mlafeldt/postmortem.md
Example Postmortem from SRE book, pp. 487-491

Shakespeare Sonnet++ Postmortem (incident #465)

Date

2015-10-21

Authors

  • jennifer
  • martym
@kaioken
kaioken / mailgunreport.php
Last active November 5, 2018 22:55
Mailgun Report via API using PHP
<?php
require_once __DIR__ . '/../vendor/autoload.php';
/**
* Get mailgun report
*
* @param string $url
* @return array
*/