Skip to content

Instantly share code, notes, and snippets.

View Maksold's full-sized avatar

Maksim Soldatjonok Maksold

  • Latvia
View GitHub Profile
@vxnick
vxnick / gist:380904
Created April 27, 2010 15:52
Array of country codes (ISO 3166-1 alpha-2) and corresponding names
<?php
$countries = array
(
'AF' => 'Afghanistan',
'AX' => 'Aland Islands',
'AL' => 'Albania',
'DZ' => 'Algeria',
'AS' => 'American Samoa',
'AD' => 'Andorra',
@s0what
s0what / nginx.logrotate.conf
Created March 6, 2012 11:55
logrotate for nginx
/var/log/nginx/*.log{
daily
missingok
rotate 7
compress
dateext
delaycompress
notifempty
sharedscripts
postrotate
@iwek
iwek / find-in-json.js
Created October 20, 2012 21:43
Searching through JSON
//return an array of objects according to key, value, or key and value matching
function getObjects(obj, key, val) {
var objects = [];
for (var i in obj) {
if (!obj.hasOwnProperty(i)) continue;
if (typeof obj[i] == 'object') {
objects = objects.concat(getObjects(obj[i], key, val));
} else
//if key matches and value matches or if key matches and value is not passed (eliminating the case where key matches but passed value does not)
if (i == key && obj[i] == val || i == key && val == '') { //
@Maksold
Maksold / data-install-0.0.1.php
Last active October 25, 2018 12:51
#magento - Create Transactional Email in #migration script
<?php
/** @var $installer Scandi_Migrations_Model_Resource_Setup */
$installer = $this;
$installer->startSetup();
$templates = array(
array(
"name" => "New Invoice",
"code" => "sales_email_invoice_template",
"config" => "sales_email/invoice/template",
@parhamr
parhamr / 0: Magento 1.12 Enterprise multi-store cluster configuration.md
Last active October 13, 2023 14:20
A highly available, fault tolerant, distributed, and load balanced LEMP cluster.
@JamesMGreene
JamesMGreene / gitflow-breakdown.md
Last active May 23, 2024 12:17
`git flow` vs. `git`: A comparison of using `git flow` commands versus raw `git` commands.

Initialize

gitflow git
git flow init git init
  git commit --allow-empty -m "Initial commit"
  git checkout -b develop master

Connect to the remote repository

@dzungtran
dzungtran / list.md
Created March 24, 2015 03:30
List of tables to safely truncate in Magento

Before you do anything

  • Make sure you test clearing this data in a non-production environment first.
  • Always make backups before you lose data forever.
  • Make sure you're truncateing, not droping.
  • Probably a good idea to reindex everything via shell after mass deleting records

To expand on Jim's answer, Magento Support doesn't need the contents of these tables when they ask for a copy of your DB, so you could consider them non-essential.

@skowron-line
skowron-line / monolog.json
Last active December 30, 2023 18:58
lnav Monolog format
{
"monolog": {
"title": "Monolog log file",
"description": "Monolog log format",
"url": "https://github.com/Seldaek/monolog",
"regex": {
"default": {
"pattern": "\\[(?P<timestamp>.*)\\] (?P<logger>\\w+).(?P<level>\\w+): (?P<message>[^\\[\\{]+) (?P<context>[\\[\\{].*[\\]\\}]) (?P<extra>[\\[\\{].*[\\]\\}])"
}
},
charset_table = \
U+00C0->a, U+00C1->a, U+00C2->a, U+00C3->a, U+00C4->a, U+00C5->a, U+00E0->a, U+00E1->a, \
U+00E2->a, U+00E3->a, U+00E4->a, U+00E5->a, U+0100->a, U+0101->a, U+0102->a, U+0103->a, \
U+010300->a, U+0104->a, U+0105->a, U+01CD->a, U+01CE->a, U+01DE->a, U+01DF->a, U+01E0->a, \
U+01E1->a, U+01FA->a, U+01FB->a, U+0200->a, U+0201->a, U+0202->a, U+0203->a, U+0226->a, \
U+0227->a, U+023A->a, U+0250->a, U+04D0->a, U+04D1->a, U+1D2C->a, U+1D43->a, U+1D44->a, \
U+1D8F->a, U+1E00->a, U+1E01->a, U+1E9A->a, U+1EA0->a, U+1EA1->a, U+1EA2->a, U+1EA3->a, \
U+1EA4->a, U+1EA5->a, U+1EA6->a, U+1EA7->a, U+1EA8->a, U+1EA9->a, U+1EAA->a, U+1EAB->a, \
U+1EAC->a, U+1EAD->a, U+1EAE->a, U+1EAF->a, U+1EB0->a, U+1EB1->a, U+1EB2->a, U+1EB3->a, \
U+1EB4->a, U+1EB5->a, U+1EB6->a, U+1EB7->a, U+2090->a, U+2C65->a, \
@gwillem
gwillem / magento-nginx.conf
Last active July 29, 2023 10:13
Battle-tested Nginx configuration for Magento (source: www.hypernode.com)
# This is an annotated subset of the Nginx configuration from our Magento production platform @ www.hypernode.com
# See https://www.byte.nl/blog/magento-cacheleak-issue
# !!!! If you are a Hypernode customer, do not use this config as it will result in duplicate statements. !!!!!
user app;
worker_processes 4;
pid /var/run/nginx.pid;
events {