Skip to content

Instantly share code, notes, and snippets.

@uovidiu
uovidiu / .htaccess
Created May 13, 2019 16:06
Canonical https/www
# Canonical https/www
<IfModule mod_rewrite.c>
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} ^(.*)$ [NC]
RewriteRule (.*) https://www.%1/$1 [R=301,L]
</IfModule>
@uovidiu
uovidiu / gist:0e26bcf5f7f73bff67d530c6d2582258
Created January 20, 2017 11:23
Excel concat if not empty
Function MyConcat(ConcatArea As Range) As String
For Each x In ConcatArea: xx = IIf(x = "", xx & "", xx & x & "|"): Next
MyConcat = Left(xx, Len(xx) - 1)
End Function
// ALT +F11
@uovidiu
uovidiu / gist:6f5795a38dd6ba14898a
Last active February 10, 2016 10:54
Magento permissions
find . -type f \-exec chmod 644 {} \;
find . -type d \-exec chmod 711 {} \;
find media/ -type d \-exec chmod 755 {} \;
find var/ -type d \-exec chmod 755 {} \;
find media -type f \-exec chmod 664 {} \;
find var -type f \-exec chmod 664 {} \;
from: https://blog.nexcess.net/2010/12/06/securing-magento-file-directory-permissions/
@uovidiu
uovidiu / 0: Magento 1.12 Enterprise multi-store cluster configuration.md
Created November 13, 2015 11:15 — forked from parhamr/0: Magento 1.12 Enterprise multi-store cluster configuration.md
A highly available, fault tolerant, distributed, and load balanced LEMP cluster.
@uovidiu
uovidiu / gist:20eb8fc5a736d0a8e339
Created January 6, 2015 10:51
remove duplicate values from a multi-dimensional array in PHP
$input = array_map("unserialize", array_unique(array_map("serialize", $input)));
@uovidiu
uovidiu / config.json
Last active August 29, 2015 14:09 — forked from anonymous/config.json
thecspace formbuilder bootstrap
{
"vars": {
"@gray-base": "#000",
"@gray-darker": "lighten(@gray-base, 13.5%)",
"@gray-dark": "lighten(@gray-base, 20%)",
"@gray": "lighten(@gray-base, 33.5%)",
"@gray-light": "lighten(@gray-base, 46.7%)",
"@gray-lighter": "lighten(@gray-base, 93.5%)",
"@brand-primary": "darken(#428bca, 6.5%)",
"@brand-success": "#5cb85c",
<?php namespace LarryWeya\FormbuilderToJSONSchema\FormbuilderToJSONSchema;
class FormbuilderParser {
/**
* @var array the formbuilder schema we are working with
*/
protected $schema;
/**
/*
* jQuery Nivo Slider v2.6
* http://nivo.dev7studios.com
*
* Copyright 2011, Gilbert Pellegrom
* Free to use and abuse under the MIT license.
* http://www.opensource.org/licenses/mit-license.php
*
*
* 100% width + background color cycle + transparent image by Tony H. Meyer
<!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/libs/jquery-1.7.1.min.js"><\/script>')</script>
@uovidiu
uovidiu / mysql - find and remove duplicates
Created August 19, 2013 14:33
mysql search duplicates mysql remove duplicates
// search duplicates
SELECT field, field_1, count(*)
FROM table
GROUP BY field, field_1 HAVING count(*) > 1;
//remove duplicates
ALTER IGNORE TABLE `sometable` ADD UNIQUE INDEX(field,field_1);