Skip to content

Instantly share code, notes, and snippets.

View alexander-schranz's full-sized avatar

Alexander Schranz alexander-schranz

View GitHub Profile
@alexander-schranz
alexander-schranz / SassMeister-input.scss
Created February 17, 2016 21:44
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
$black: #000000;
$white: #ffffff;
$blue: #032459;
$grey: #cfcfcf;
$darkGrey: #9B9B9B;
@alexander-schranz
alexander-schranz / SassMeister-input-HTML.html
Created February 18, 2016 08:10
Generated by SassMeister.com.
<button>
Button
</button>
<button class="blue">
Button Blue
</button>
<button class="white background-blue">
Button
@alexander-schranz
alexander-schranz / sulu-windows-xampp-install.md
Last active April 22, 2016 11:01
Install Sulu on Windows with Xampp
@alexander-schranz
alexander-schranz / twig-pagination.html.twig
Last active September 18, 2016 13:21
A twig include for rendering a pagination
{#- A twig html pagination with correct handling of many pages.
#
# arrows bool
# page int
# maxPage int
# limit int
-#}
{% if maxPage > 1 %}
<div class="pagination">
@alexander-schranz
alexander-schranz / JsFragmentRenderer.php
Created November 8, 2016 08:51
JsFragmentRenderer to load a fragment over ajax instead of esi
<?php
namespace AppBundle\Fragment;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Controller\ControllerReference;
use Symfony\Component\HttpKernel\Fragment\RoutableFragmentRenderer;
use Symfony\Component\HttpKernel\UriSigner;
@alexander-schranz
alexander-schranz / SuluMediaImport.php
Last active November 28, 2016 08:12
SuluMediaImport.php
<?php
$uploadedFile = new UploadedFile(
$filePath, $name, $mimeType, $size
);
$media = $this->getContainer()->get('sulu_media.media_manager')->save(
$uploadedFile,
[
'locale' => $locale,
@alexander-schranz
alexander-schranz / CacheController.php
Last active December 23, 2016 16:23
Cross CacheController.php
<?php
namespace AppBundle\Controller;
use Guzzle\Http\Client;
use Sulu\Bundle\WebsiteBundle\Controller\CacheController as SuluCacheController;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
@alexander-schranz
alexander-schranz / basic.html
Last active April 20, 2017 08:14
Basic.html
<!doctype html>
<html lang="de">
<head>
<link rel="stylesheet" href="your.css" />
</head>
<body>
<h1>H1 <br/>Headline</h1>
<p>
Normal Text<br/>
@alexander-schranz
alexander-schranz / test-case.patch
Created September 27, 2017 09:43
Sulu Sample Test Case Setup
diff --git a/tests/Functional/AbstractAppTestCase.php b/tests/Functional/AbstractAppTestCase.php
new file mode 100644
index 0000000..a45faab
--- /dev/null
+++ b/tests/Functional/AbstractAppTestCase.php
@@ -0,0 +1,117 @@
+<?php
+
+namespace Tests\Functional;
+
@alexander-schranz
alexander-schranz / main.js
Last active April 12, 2018 13:36
Load custom css in sulu
// src/AppBundle/Resources/public/js/main.js
require.config({
paths: {
app: '../../app/js',
appcss: '../../app/css'
}
});
define(['css!appcss/main'], function() {