Skip to content

Instantly share code, notes, and snippets.

View tic984's full-sized avatar

Sinisa Valentic tic984

View GitHub Profile
<?php
declare(strict_types=1);
namespace App\Adapter\Symfony\Command;
use Sulu\Bundle\PageBundle\Document\HomeDocument;
use Sulu\Bundle\PageBundle\Document\PageDocument;
use Sulu\Component\Content\Types\ResourceLocator\Strategy\ResourceLocatorStrategyPoolInterface;
use Sulu\Component\DocumentManager\DocumentManagerInterface;
@tic984
tic984 / Blocks.md
Created December 18, 2020 22:01 — forked from bdlangton/Blocks.md
Drupal 8 programmatic solutions

Render custom blocks

$bid = 'myblock';
$block = \Drupal\block_content\Entity\BlockContent::load($bid);
$render = \Drupal::entityTypeManager()->getViewBuilder('block_content')->view($block);

Render plugin blocks

$block_manager = \Drupal::service('plugin.manager.block');
@tic984
tic984 / README.md
Created January 12, 2017 22:29 — forked from StefanWallin/README.md
nginx ssl config with multiple SNI vhosts and A+ SSL Labs score as of 2014-11-05

Configuring nginx for SSL SNI vhosts

Gotchas

Remarks

  • My version of konklones SSL config does not have SPDY support(my nginx+openssl does not support it)
  • You need a default ssl server (example.org-default.conf).
  • Some SSL-options have to be unique across your instance, so it's easier to have them in a common file(ssl.conf).
@tic984
tic984 / date.sql
Created October 25, 2015 11:36 — forked from johngrimes/date.sql
MySQL Date Dimension Build Script
/* Adapted from Tom Cunningham's 'Data Warehousing with MySql' (www.meansandends.com/mysql-data-warehouse) */
###### small-numbers table
DROP TABLE IF EXISTS numbers_small;
CREATE TABLE numbers_small (number INT);
INSERT INTO numbers_small VALUES (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
###### main numbers table
DROP TABLE IF EXISTS numbers;
CREATE TABLE numbers (number BIGINT);
@tic984
tic984 / nginx.conf
Last active August 29, 2015 14:15 — forked from plentz/nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048