Skip to content

Instantly share code, notes, and snippets.

Christian Schiffler discordier

Block or report user

Report or block discordier

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@discordier
discordier / endlessscroll.js
Created Mar 22, 2017
Endless scrolling for MetaModels content elements.
View endlessscroll.js
jQuery(document).ready(function () {
var j= jQuery,
container = '.ce_metamodel_content',
list = '.layout_full',
entry = '.item',
pagination = j('.pagination');
var urls = [],
scrolled = function (elem) {
var
@discordier
discordier / .bashrc
Created Oct 24, 2016
cmd sf: Search for symfony console app in the current dir (2.X or 3.X) and run whichever has been found
View .bashrc
sf() {
if [ -f ./app/console ]; then
./app/console $@
return $?
fi;
if [ -f ./bin/console ]; then
./bin/console $@
return $?
fi;
echo "found neither ./app/console nor ./bin/console";
@discordier
discordier / Find items with `ConditionAnd` rule.
Created Sep 23, 2016
Find MetaModels items using a `ConditionAnd` rule.
View Find items with `ConditionAnd` rule.
$attribute = $metaModel->getAttribute('price');
$filter = $metaModel->getEmptyFilter();
$andRule = new \MetaModels\Filter\Rules\Condition\ConditionAnd();
$andRule
->addRule(new \MetaModels\Filter\Rules\Comparing\GreaterThan($attribute, 10))
->addRule(new \MetaModels\Filter\Rules\Comparing\LessThan($attribute, 20));
$filter->addFilterRule($andRule);
$items = $metaModel->findByFilter($filter);
@discordier
discordier / .travis.yml
Last active Dec 31, 2019
Reference .travis.yml when using phpcq with Contao 3.2 to 3.5.
View .travis.yml
language: php
php:
- "5.3"
- "5.4"
- "5.5"
- "5.6"
- "7.0"
env:
@discordier
discordier / gist:ed4b9cba14652e7212f5
Created Dec 4, 2014
options for phpStorm @noinspection annotation
View gist:ed4b9cba14652e7212f5
javascript
ES6ValidationInspection
JSAccessibilityCheckInspection
JSBitwiseOperatorUsageInspection
JSCheckFunctionSignaturesInspection
JSClosureCompilerSyntaxInspection
JSCommentMatchesSignatureInspection
JSComparisonWithNaNInspection
JSConsecutiveCommasInArrayLiteralInspection
@discordier
discordier / DcGeneralRetrieveASingleModel.
Created Mar 25, 2014
DcGeneral - retrieve a single model.
View DcGeneralRetrieveASingleModel.
<?php
use ContaoCommunityAlliance\DcGeneral\Factory\DcGeneralFactory;
// Create the DcGeneral.
$factory = new DcGeneralFactory();
$dcGeneral = $factory->setContainerName('tl_data')->createDcGeneral();
// Fetch the correct data provider.
$dataProvider = $dcGeneral->getEnvironment()->getDataProvider(/* 'tl_data' is not required here but possible as it is the default */);
View gist:6901223
{
"repositories": [
{
"type": "package",
"package": {
"name": "components/jquery-transit",
"type": "component",
"version": "0.9.9",
"homepage": "https://github.com/rstacruz/jquery.transit",
"require": {
You can’t perform that action at this time.