Skip to content

Instantly share code, notes, and snippets.

View dmitryd's full-sized avatar

Dmitry Dulepov dmitryd

View GitHub Profile
@dmitryd
dmitryd / 2-columns-ts-only
Created July 1, 2013 08:29
Two column layout using TypoScript-only, no tables.
# Fetch&render fe_users (just as an example)
temp.userList = RECORDS
temp.userList {
source.field = users
tables = fe_users
conf.fe_users = COA
conf.fe_users {
10 = ...
wrap = <li>|</li>
@dmitryd
dmitryd / checkboxes.txt
Created July 10, 2013 08:16
This example shows how to use the 'split' TypoScript function to create a set of checkboxes easily. There are three files total: general code, stdWrap helper and usage example.
temp.checkbox_with_split = COA
temp.checkbox_with_split {
# Define data
10 = LOAD_REGISTER
10 {
# Valid bits in the field
bits = 1,2,3,4,5,6,7
# Field name in the database. Don't move below other registers!
@dmitryd
dmitryd / Typo3DbQueryParser.php
Last active September 7, 2017 07:35
Fix issue with incorrect localization handling in Extbase (missing support for l10n_mode=exclude, which makes some relations missing). See http://bit.ly/1Djw1CV
<?php
namespace DmitryDulepov\Sample\Xclass;
class Typo3DbQueryParser extends \TYPO3\CMS\Extbase\Persistence\Generic\Storage\Typo3DbQueryParser {
/**
* Fixes incorrect localisation handling in Extbase.
*
* @param string $tableName
* @param array $sql
@dmitryd
dmitryd / solrFacetLinkToReset.js
Created April 24, 2015 11:34
TYPO3 Solr: modify selected facet link to serve as a reset link using jQuery
(function($) {
$(document).ready(function() {
/**
* Turns the currently active facet link to "reset facet" link by removing the filter segment.
*/
function modifyFacetLinkToReset() {
if (document.location.search.indexOf('tx_solr%5Bfilter%5D') > 0) {
$('.tx-solr-collapsible-facets a').each(function() {
@dmitryd
dmitryd / solrIndexingOfExtNews.txt
Created April 24, 2015 11:37
TYPO3 Solr: indexing configuration for EXT:news
plugin.tx_solr {
index {
queue {
tx_news_domain_model_news = 1
tx_news_domain_model_news {
tableName = tx_news_domain_model_news
additionalWhereClause = tx_news_domain_model_news.type=0
fields {
title = title
@dmitryd
dmitryd / solrIndexSelfSigned.diff
Created April 24, 2015 11:44
TYPO3 Solr: index sites with a self-signed certificate
diff --git a/www/typo3conf/ext/solr/Classes/IndexQueue/PageIndexerRequest.php b/www/typo3conf/ext/solr/Classes/IndexQueue/PageIndexerRequest.php
index b34aee4..ca3247f 100644
--- a/www/typo3conf/ext/solr/Classes/IndexQueue/PageIndexerRequest.php
+++ b/www/typo3conf/ext/solr/Classes/IndexQueue/PageIndexerRequest.php
@@ -138,7 +138,11 @@ class Tx_Solr_IndexQueue_PageIndexerRequest {
'http' => array(
'header' => implode(CRLF, $headers),
'timeout' => $this->timeout
- )
+ ),
@dmitryd
dmitryd / Classes_Controller_MyController.php
Last active August 30, 2017 15:15
TYPO3 Extbase and "Insert records"
<?php
namespace DmitryDulepov\Myext\Controller;
class MyController {
/**
* @var \DmitryDulepov\Myext\\Domain\Repository\RecordRepository
* @inject
*/
protected $recordRepository;
@dmitryd
dmitryd / lj-template
Created May 17, 2015 18:16
How to embed video to LiveJournal
To embed a video using the `<lj-template>` tag, use the following code:
YouTube:
```html
<lj-template name="video">http://www.youtube.com/watch?v=example</lj-template>
```
Photobucket:
```html
<lj-template name="video">http://xxx.photobucket.com/albums/xxx/example/?action=view¤t=example.flv
</lj-template>
@dmitryd
dmitryd / Library_LaunchDaemons_local.automasq.plist
Created May 22, 2015 09:33
Use DHCP nameservers for dnsmasq in OS X. Update automatically when they change.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>KeepAlive</key>
<true/>
<key>Label</key>
<string>local.automasq</string>
<key>ProgramArguments</key>
<array>
@dmitryd
dmitryd / fix-phpstorm-network.sh
Created May 28, 2015 07:16
(Mac) Fix PhpStorm prompt for accepting incoming connections
#!/bin/bash
#
# @see https://youtrack.jetbrains.com/issue/IDEA-129941
#
# Make sure you have Wi-Fi on and automatic time zone on on your Mac!
sudo codesign --force --deep --sign - /Applications/PhpStorm.app/