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 / 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 / _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 / 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 / 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) {
(println "Hello")
(defn foo []
(fn [] (println "hello")))
(ns somename)
(defn foo1 [] "hello")
(defn foo2 [] "world")
{
:title "Stupid name"
:backend (fn [] (str (foo1) " " (foo2)))
:frontend (fn [] ())
:timeout 1000
<html>
<head>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script>
<script>
$(document).ready(function () {
$.ajax({
url: 'http://localhost:63342/api/about',
dataType: 'jsonp',
success: function (data) {
$('#version').html(data.productName + " " + data.baselineVersion);
@ignatov
ignatov / build-images.sh
Last active August 29, 2015 14:20
docker images for sql databases
docker pull mysql:5.7
docker pull mysql:5.6
docker pull mysql:5.5
docker build -t mysql-5.1 github.com/ignatov/docker-mysql-5.1
docker pull postgres:9.4
@ignatov
ignatov / Rebase PR.zsh
Last active December 23, 2015 23:22
Rebase PR
rebase-pr() {
br=pr$1
set -x
git stash
git fetch origin pull/$1/head:$br
git checkout $br
git rebase master $br
git checkout master
git rebase $br master
git stash pop