Skip to content

Instantly share code, notes, and snippets.

View dmitryd's full-sized avatar

Dmitry Dulepov dmitryd

View GitHub Profile
@dmitryd
dmitryd / Dockerfile
Created June 27, 2017 07:41
Dockerfile for mkpasswd. This fixes a problem when no suitable mkpasswd is available on OS X that can do sha-512 method.
#
# In ~/.profile: alias "mkpasswd=docker run -i -t mkpasswd"
#
FROM debian:stretch
RUN apt-get update && apt-get install -y --no-install-recommends --no-install-suggests whois
CMD ["/usr/bin/mkpasswd", "-m", "sha-512"]
@dmitryd
dmitryd / .phpstorm.meta.php
Last active April 19, 2017 08:00
Let PhpStorm recognise types of objects created by GeneralUtility::makeInstance(), ObjectManager::get(), etc
<?php
/*
* This file configures factory methods in TYPO3 CMS.
* The file should be dropped to project root. You may need
* to restart PhpStorm.
*
* PhpStorm will now correctly recognise types of objects
* returned by TYPO3 methods listed below.
*
* (c) 2017 Dmitry Dulepov <dmitry.dulepov@gmail.com>
@dmitryd
dmitryd / FormConverterService.php
Last active July 12, 2016 15:36
Fix Powermail convertor for records with sys_language_uid>0 and l18n_parent=0
<?php
namespace DmitryDulepov\PowermailConversionFix\Xclass;
/***************************************************************
* Copyright notice
*
* (c) 2016 Dmity Dulepov <dmitry.dulepov@gmail.com>
* All rights reserved
*
* This script is part of the TYPO3 project. The TYPO3 project is
* free software; you can redistribute it and/or modify
@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 / 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 / renderImage.ts
Last active October 14, 2015 11:52
Render image reference from page properties with TypoScript (TYPO3 CMS)
ogimageNoSlide = FILES
ogimageNoSlide {
references {
table = pages
uid.data = page:uid
fieldName = ogimage
}
maxItems = 1
renderObj = TEXT
renderObj {
@dmitryd
dmitryd / set_enviroment_variable_per_dir_in_bash.sh
Last active October 12, 2015 16:31
This little shell function allows to set environment variables when you cd into that directory.
# Note: this is just a fragment that you should put in your ~/.bash_profile
# Tested on Mac only!
#
# If you want a more sophisticated and feature rich solution here are some pointers:
# - https://github.com/cxreg/smartcd
# - http://swapoff.org/ondir.html
function cd_ {
if [ -e .env_off ] ; then
. .env_off
@dmitryd
dmitryd / Classes_Xclass_DocumentFactory.php
Last active October 9, 2015 12:20
Indexing file content in TYPO3 6.2 with Solr
<?php
namespace My\solrfileindexing\Xclass;
use TYPO3\CMS\Core\Utility\GeneralUtility;
/**
* Requires cc_text* extensions!
*/
class DocumentFactory extends \TYPO3\Solr\Solrfal\Indexing\DocumentFactory {
@dmitryd
dmitryd / lj-selfie.html
Created September 18, 2015 08:55
LJ: Show a userpic of the current viewer to him in the comment
<lj-userpic remote="remote" />
@dmitryd
dmitryd / setup.ts
Created September 7, 2015 08:43
TYPO3: typolink that handles classes in the link field as well as having a custom class in the TypoScript
10 = LOAD_REGISTER
moreUrl {
field = linkUrl
listNum = 0
listNum.splitChar = 32
}
extraClasses {
field = linkUrl
listNum = 2