Skip to content

Instantly share code, notes, and snippets.

View igneus's full-sized avatar

Jakub Pavlík igneus

View GitHub Profile
@glowinthedark
glowinthedark / pyqt5_pdf_viewer.py
Last active May 7, 2024 01:41
Python simple PDF viewer using PyQt5 and mozilla's pdf.js
#!/usr/bin/env python3
import sys
from pathlib import Path
from PyQt5.QtCore import *
from PyQt5.QtWebEngineWidgets import *
from PyQt5.QtWidgets import *
# REQUIREMENTS
@fergiemcdowall
fergiemcdowall / README.md
Last active March 8, 2025 10:51
How to use pandoc to generate HTML from GitHub-flavoured markdown

Here is a little recipe for generating html from github-flavoured markdown. CSS extracted and modified from https://github.com/sindresorhus/github-markdown-css on 22-05-2019. At some point this CSS will probably have to be updated, but for now it works.

  1. Install pandoc 2.x or higher

  2. Save github-markdown.css (below) to ´~/.pandoc/github-markdown.css´

  3. To convert a file called README.md (change as appropriate) run ´pandoc --standalone -c ~/.pandoc/github-markdown.css -f gfm -t html README.md´

@mihow
mihow / load_dotenv.sh
Last active April 25, 2025 17:10
Load environment variables from dotenv / .env file in Bash
# The initial version
if [ ! -f .env ]
then
export $(cat .env | xargs)
fi
# My favorite from the comments. Thanks @richarddewit & others!
set -a && source .env && set +a
@jeetsukumaran
jeetsukumaran / test1.tex
Created September 2, 2016 14:31
BibLaTeX customizations (emphasize author name when rendering bibliography, etc.)
%% emphasize author name when rendering bibliography
% Note: requires: \usepackagage{biblatex}
\newcommand{\emphasizeAuthorName}[1]{%
\DeclareNameFormat{author}{%
\edef\tempname{{#1}}%
\ifnumequal{\value{listcount}}{1}
{\ifnumequal{\value{liststop}}{1}
{\expandafter\ifstrequal\tempname{##1}{\textbf{##1\addcomma\addspace ##4\isdot}}{##1\addcomma\addspace ##4\addcomma\isdot}}
{\expandafter\ifstrequal\tempname{##1}{\textbf{##1\addcomma\addspace ##4\isdot}}{##1\addcomma\addspace ##4}}}
@linxlad
linxlad / FormErrorsSerializer.php
Last active August 18, 2023 11:20 — forked from Graceas/FormErrorsSerializer.php
Symfony 2 Form Error Serializer. May be used for AJAX form validation. Allows tree and flat array styles for errors.
<?php
namespace OpenObjects\Bundle\CoreBundle\Service;
use Symfony\Component\Form\Extension\Validator\ViolationMapper\ViolationMapper;
use Symfony\Component\Form\Form;
use Symfony\Component\Form\FormError;
use Symfony\Component\Validator\ConstraintViolation;
/**
@liverbool
liverbool / bootstrap_4_horizontal_layout.html.twig
Created March 22, 2016 09:32
bootstrap_4_horizontal_layout.html.twig
{% use "web:Form:bootstrap_4_layout.html.twig" %}
{# Labels #}
{% block form_label -%}
{% if label is same as(false) %}
<div class="{{ block('form_label_class') }}"></div>
{% else %}
{% set label_attr = label_attr|merge({class: (label_attr.class|default('') ~ ' ' ~ block('form_label_class'))|trim}) %}
{{- parent() -}}
@liverbool
liverbool / bootstrap_4_layout.html.twig
Created March 22, 2016 09:32
bootstrap_4_layout.html.twig
{% use "form_div_layout.html.twig" %}
{# Widgets #}
{% block form_widget_simple -%}
{% if type is not defined or 'file' != type %}
{%- set attr = attr|merge({class: (attr.class|default('') ~ ' form-control')|trim}) -%}
{% endif %}
{{- parent() -}}
{%- endblock form_widget_simple %}
@cortesben
cortesben / hg-commands.md
Last active March 6, 2025 14:58
Mercurial command cheat sheet

Mercurial Commands

Commands Description
hg pull get latest changes like git pull use flags like -u IDK why yet
hg add only for new files
hg commit add changes to commit with -m for message just like git
hg addremove adds new files and removes file not in your file system
hg incoming see changes commited by others
hg outgoing see local commits
@profh
profh / decode_session_cookie.rb
Last active January 9, 2025 12:23
A simple script to decode Rails 4 session cookies
@staltz
staltz / introrx.md
Last active April 29, 2025 08:33
The introduction to Reactive Programming you've been missing