Skip to content

Instantly share code, notes, and snippets.

View mkmkme's full-sized avatar
🦀
crab

Mikhail Koviazin mkmkme

🦀
crab
View GitHub Profile
@mkmkme
mkmkme / main.cpp
Last active August 29, 2015 14:20
operator overloading
#include <iostream>
#include <cstdint>
using namespace std;
class IR
{
public:
uint32_t m_a;
IR() : m_a(0) { cout << "IR::IR()" << endl; }
@mkmkme
mkmkme / main.c
Created May 26, 2015 08:55
Nobody cares about your array size
#include <stdio.h>
#include <string.h>
int f(char arr[6])
{
return printf("%s\n", arr);
}
int main(int argc, char const *argv[])
{
html,
body {
background-color: #c9c9c9 !important;
}
body {
font-family: PT Sans Caption !important;
font-weight: normal !important;
}
body {
color: #000000 !important;
<?xml version="1.0"?>
<!DOCTYPE fontconfig SYSTEM "fonts.dtd">
<fontconfig>
<!--
Documented at
http://linux.die.net/man/5/fonts-conf
To check font mapping run the command at terminal
$ fc-match 'helvetica Neue'
@mkmkme
mkmkme / iceWMdual.mkd
Created December 21, 2015 21:12 — forked from bxt/iceWMdual.mkd
IceWM Dual Screen expanding howto (very basic)

Step 1: Make sure xrandr works fine

Check your screen's names by typing:

xrandr -q

Step 2: Expand your screen

Then disable one of them: (notice VGA-1 is the name of the screen, will differ, e.g. HDMI-1 if the screen is connected via HDMI)

void selection_sort(double *arr, size_t s)
{
for (size_t i = 0; i < s; s++)
{
size_t m_idx = i;
for (size_t j = i + 1; j < s; j++)
{
if (arr[j] < arr[m_idx])
m_idx = j;
}
" Settings
set nohud
set nosmoothscroll
set noautofocus " The opposite of autofocus; this setting stops
" sites from focusing on an input box when they load
set typelinkhints
let searchlimit = 30
let scrollstep = 70
let barposition = "bottom"
@mkmkme
mkmkme / tree.c
Last active December 15, 2016 14:31
special glyphs from systemd
#include <assert.h>
#include <langinfo.h>
#include <locale.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char *strv_find(char **l, const char *name);
@mkmkme
mkmkme / json_comment.py
Last active December 15, 2016 13:39
little helper for comments in JSON
#!/usr/bin/env python3
import json
import sys
def uncomment_line(line):
# print('uncommenting', line)
i = line.find('//')
if i == -1:
return line
@mkmkme
mkmkme / t.cpp
Last active December 22, 2016 14:35
some tricks with variadic templates
// g++ -Wall -std=c++14
#include <iostream>
template <typename... Ts>
size_t get_sum(const Ts&... args)
{
size_t s = 0;
for (const auto& a : {args...})
s += a;