Skip to content

Instantly share code, notes, and snippets.

View Kintull's full-sized avatar

Roman Berdichevskii Kintull

  • The Netherlands, Alkmaar
View GitHub Profile
@Kintull
Kintull / pre-commit
Created March 9, 2017 14:05
Git pre-commit hook to prevent non-ascii characters in C, C++, Erlang source code files
#!/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 November 28, 2017 23:41
Simple server that implements LIFO stack
%% @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 April 1, 2020 08:20
Start Elixir ExUnit test from console
# 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]