Skip to content

Instantly share code, notes, and snippets.

@Komosa
Komosa / unyaml.go
Created February 5, 2017 22:16
unyaml
package main
import (
"flag"
"io/ioutil"
"os"
yaml "gopkg.in/yaml.v2"
)
@Komosa
Komosa / htmlize.go
Created March 7, 2017 00:19
htmlize
package main
import (
"errors"
"fmt"
"html/template"
"io"
"os"
"strings"
)
@Komosa
Komosa / stoper.html
Last active September 19, 2017 07:38
standup stoper
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Stoper to keep your standup under control (at least it duration)</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<style>
body {
text-align: center;
@Komosa
Komosa / rm_files.sh
Created October 13, 2017 08:57
nice awk trick
#!/bin/bash
# remove files not in arrar 'files_to_keep'
find -type f -name '*.bin' \
| awk -v keep=" ${files_to_keep[*]} " -e 'keep !~ " "$0" "' \
| xargs -L1 -I II sh -c 'git rm -f II 2>/dev/null || rm II'
@Komosa
Komosa / clickpad.sh
Created October 15, 2017 13:23
clickpad.sh
#!/bin/bash
#
# list of synaptics device properties http://www.x.org/archive/X11R7.5/doc/man/man4/synaptics.4.html#sect4
# list current synaptics device properties: xinput list-props '"SynPS/2 Synaptics TouchPad"'
#
#sleep 5 #added delay...
xinput set-int-prop "SynPS/2 Synaptics TouchPad" "Device Enabled" 8 1
xinput --set-prop --type=int --format=32 "SynPS/2 Synaptics TouchPad" "Synaptics Two-Finger Pressure" 4
xinput --set-prop --type=int --format=32 "SynPS/2 Synaptics TouchPad" "Synaptics Two-Finger Width" 9 # Below width 1 finger touch, above width simulate 2 finger touch. - value=pad-pixels
@Komosa
Komosa / prepipe.cpp
Created September 18, 2018 20:15
pass thru, but color some words and cut some lines
#include <iostream>
#include <vector>
#include <cstdio>
using namespace std;
#define EACH(it, cont) for (auto &it: cont)
#define TermReset "\e[0m"
#define TermBlack "\e[0;30m"
#define TermRed "\e[0;31m"