Skip to content

Instantly share code, notes, and snippets.

View ignatov's full-sized avatar

Sergey Ignatov ignatov

  • JetBrains
  • Amsterdam, NL
View GitHub Profile
(ns somename)
(defn foo1 [] "hello")
(defn foo2 [] "world")
{
:title "Stupid name"
:backend (fn [] (str (foo1) " " (foo2)))
:frontend (fn [] ())
:timeout 1000
(defn foo []
(fn [] (println "hello")))
(println "Hello")
@ignatov
ignatov / PgTest.java
Created January 29, 2014 15:27
Pg JDBC sample
import sun.misc.Version;
import java.sql.*;
import java.util.logging.Level;
import java.util.logging.Logger;
public class PgTest {
// Create the function and try to fetch the meta data for it
// CREATE FUNCTION empty.ie3() RETURNS TABLE (i int, j int) LANGUAGE sql AS 'SELECT 1, 2';
public static void main(String[] args) {
@ignatov
ignatov / Gredy to left markers.diff
Last active December 27, 2015 04:09
Grammar-Kit introduce rule action improvement
Index: support/org/intellij/grammar/refactor/BnfIntroduceRuleHandler.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- support/org/intellij/grammar/refactor/BnfIntroduceRuleHandler.java (revision 53631b9a2739f72bb17d657f6e81073c7e03fedb)
+++ support/org/intellij/grammar/refactor/BnfIntroduceRuleHandler.java (revision )
@@ -104,7 +104,7 @@
public void run() {
final PsiFile containingFile = currentRule.getContainingFile();
@ignatov
ignatov / _before.erl
Last active December 21, 2015 21:28
experiment with the "comma-first style" setting
-spec kind(card()) -> face | number.
kind({_, A}) when A >= 1, A =< 10 -> number;
kind(_) -> face.
fo() -> [1231231, 3, 4, 14, 5].
foo(0) ->
Var = {1, 1, 2},
asd = 1,
asd = 1,
@ignatov
ignatov / unresolved_function_inspection.patch
Created January 10, 2013 12:55
Unresolved function inspection
Index: src/org/intellij/erlang/inspection/ErlangUnresolvedFunctionInspection.java
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
<+>/*\n * Copyright 2012 Sergey Ignatov\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\n/*\n * Copyright 2012 Sergey Ignatov\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance w
@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
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 / 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",