Skip to content

Instantly share code, notes, and snippets.

Avatar

Roman Berdichevskii Kintull

  • fresha.com
  • The Netherlands, Alkmaar
View GitHub Profile
@Kintull
Kintull / pre-commit
Created Mar 9, 2017
Git pre-commit hook to prevent non-ascii characters in C, C++, Erlang source code files
View pre-commit
#!/bin/bash
#cp pre-commit .git/hooks/pre-commit
#chmod +x .git/hooks/pre-commit
filelist=`git diff HEAD --name-only --relative | grep -E '\.(c|h|cc|hh|cpp|erl|hrl|idl)$'`
abort='false'
for filename in $filelist
do
output=`git diff HEAD -- $filename | grep ^+[^+] | tr -d "\000-\011\013-\177" | tr -d '\n'`
@Kintull
Kintull / server.erl
Created Nov 28, 2017
Simple server that implements LIFO stack
View server.erl
%% @author kintull
%% @doc This module implements simple LIFO stack
%% To test the module compile it and run server:test()
-module(server).
-behavior(gen_server).
%%------------------------------
%% API
%%------------------------------
-export([start_link/0, pop_data/1, pick_data/1,
@Kintull
Kintull / start_unit_test.exs
Last active Apr 1, 2020
Start Elixir ExUnit test from console
View start_unit_test.exs
# You can use it to build eflame graph.
#
# First: iex console should be started with `iex -S mix test /test/suite/feature_test.exs`
#
# I would be glad if you can help me with test compilation part from console
# so we don't have to autocompile the test with `mix test`
#
# Then in promtp you can enter to run the ex_unit test:
test_modules = [YourProject.Suite.FeatureTest]