Skip to content

Instantly share code, notes, and snippets.

@ScumCoder
ScumCoder / main.cpp
Created July 9, 2019 21:41
SSCCE for Gumbo parsing issue
#include <iostream>
#include <cassert>
#include <gumbo.h>
int main()
{
// Result is the same if there is no doctype, or if some of the nodes are missing
const char *data = "<!DOCTYPE html>\n<html>\n<head>\n</head>\n<body>\n</body>\n</html>";
GumboOutput *output = gumbo_parse(data);
@ScumCoder
ScumCoder / rednotebook.log
Created March 22, 2018 19:23
rednotebook log
2018-03-22 22:08:08,317 INFO Writing log to file "/home/user/.rednotebook/rednotebook.log"
2018-03-22 22:08:08,318 INFO System encoding: utf-8
2018-03-22 22:08:08,318 INFO Language code: ru_RU
2018-03-22 22:08:08,509 INFO Running in portable mode: False
2018-03-22 22:08:08,509 INFO First Start: False
2018-03-22 22:08:08,510 INFO RedNotebook version: 2.4
2018-03-22 22:08:08,515 INFO System info: machine: x86_64, platform: Linux-4.13.0-37-generic-x86_64-with-Ubuntu-16.04-xenial, processor: x86_64, python_version: 3.5.2, release: 4.13.0-37-generic, system: Linux, GTK: (3, 18, 9), Glib: (2, 47, 3), PyGObject: (3, 20, 0), YAML: 3.11
2018-03-22 22:08:08,935 DEBUG Default font: Ubuntu 11
2018-03-22 22:08:08,936 DEBUG Default size: 11.0
2018-03-22 22:08:09,606 INFO Cloud ignore list: ['#tags', 'and', 'comma', 'filter', 'separated', 'these', 'words']
@ScumCoder
ScumCoder / pseudo.tex
Last active October 10, 2016 19:20
Пример использования пакета algorithm2e
\usepackage[linesnumbered,boxed]{algorithm2e}
........
........
........
\begin{algorithm}[H]
\SetAlgoLined %% Это соединяет линиями логические части
%% алгоритма типа if-then-else
@ScumCoder
ScumCoder / enums.tex
Last active September 7, 2016 09:50
Proper enums
% Меняем везде перечисления на цифра.цифра
\renewcommand{\theenumi}{\arabic{enumi}.}
\renewcommand{\labelenumi}{\arabic{enumi}.}
\renewcommand{\theenumii}{\arabic{enumii}.}
\renewcommand{\labelenumii}{\arabic{enumi}.\arabic{enumii}.}
\renewcommand{\theenumiii}{\arabic{enumiii}}
\renewcommand{\labelenumiii}{\arabic{enumi}.\arabic{enumii}.\arabic{enumiii}.}
@ScumCoder
ScumCoder / git.tex
Created August 7, 2016 18:00
Код для печати git hash в колонтитуле
\usepackage{python}
%Добавляет на каждую страницу hash текущего git-коммита
\begin{python}
#! /usr/bin/python
import os, string
cmd = 'git rev-parse --verify HEAD'
fpipe = os.popen(cmd)
piperesult = fpipe.read()
fpipe.close()
@ScumCoder
ScumCoder / document.tex
Created June 29, 2016 00:35
XeLaTeX MWE
\documentclass{article}
\usepackage{fontspec}
\setmainfont{Linux Libertine}
\begin{document}
Hello!
\end{document}
@ScumCoder
ScumCoder / document.log
Created June 28, 2016 23:55
XeLaTeX font fail
This is XeTeX, Version 3.14159265-2.6-0.99996 (TeX Live 2016/TeX Live for opensuse.org) (preloaded format=xelatex 2016.6.23) 29 JUN 2016 02:54
entering extended mode
\write18 enabled.
%&-line parsing enabled.
**document.tex
(./document.tex
LaTeX2e <2016/03/31>
Babel <3.9r> and hyphenation patterns for 59 language(s) loaded.
(/usr/share/texmf/tex/latex/base/article.cls
Document Class: article 2014/09/29 v1.4h Standard LaTeX document class
@ScumCoder
ScumCoder / minted-unicode.tex
Created June 28, 2016 23:03
minted problem with Unicode
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T2A]{fontenc}
\usepackage[english,main=russian]{babel}
\usepackage{minted}
\begin{document}
\newminted{cpp}{