Skip to content

Instantly share code, notes, and snippets.

View dmitryd's full-sized avatar

Dmitry Dulepov dmitryd

View GitHub Profile
@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 / 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/
@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 / 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 / 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 / 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