Skip to content

Instantly share code, notes, and snippets.

View konstantin-morenko's full-sized avatar

Konstantin Morenko konstantin-morenko

View GitHub Profile
@konstantin-morenko
konstantin-morenko / pre-commit.sh
Created May 9, 2019 17:09
[Git] Pre-commit hook checking build targets is up-to-date
#!/bin/sh
# Check the rebuild files are up-to-date
if ! $(make -q) ; then
echo "Remake files with make"; exit 1
fi
@konstantin-morenko
konstantin-morenko / list-categories-count.liquid
Last active January 21, 2021 14:49 — forked from Phlow/list-categories-count.liquid
Jekyll: List all categories with according post count and show and link all post items listed in the according category
<h2>Categories</h2>
<ul>
{% assign categories_list = site.categories %}
{% if categories_list.first[0] == null %}
{% for category in categories_list %}
<li><a href="#{{ category }}">{{ category | capitalize }} ({{ site.tags[category].size }})</a></li>
{% endfor %}
{% else %}
{% for category in categories_list %}
<li><a href="#{{ tag[0] }}">{{ category[0] | capitalize }} ({{ category[1].size }})</a></li>