Skip to content

Instantly share code, notes, and snippets.

View cliffparnitzky's full-sized avatar

Cliff Parnitzky cliffparnitzky

View GitHub Profile
@cliffparnitzky
cliffparnitzky / Firefox bookmark for Contao CERIS quick search.js
Created August 15, 2012 10:29
Firefox bookmark with input dialog: Create a new bookmark in firefox and add on this snippet as address. When clicked a dialog for a custom input will open.
javascript:void(location.href="http://www.contao-pool.de/ceris.html?search="+window.prompt("CERIS search:",""))
@cliffparnitzky
cliffparnitzky / create php log
Last active October 8, 2015 16:37
Adds simple logging functionality to php file.
function log_message($strMessage, $strLog='error.log')
{
@error_log(sprintf("[%s] %s\n", date('d-M-Y H:i:s'), $strMessage), 3, ROOT_PATH . '/logs/' . $strLog);
}
@cliffparnitzky
cliffparnitzky / Contao email inserttag with title
Last active October 11, 2015 06:38
Add an title to email links, encoded with special inserttag (for Contao V. 2.11 and higher)
{{email_open::info@domain.de" title="Schick uns eine E-Mail}}Info E-Mail{{link_close}}
@cliffparnitzky
cliffparnitzky / create_github_tag.sh
Last active December 18, 2020 22:10
Simple way to create a tag via git shell and push it to repo
# creat a tag (more infos at: http://git-scm.com/book/de/ch2-12.html)
git tag -a 1.0.0 -m "Version 1.0.0"
git push origin 1.0.0
git tag -a 1.0.0.alpha1 -m "Version 1.0.0 alpha1"
git push origin 1.0.0.alpha1
# delete a tag
git tag -d 1.0.0
git push origin :refs/tags/1.0.0
@cliffparnitzky
cliffparnitzky / jQuery_scrollTo.js
Last active December 14, 2015 16:39
Automatically scroll to a defined element after loading a page.
<script type="text/javascript">
$(document).ready(function() {
var targetOffset = $('#main').offset().top;
$('html,body').delay(1000).animate({scrollTop: targetOffset}, 1000);
});
</script>
@cliffparnitzky
cliffparnitzky / with nickserver authorization
Last active December 13, 2017 20:40
Firefox scriplet for autofilling freenode webchat login form
javascript:
document.getElementsByTagName('input')[0].value='NICKNAME';
document.getElementsByTagName('input')[1].value='CHANNEL_A,#CHANNEL_B';
document.getElementsByTagName('input')[2].checked=true;
document.getElementsByTagName('input')[3].value='USERNAME';
document.getElementsByTagName('tr')[6].style.display='';
document.getElementsByTagName('input')[4].value='PASSWORD';
document.getElementsByTagName('tr')[7].style.display='';
var captcha = document.getElementsByTagName('input')[6];
captcha.focus();
@cliffparnitzky
cliffparnitzky / git-update-fork.bat
Last active August 22, 2017 20:09
update github fork
@echo off
set /p BRANCH="Branch name: "
git fetch upstream
git checkout %BRANCH%
git reset --hard upstream/%BRANCH%
@cliffparnitzky
cliffparnitzky / Bookmark scriplets to the contao manuals
Last active August 29, 2015 14:07
Scriplets for bookmarks to the contao manuals and differnet chapters
- Add these scriptlets as bookmarks to your browser
- Open it, enter the contao version (major.minor) and checkout the manual
Customization
-------------
- change 'de' to 'en' for the englisch manual
- for preselecting a version change the content of window.prompt(...) to "Contao Version (z.B. 3.2):","3.3"
@cliffparnitzky
cliffparnitzky / composer_commands.sh
Last active May 21, 2019 19:43
Composer command line snippets
# Show a list of the latest version for all outdated packages
php composer.phar show -o
php composer.phar outdated
# Update packages (Stato)
/usr/bin/php71 -d memory_limit=-1 composer.phar update
/usr/bin/php71 -d memory_limit=-1 composer.phar update --dry-run
# Update packages (1&1)
/usr/bin/php7.1-cli -d memory_limit=-1 composer.phar update