Skip to content

Instantly share code, notes, and snippets.

View hans2103's full-sized avatar
🏠
Working from home

Hans Kuijpers hans2103

🏠
Working from home
View GitHub Profile
@hans2103
hans2103 / .gitconfig
Last active December 30, 2015 18:49
my .gitconfig
[color]
status = auto
diff = auto
branch = auto
interactive = auto
ui = true
[alias]
amend = !"git commit --amend -C HEAD"
st = status
ci = commit
@hans2103
hans2103 / price.phtml M1.9
Last active October 23, 2018 17:47
Implementation of structured data itemprop=price on app/design/frontend/<your_package>/<your_theme>/template/catalog/product/price.phtml - Magento 1.9.0.x - http://schema.org/Offer - more information: http://www.byte.nl/blog/magento-rich-snippets-made-easy/
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
@hans2103
hans2103 / bundle-price.phtml M1.9
Last active October 23, 2018 17:46
Implementation of structured data itemprop=price on app/design/frontend/<your_package>/<your_theme>/template/bundle/catalog/product/price.phtml - Magento 1.9.0.x - http://schema.org/Offer - more information: http://www.byte.nl/blog/magento-rich-snippets-made-easy/
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
@hans2103
hans2103 / statements.sql
Created January 29, 2015 13:29
SQL Tips & Tricks
SELECT *
FROM asdfg_posts
WHERE post_content LIKE '%href="wiki%';
SELECT *
FROM asdfg_posts
WHERE post_content LIKE '%href="/wiki%';
UPDATE asdfg_posts
SET post_content = replace(post_content, 'href="wiki', 'href="/wiki')
@hans2103
hans2103 / nginx.conf
Created January 30, 2015 13:23
nginx block
# Block semalt.com
if ($http_referer ~* "semalt\.com") {
return 444;
}
@hans2103
hans2103 / .htaccess
Created January 30, 2015 13:30
block semalt.com and other bad guys in .htaccess
SetEnvIfNoCase Referer buttons-for-website.com spammer=yes
SetEnvIfNoCase Referer semalt.com spammer=yes
Order allow,deny
Allow from all
Deny from env=spammer
@hans2103
hans2103 / snippet-bs3-carousel.html
Last active December 12, 2016 10:32
Bootstrap 3 Carousel with Modal popup for NoNumber Snippets in combination with User Agent Detector, NoNumber Sourcerer and NoNumber Articles Anywhere. use: {snippet carousel|category-alias}
@hans2103
hans2103 / .htaccess
Last active August 29, 2015 14:14
sitemap.xml redirect to Joomla! XMAP sitemap
Options +FollowSymLinks
RewriteEngine On
RewriteRule ^sitemap.xml$ index.php?option=com_xmap&view=xml&tmpl=component&id=1 [L]
@hans2103
hans2103 / .htaccess-block-unwanted-crawlers
Created April 13, 2015 08:31
Block unwanted sites from crawling your site
SetEnvIfNoCase Referer buttons-for-website.com spammer=yes
SetEnvIfNoCase Referer semalt.com spammer=yes
Order allow,deny
Allow from all
Deny from env=spammer
@hans2103
hans2103 / .htaccess-mod_headers
Created April 13, 2015 08:33
.htaccess rules to set cache control.
<IfModule mod_headers.c>
Header set Connection keep-alive
# Cache-control headers
# 2 HOURS
#<filesMatch "*">
Header set Cache-Control "max-age=7200, must-revalidate"
#</filesMatch>
# 480 weeks - 290304000