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
| // socket-binding.c | |
| // | |
| // This is small tool that helps to clarify how to listen IPv6 socket and it | |
| // is nessesary or not listen IPv4 socket at the same time. | |
| // | |
| // Compile `gcc -std=c11 -o listen main.c` | |
| // | |
| // Run binary with option `-4` or `-6` and connect to port(default is 5489) | |
| // with netcat in the following way. | |
| // 1. `nc -4 127.0.0.1 5489` |
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
| # FindFontConfig.cmake | |
| # Daniel Bershatsky, 2018 | |
| #.rst: | |
| # FindFontConfig | |
| # -------------- | |
| # | |
| # Find FontConfig library for configuring and customizing font access. | |
| # | |
| # Imported Targets |
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
| /** | |
| * \file endianness.h | |
| * \brief This header defines common routine for convertion from network | |
| * ordered integers(which is usually big endian) to byte order that is native | |
| * to host. | |
| * | |
| * There is if-constexpr so C++17 compiler is strongly needed for this. | |
| */ | |
| #pragma once |
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
| from typing import List, Tuple | |
| from random import randint | |
| def gen_array(random=True, size=8 * 1024 * 1024): | |
| if random: | |
| return [randint(-1000, 1000) for i in range(size)] | |
| else: | |
| return list(sorted(gen_array(True, size))) |
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
| --- weak-ordering.asm 2018-03-15 14:59:41.504213243 +0300 | |
| +++ stong-ordering.asm 2018-03-15 14:59:32.910123855 +0300 | |
| @@ -9,7 +9,7 @@ | |
| sub $0x38,%rsp | |
| mov 0x78(%rdi),%eax | |
| test %eax,%eax | |
| + jne 0x40a20a <StressPushPop(benchmark::State&)+490> | |
| - jne 0x40a218 <StressPushPop(benchmark::State&)+504> | |
| mov $0x409700,%r13d | |
| mov $0x62ff68,%r15d |
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 | |
| # dev-null.sh | |
| # This shell script implement /dev/null as a Service(//aaS). | |
| IFS=$'\n\n' | |
| while true; do | |
| rm -rf /tmp/input /tmp/output | |
| mkfifo /tmp/input /tmp/output |
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
| #!/usr/bin/env python3 | |
| import click | |
| import PIL.Image | |
| @click.command() | |
| @click.argument('input', type=click.Path(exists=True, dir_okay=False)) | |
| @click.argument('output', type=click.Path(exists=False)) | |
| def main(input, output): | |
| img = PIL.Image.open(input) |
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
| package main | |
| import ( | |
| "flag" | |
| "io" | |
| "log" | |
| "os" | |
| jpg "image/jpeg" | |
| "image/png" |
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
| // listen.c | |
| // | |
| // This is small tool that helps to clarify how to listen IPv6 socket and it | |
| // is nessesary or not listen IPv4 socket at the same time. | |
| // | |
| // Compile `gcc -std=c11 -o listen listen.c` | |
| // | |
| // Run binary with option `-4` or `-6` and connect to port(default is 5489) | |
| // with netcat in the following way. | |
| // 1. `nc -4 127.0.0.1 5489` |
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 | |
| # inject-metrica.sh | |
| # Inject Yandex Metrica counter into all HTML files after <body> tag. | |
| COUNTER='<put Yandex Metrica one-line counter here>' | |
| COUNTER=$(sed 's/\//\\\//g' <<< $COUNTER) | |
| for file in $(ls *.html); do | |
| echo "processing $file" | |
| sed -i "s/<body>/<body>\n$COUNTER/g" $file |