Skip to content

Instantly share code, notes, and snippets.

View akroii's full-sized avatar
🙃

Andreas Kroll akroii

🙃
  • Proverbs 6,6-8
  • 06:26 (UTC +01:00)
View GitHub Profile
RewriteCond %{HTTP_USER_AGENT} Googlebot [OR]
RewriteCond %{HTTP_USER_AGENT} AdsBot-Google [OR]
RewriteCond %{HTTP_USER_AGENT} msnbot [OR]
RewriteCond %{HTTP_USER_AGENT} AltaVista [OR]
RewriteCond %{HTTP_USER_AGENT} Slurp
RewriteRule . - [F,L]
<?php $out = strlen($this->email) > 27 ? substr($this->email,0,27)."..." : $this->email;?>
@akroii
akroii / gist:8d029089bb924fc70a1f704b5212284f
Created September 16, 2018 12:58
trailing slash policy
#no trailing slash
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ index.php/$1 [L,R=301] # <- for test, for prod use [L,R=301]
#RewriteRule (.*)$ index.php/$1 [L]
#force trailing slash
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*[^/])$ /index.php/$1/ [L,R] # <- for test, for prod use [L,R=301]
@akroii
akroii / better-font-smoothing.css
Created September 24, 2018 12:26 — forked from hsleonis/better-font-smoothing.css
Better font smoothing in cross browser
html {
/* Adjust font size */
font-size: 100%;
-webkit-text-size-adjust: 100%;
/* Font varient */
font-variant-ligatures: none;
-webkit-font-variant-ligatures: none;
/* Smoothing */
text-rendering: optimizeLegibility;
-moz-osx-font-smoothing: grayscale;
@akroii
akroii / bootstrap-3-vert-offset-shim.css
Created September 27, 2018 06:13 — forked from erobert17/bootstrap-3-vert-offset-shim.css
Adds a vertical offset top and bottom to Bootstrap 3 to be used within columns. Currently no vertical offset is available as standard in Bootstrap 3.
/*
Include this after bootstrap.css. Add class of
vert-offset-top-value or vert-offset-bottom-value
to your Bootstrap 3 default rows to prevent row content
from touching the row content above or below.
*/
/* Vertical Offset Bottom */
.vert-offset-top-12{
margin-top: 12em;
@akroii
akroii / gist:76915911cda3b51903f286b2ed326e51
Created May 3, 2019 15:57
Shopware delete article images only
DELETE FROM s_articles_img;
DELETE FROM s_articles_img_attributes;
DELETE FROM s_article_img_mappings;
DELETE FROM s_article_img_mapping_rules;
@akroii
akroii / sql
Created May 23, 2019 12:14
repair foreign keys on shopware articles during import
DELETE ca -- SELECT ca.*
FROM `s_articles_attributes` ca
LEFT JOIN s_articles c
ON c.id = ca.articleID
WHERE c.id IS NULL
DELETE ca -- SELECT ca.*
FROM `s_articles_details` ca
LEFT JOIN s_articles c
ON c.id = ca.articleID
@akroii
akroii / gist:68532a680c8364df08eddc27947b2a8d
Last active October 13, 2021 13:24
Catalog Manager unix timestamp to human readable date
<?php $intTimestamp = \Controller::replaceInsertTags("{{CTLG_MASTER::dates}}");
echo $this->parseDate("d.m.Y", $intTimestamp);?>
or
<?php
echo \Date::parse($strFormat, $intTstamp)
?>
{assign var="breadcrumb" value=$sArticle.articleID|category:","}
{assign var="categories" value=","|explode:$breadcrumb}
<categoryid1>{$categories[0]|escape:"htmlall"}</categoryid1>
<categoryid2>{$categories[1]|escape:"htmlall"}</categoryid2>
<categoryid3>{$categories[2]|escape:"htmlall"}</categoryid3>
@akroii
akroii / php
Last active June 14, 2019 07:48
get post data from form in contao
echo \Controller::replaceInsertTags("{{post::countPeople}}");
echo \Controller::replaceInsertTags("{{post::pakettype}}");
echo \Input::post('countPeople');
echo \Input::post('pakettype');
//see here
https://www.marcosimbuerger.ch/tech-blog/contao-input-klasse-post-get-cookie.html