Skip to content

Instantly share code, notes, and snippets.

View mrts's full-sized avatar

Mart Sõmermaa mrts

  • Tallinn, Estonia (EET, UTC +2 hours)
View GitHub Profile
import java.util.stream.Collectors;
import org.springframework.data.domain.Sort;
import org.springframework.data.domain.Sort.Order;
import com.vaadin.flow.data.provider.Query;
import com.vaadin.flow.data.provider.SortDirection;
public class SpringDataVaadinUtil {
@mdesantis
mdesantis / upgrade-postgres-9.6-to-10.md
Last active October 11, 2021 08:11 — forked from delameko/upgrade-postgres-9.5-to-9.6.md
Upgrading PostgreSQL from 9.6 to 10 on Ubuntu 16.04

TL;DR

Install Postgres 10, and then:

sudo pg_dropcluster 10 main --stop
sudo pg_upgradecluster 9.6 main
sudo pg_dropcluster 9.6 main
@mbinna
mbinna / effective_modern_cmake.md
Last active May 3, 2024 15:44
Effective Modern CMake

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

@bgloh
bgloh / ble_scan_example.py
Created June 8, 2017 04:14
ble scan example using bluepy, bluez, and raspberry pi
from bluepy.btle import Scanner, DefaultDelegate
class ScanDelegate(DefaultDelegate):
def __init__(self):
DefaultDelegate.__init__(self)
def handleDiscovery(self, dev, isNewDev, isNewData):
if isNewDev:
print "Discovered device", dev.addr
elif isNewData:
@jmvrbanac
jmvrbanac / gunicorn_options.yml
Last active August 26, 2023 18:13
Capture Client Certificate CN from Gunicorn
bind: 0.0.0.0:8000
workers: 1
worker_class: "example.worker:CustomWorker"
timeout: 30
ca_certs: ca.crt
certfile: server.crt
keyfile: server.key
cert_reqs: 2
do_handshake_on_connect: true
@justincbagley
justincbagley / How_to_Convert_Markdown_to_PDF.md
Last active April 28, 2024 22:28
How To Convert Markdown to PDF

How to convert markdown to PDF:

This post reviews several methods for converting a Markdown (.md) formatted file to PDF, from UNIX or Linux machines.

Using Pandoc:

$ pandoc How_I_got_svg-resizer_working_on_Mac_OSX.md -s -o test1.pdf
@hannesbe
hannesbe / conf\conf.user.json
Last active November 18, 2020 12:53
Typora user config (goes in %USERPROFILE%\Roaming\Typora\conf\conf.user.json) & base theme css (goes in %USERPROFILE%\Roaming\Typora\themes)
/**
Typora user config
C:\Users\hava\AppData\Roaming\Typora\conf\conf.user.json */
{
"width" : null, // Integer - Window's width in pixels. Default is null (last window width)
"height" : null, // Integer - Window's height in pixels. Default is null (last window height)
"directWrite": true, // Boolean - Enables DirectWrite font rendering system on Windows. Default is true.
"defaultFontFamily": {
"standard": null, //String - Defaults to "Times New Roman".
"serif": null, // String - Defaults to "Times New Roman".
@kfatehi
kfatehi / _list-github-pull-requests.md
Last active April 29, 2024 00:26
list pull requests across entire organization
@alekseykulikov
alekseykulikov / index.md
Last active April 14, 2024 00:32
Principles we use to write CSS for modern browsers

Recently CSS has got a lot of negativity. But I would like to defend it and show, that with good naming convention CSS works pretty well.

My 3 developers team has just developed React.js application with 7668 lines of CSS (and just 2 !important). During one year of development we had 0 issues with CSS. No refactoring typos, no style leaks, no performance problems, possibly, it is the most stable part of our application.

Here are main principles we use to write CSS for modern (IE11+) browsers:

@evanwill
evanwill / gitBash_windows.md
Last active April 26, 2024 03:58
how to add more utilities to git bash for windows, wget, make

How to add more to Git Bash on Windows

Git for Windows comes bundled with the "Git Bash" terminal which is incredibly handy for unix-like commands on a windows machine. It is missing a few standard linux utilities, but it is easy to add ones that have a windows binary available.

The basic idea is that C:\Program Files\Git\mingw64\ is your / directory according to Git Bash (note: depending on how you installed it, the directory might be different. from the start menu, right click on the Git Bash icon and open file location. It might be something like C:\Users\name\AppData\Local\Programs\Git, the mingw64 in this directory is your root. Find it by using pwd -W). If you go to that directory, you will find the typical linux root folder structure (bin, etc, lib and so on).

If you are missing a utility, such as wget, track down a binary for windows and copy the files to the corresponding directories. Sometimes the windows binary have funny prefixes, so