Skip to content

Instantly share code, notes, and snippets.

View briezler's full-sized avatar

Benjamin Riezler briezler

  • Pixel Ink GmbH
  • Munich
View GitHub Profile
@briezler
briezler / iterm2-solarized.md
Created November 17, 2017 12:01 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + Oh My Zsh + Solarized color scheme + Meslo powerline font + [Powerlevel9k] - (macOS)

Default

Default

Powerlevel9k

Powerlevel9k

@briezler
briezler / fal_metadata_update
Created July 19, 2017 11:57
TYPO3 fal Metadaten updaten
$objectManager = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Extbase\Object\ObjectManager');
$metadata = $objectManager->get('TYPO3\CMS\Core\Resource\Index\MetaDataRepository');
$metadata->update($fileUid, $metadataInput[mustBeAnArray]);
@briezler
briezler / fileInfo
Created June 29, 2017 16:15
File Informationen via typoscript
# get file information with FILES Object
lib.dbTest = FILES
lib.dbTest {
files = 12345
renderObj = TEXT
renderObj {
stdWrap.data = file:current:size
stdWrap.wrap = <p>File size: <strong>|</strong></p>
@briezler
briezler / html_without_p_tag
Created June 22, 2017 10:42
Parse HTML via f:format viewhelper without wrapping <p> tag
<!-- just add parseFuncTSPath with no value -->
<f:format.html parseFuncTSPath="">{cell}</f:format.html>
@briezler
briezler / tt_contentInFluid
Created June 7, 2017 13:52
In fluid auf tt_content zugreifen
$content = $this->configurationManager->getContentObject()->data;
$this->view->assignMultiple(array(
'content' => $content
));
@briezler
briezler / removeStrictMode.sh
Created April 18, 2017 21:02
Disable MySQL strict Mode Ubuntu 16.04
# 1. Edit mysql config
sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf
# Add to [mysql] section
sql-mode="ERROR_FOR_DIVISION_BY_ZERO,NO_ZERO_DATE,NO_ZERO_IN_DATE,NO_AUTO_CREATE_USER"
# Restart mysql
sudo systemctl restart mysql
# yiehaaa
@briezler
briezler / ip_bypass_htaccess_protection.htaccess
Created March 16, 2017 10:02
Add IP bypass to htaccess protected page
AuthType Basic
AuthName "Display Name"
AuthUserFile /path/to/password/file/.htpasswd
Require valid-user
Order allow,deny
Allow from xx.xx.xx.xx
satisfy any
@briezler
briezler / rsync_remote_dir.sh
Created March 14, 2017 18:11
rsycn remote Server via ssh
rsync -avzbe ssh user@example.com:/remote/directory/path /local/directory/path
@briezler
briezler / Nginx Config Kirby
Last active June 30, 2017 15:59
Nginx Config Kirby
# Don't hint these as folders
rewrite ^/(content|site|kirby)$ /error last;
# block content
rewrite ^/content/(.*).(txt|md|mdown)$ /error last;
# block all files in the site and kirby folder from being accessed directly
rewrite ^/(site|kirby)/(.*)$ /error last;
# removes trailing slashes (prevents SEO duplicate content issues)
@briezler
briezler / gaOptOut
Last active March 9, 2017 19:14
GoogleAnalytics Opt Out script
USAGE:
<a onclick="alert('Google Analytics wurde deaktiviert');" href="javascript:gaOptout()">Google Analytics deaktivieren</a>
The Script needs to be included in all pages.
<script type="text/javascript">
// Set to the same value as the web property used on the site
var gaProperty = 'UA-{GA_ID}-x';
// Disable tracking if the opt-out cookie exists.