Skip to content

Instantly share code, notes, and snippets.

View martinboy's full-sized avatar

Alexander Martinkevich Martinboy martinboy

View GitHub Profile
@viktorpetryk
viktorpetryk / mailhog-install.md
Last active January 27, 2023 09:08
MailHog installation on Ubuntu

Install & Configure MailHog

  1. Download and make it executable
wget https://github.com/mailhog/MailHog/releases/download/v1.0.0/MailHog_linux_amd64
sudo cp MailHog_linux_amd64 /usr/local/bin/mailhog
sudo chmod +x /usr/local/bin/mailhog
  1. Make MailHog as a service
@schmengler
schmengler / add-checkout-form-key.sh
Last active September 2, 2022 16:23
Magento SUPEE-9767 Checkout Form Key Theme Patch
find -L app/design/frontend -regex '.*\(shipping\|billing\|shipping_method\|payment\).phtml' -exec grep -L formkey {} \; \
| xargs sed -i 's/<\/form>/<?php echo $this->getBlockHtml("formkey") ?><\/form>/g'
find -L skin/frontend -name 'opcheckout.js' -exec grep -L form_key {} \; \
| xargs sed -i 's/if (elements\[i\].name=='\''payment\[method\]'\'') {/if (elements[i].name=='\''payment[method]'\'' || elements[i].name == '\''form_key'\'') {/g'
@pgilad
pgilad / create-temp-dir.yml
Created October 27, 2015 15:08
Create a temp dir cross-platform in ansible
- name: create a local temp directory
local_action:
module: command mktemp -d "{{ lookup('env', 'TMPDIR') | default('/tmp/') }}ansible.XXXX"
register: mktemp_output
@tegansnyder
tegansnyder / debugging reindex locks mysql commands.md
Created December 2, 2014 23:57
Useful Mysql Commands for Debugging Magento Reindex Locks

Sometimes you may have a run away reindex process that aborted due to a MySQL connection error of some sorts. It may be useful to use the following MySQL commands to aid in debugging.

Determining if a lock exists

Magento Enterprise labels the reindex lock via the constant REINDEX_FULL_LOCK in app/code/core/Enterprise/Index/Model/Observer.php

SELECT IS_FREE_LOCK('mydatabase_name.reindex_full')

Returns 1 is specified lock is free and can be acquired, 0 if it’s in use, NULL if an error occurs.

Determing the thread that is holding the lock

@tegansnyder
tegansnyder / Magento-Indexing-Locks.md
Last active October 18, 2017 15:02
Magento EE Indexer Locks

Here is how we can see if we have MySQL locks due to indexing:

Display locks:
SELECT IS_USED_LOCK('db_name_here.reindex_full');
Releasing locks:
SELECT RELEASE_LOCK('db_name_here.reindex_full');
@wojtha
wojtha / CaseConverter.php
Last active September 4, 2020 08:51
CaseConverter an static class for conversions betweenn camelCase <--> StudlyCase <--> snake_case.
<?php
/**
* Class CaseConverter
*
* Library for camelCase/StudlyCase/snake_case conversions.
*/
class CaseConverter {
/**
@mklooss
mklooss / nginx.conf
Last active August 2, 2019 12:05
nginx magento configuration for API Calls
location /api {
rewrite ^/api/rest /api.php?type=rest last;
rewrite ^/api/v2_soap /api.php?type=v2_soap last;
rewrite ^/api/soap /api.php?type=soap last;
}
Commit = Struct.new(:repo, :sha, :comment, :stats) do
def refactoring?(previous_commit)
return :spec_files_unchanged if no_changes_to_specs
return :comment if refactoring_comment
return false if result.nil? || result.failed > 0 || result.total == 0
return :spec_results_unchanged if result == previous_commit.result
return false
end
def no_changes_to_specs