Skip to content

Instantly share code, notes, and snippets.

View dmitryd's full-sized avatar

Dmitry Dulepov dmitryd

View GitHub Profile
@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
@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 / ipfw.conf
Last active August 29, 2015 14:23
Prevent access to local Apache on OS X with ipfw
add 1000 deny tcp from any to any dst-port 80 recv en0
add 2000 deny tcp from any to any dst-port 80 recv en1
add 3000 deny tcp from any to any dst-port 80 recv en3
# The next one works only if you have tun/tap driver installed for VPN apps. If you do not have it, comment it.
add 4000 deny tcp from any to any dst-port 80 recv tun0
@dmitryd
dmitryd / Library_LaunchDaemons_com.noatime.root.plist
Created June 29, 2015 14:38
"noatime" for OS X on SSD. Place this file to /Library/LaunchDaemons/com.noatime.root.plist and do `sudo launchctl load -w /Library/LaunchDaemons/com.noatime.root.plist`
<?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>Label</key>
<string>com.noatime.root</string>
<key>ProgramArguments</key>
<array>
<string>/sbin/mount</string>
<string>-vuwo</string>
@dmitryd
dmitryd / set-file-url.sh
Last active August 29, 2015 14:23
Change source URL of the file in the OS X metadata from shell
#/bin/bash
if [ ! -e "$2" ] ; then
echo "Format: `basename $0` url file"
echo ""
echo "Sets the source URL of the file."
echo ""
exit 1
fi
@dmitryd
dmitryd / git-change-committer.sh
Created May 28, 2015 07:55
Changing committer information for git
#!/bin/bash
git filter-branch --env-filter '
OLD_EMAIL="user1@example.org"
CORRECT_NAME="Rick Grimes"
CORRECT_EMAIL="rick.grimes@zombyworld.net"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
@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/
@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 / 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 / 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;