Skip to content

Instantly share code, notes, and snippets.

View wouterj's full-sized avatar

Wouter de Jong wouterj

View GitHub Profile
@wouterj
wouterj / ParameterBag.php
Last active December 12, 2015 05:48
A Simple ParameterBag
<?php
class ParameterBag implements \IteratorAggregate, \Countable
{
/**
* @var array
*/
private $parameters;
private $froozen = false;
@wouterj
wouterj / ParameterAccessor.php
Created February 8, 2013 16:44
ParameterAccessor
<?php
use Symfony\Component\PropertyAccess\PropertyAccessorInterface;
class ParameterAccessor
{
private $parameters;
/**
* @var PropertyAccessorInterface
service class
annotation_reader Doctrine\Common\Annotations\FileCacheReader
assetic.asset_manager Assetic\Factory\LazyAssetManager
assetic.controller Symfony\Bundle\AsseticBundle\Controller\AsseticController
assetic.filter.cssrewrite Assetic\Filter\CssRewriteFilter
assetic.filter_manager Symfony\Bundle\AsseticBundle\FilterManager
assetic.request_listener Symfony\Bundle\AsseticBundle\EventListener\RequestListener
cache_clearer Symfony\Component\HttpKernel\CacheClearer\ChainCacheClearer
cache_warmer Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerAggregate
@wouterj
wouterj / post.md
Last active July 13, 2021 02:00
How to use Jekyll, Plugins and Sass on GitHub Pages

How to use Jekyll, Plugins and Sass on GitHub Pages

Jekyll is a great CMS for developers and GitHub Pages is a great host to store your Jekyll sites. There is just one problem, GitHub runs Jekyll in safe mode, which means you can't use plugins. One thing you can do is building the Jekyll website locally and then push to GitHub.

Alexandre Rademaker found a solution to do this easially, which is quite usefull: "GitHub Pages and Jekyll plugins" After reading this I thought, that can be done easier!

Aliases to rescue

Git provides a way to have aliases of bash commands. You can do this by adding items to the alias key of your configuration. For this, you can add this locally by adding this lines to your %PROJECT_ROOT%/.git/config file:

@wouterj
wouterj / legend.md
Last active December 15, 2015 10:38
Symfony2 form type tree

Legend

  • foo < bar means foo is a child of bar
  • - cat means an option cat
  • o baz means an overriden option baz
@wouterj
wouterj / Authentication.php
Created March 27, 2013 13:11
Simple User Management example
<?php
class Authentication
{
/**
* @var UserProviderInterface
*/
private $userprovider;
/**
Read more in :ref:`hello-world`.
// result:
Read more in <a href="other-file.html#hello-world">My World</a>.
.. tip:
some tip text and...a list!
- Foobar with some very long text. Imagine this hits the 78 characters
and it will continue like this
- Lorem
- Symfony2
<ul>
{% for item in items %}
<li>{{ item }}</li>
{% endfor %}
</ul>
RESULT
<ul>
<li>...</li>