Skip to content

Instantly share code, notes, and snippets.

View ignatov's full-sized avatar

Sergey Ignatov ignatov

  • JetBrains
  • Amsterdam, NL
View GitHub Profile
@ignatov
ignatov / gist:656807
Created October 31, 2010 16:38
lift url rewriting
LiftRules.statelessRewrite.append {
case RewriteRequest(ParsePath(path, "pdf", _, _), _, _) => // match /*.pdf
RewriteResponse("history" :: Nil) // Use webapp/history.html
}
@ignatov
ignatov / git-email-renamer.sh
Created December 5, 2010 10:44
git commiter email remaner
#!/bin/sh
git filter-branch --env-filter '
an="$GIT_AUTHOR_NAME"
am="$GIT_AUTHOR_EMAIL"
cn="$GIT_COMMITTER_NAME"
cm="$GIT_COMMITTER_EMAIL"
if [ "$GIT_COMMITTER_EMAIL" = "sergey@ignatov.spb.su" ]
@ignatov
ignatov / gist:1032939
Created June 18, 2011 09:03
Colladoc: Model rebuild
Index: src/main/scala/scala/tools/colladoc/model/mapper/User.scala
===================================================================
--- src/main/scala/scala/tools/colladoc/model/mapper/User.scala (revision 0b95b1d340a4c9660fd027a0e3c6ccf7143c2596)
+++ src/main/scala/scala/tools/colladoc/model/mapper/User.scala (revision )
@@ -32,6 +32,7 @@
import js.JE.ValById
import net.liftweb.util.Helpers._
import xml.Text
+import lib.DependencyFactory
import lib.js.JqUI.ReloadTable
@ignatov
ignatov / gist:1053739
Created June 29, 2011 12:33
Set values to mbr.comment
/** Set value to mbr.comment from mbr.tag() */
private def setCurrent(mbr: MemberEntity, isSelf: Boolean) = {
def doo(mbr: MemberEntity, isSelf: Boolean)() = {
println(mbr.tag())
val value = mbr.tag() match {
case c: Comment => c.comment.is
case s: String => s
case _ => "None"
}
println(value)
@ignatov
ignatov / gist:1064000
Created July 4, 2011 22:01
Export fix
Index: src/main/scala/scala/tools/colladoc/api/ExportService.scala
===================================================================
--- src/main/scala/scala/tools/colladoc/api/ExportService.scala (revision 3d8cdc01d382129af82be095e5712ac00d25d86b)
+++ src/main/scala/scala/tools/colladoc/api/ExportService.scala (revision )
@@ -89,20 +89,24 @@
protected def processTemplate(tpl: DocTemplateEntity): NodeSeq =
<xml:group>
- { if (tpl.comment.get.isUpdated) {
+ { tpl.comment match {
@ignatov
ignatov / gist:1117196
Created July 31, 2011 20:52
Defaul props for Tomcat
# Default properties
-doc-title=Colladoc
-doc-version=1.0-SNAPSHOT
-sourcepath=/var/lib/tomcat6/colladoc.demo/src
-classpath=/var/lib/tomcat6/scala/scala-compiler.jar:/var/lib/tomcat6/scala/scala-library.jar
db.driver=org.postgresql.Driver
db.url=jdbc:postgresql:colladoc
db.user=postgres
db.password=password
@ignatov
ignatov / gist:1177024
Created August 28, 2011 18:36
Cast exception
Index: src/main/scala/scala/tools/colladoc/model/SearchIndex.scala
===================================================================
--- src/main/scala/scala/tools/colladoc/model/SearchIndex.scala (revision d3c359a46cd9902396ec8e3e740edca110137e83)
+++ src/main/scala/scala/tools/colladoc/model/SearchIndex.scala (revision )
@@ -179,12 +179,23 @@
// We could be dealing with a huge list here so it's important that we cons
// as efficiently as possible.
var remainingMembers = members.tail
- additionalMembers.foreach((m)=> {
+
@ignatov
ignatov / gist:1187517
Created September 1, 2011 22:58
Specs to specs2 migration
Index: build.sbt
===================================================================
--- build.sbt (revision d3c359a46cd9902396ec8e3e740edca110137e83)
+++ build.sbt (revision )
@@ -29,11 +29,12 @@
"org.jmock" % "jmock-legacy" %"2.5.1" % "test->default",
"cglib" % "cglib" %"2.1_3" % "test->default",
"org.objenesis" % "objenesis" %"1.0" % "test->default",
- "org.scala-tools.testing" % "specs_2.8.1" % "1.6.6" % "test->default",
"org.seleniumhq.selenium" % "selenium-firefox-driver" % "2.5.0" % "test->default",
Index: support/org/intellij/grammar/refactor/BnfIntroduceRuleHandler.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
<+>/*\n * Copyright 2011-2011 Gregory Shrago\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.intellij.grammar.refactor;\n\nimport com.intellij.openapi.actionSystem.DataContext;\nimport com.intellij.openapi.application.ApplicationManager;\nimport c
@ignatov
ignatov / ErlangDocumentationProviderTest.java
Created December 28, 2012 11:44
ErlangDocumentationProviderTest
/*
* Copyright 2012 Sergey Ignatov
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software