This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| print_trace = fn(print_trace, fd) -> | |
| receive do | |
| msg -> | |
| :io.format(fd, "call: (tracer pid: ~p)~n ~p~n", [self(), msg]) | |
| print_trace.(print_trace, fd) | |
| end | |
| end | |
| {ok, fd} = :file.open("/tmp/trace.out", [:write]) | |
| custom_tracer = :proc_lib.spawn(fn -> print_trace.(print_trace, fd) end) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| FILES=*.srt | |
| for f in $FILES | |
| do | |
| echo "Processing $f file..." | |
| iconv -c -f WINDOWS-1251 -t UTF-8 "$f" -o "$f" | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class PaymentInput < SimpleForm::Inputs::Base | |
| def input(wrapper_options) | |
| custom_input_options = { value: value, maxlength: 16 } | |
| merged_input_options = merge_wrapper_options(input_html_options, wrapper_options) | |
| merged_input_options = merge_wrapper_options(custom_input_options, merged_input_options) | |
| @builder.text_field(attribute_name, merged_input_options) | |
| end | |
| def value | |
| before_type_cast_value = object.send("#{attribute_name}_money_before_type_cast") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # most hungry processes (no, htop is too mainstream) | |
| ps aux --sort -rss | head -n 10 | sed 's/[^ ]* *[0-9]* *\([0-9\.]*\) *\([0-9\.]*\) *[0-9]* *[0-9]* *? *[SsLl]* *[^ ]* *[^ ]* *\([^ ]*\).*/processor: \1%, memory: \2%, process: \3/' | |
| # fix unzipped files with russian names in current directory | |
| find . -type f -exec sh -c 'np=`echo {}|iconv -f cp1252 -t cp850| iconv -f cp866`; mv "{}" "$np"' \; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| db: | |
| image: postgres | |
| ports: | |
| - "5432" | |
| mailcatcher: | |
| image: simpledrupalcloud/mailcatcher:latest | |
| hostname: mailcatcher | |
| ports: | |
| - "1080:1080" |