Skip to content

Instantly share code, notes, and snippets.

View armitage's full-sized avatar

Milan Zoufal armitage

View GitHub Profile
@mklooss
mklooss / 1_found_data.txt
Last active April 26, 2016 09:31
insert imprint data as allowed permissions for SUPEE-6788
Find Block in Contents
SELECT * FROM `cms_block` WHERE `content` LIKE '%{{block%';
SELECT * FROM `cms_page` WHERE `content` LIKE '%{{block%';
SELECT * FROM `core_email_template` WHERE `template_text` LIKE '%{{block%';
thanks @http://www.webguys.de/magento/supee-6788-und-block-direktiven-neues-berechtigungskonzept/
Find Config Varibales in Contents
SELECT * FROM `cms_block` WHERE `content` LIKE '%{{config%';
@ialarmedalien
ialarmedalien / RefReMapper
Created October 15, 2014 22:39
Remap a CSV file, given the headers of the target file
$data = array_map('str_getcsv',
['"header1","header2","header3","header4"',
'"data1","data2","data3","data4"',
'"dataA","dataB","dataC","dataD"'] );
//just get the first line of the csv1's values
$csv1 = array_shift($data);
//csv2
$data2 = array_map('str_getcsv', ['"header4","header3","header2","header1"']);
@LeaVerou
LeaVerou / vunits.js
Created November 8, 2011 11:05
Static polyfill for vw, vh, vm units
/**
* Polyfill for the vw, vh, vm units
* Requires StyleFix from -prefix-free http://leaverou.github.com/prefixfree/
* @author Lea Verou
*/
(function() {
if(!window.StyleFix) {
return;
@armitage
armitage / subdomain_rewrite
Created November 8, 2010 18:21
This Apache Config takes the subdomain part of a url if available (except www) and tries to find files in the document root with subdomain appended if the file cannot be found their i tries a second directory, in thies case the top level doc root
RewriteEngine on
RewriteLogLevel 2
RewriteLog /var/www/sites/camino_surf/logs/rewrite.log
RewriteCond %{HTTP_HOST} !www.caminosurf.com$ [NC]
RewriteCond %{HTTP_HOST} ^(www.)?([a-z0-9-]+).caminosurf.com [NC]
# first try to find it in branch dir based on subdomain
# ...and if found stop and be happy:
RewriteCond /var/www/sites/camino_surf/public/%{REQUEST_FILENAME} -f
<html>
<head>
<title>Comments count code example</title>
</head>
<body>
<!-- For this link, we will try to fetch comments count by URL: http://example.com/article.html -->
<a href="http://example.com/article.html#disqus_thread">First article</a>
<!-- For this link, we will try to fetch comments count by identifier: article2identifier -->