Skip to content

Instantly share code, notes, and snippets.

@Lenchik
Lenchik / monad.R
Created August 17, 2016 21:02 — forked from chiral/monad.R
Monads on R
"%<-%" <- function(x,y) call("<-",substitute(x),substitute(y))
returm <- function(x) call("return",substitute(x))
exec <- quote
join <- function(ss,sep) {
res <- ""
for (s in ss) {
res <- paste(res,s,sep=sep)
}
res
@Lenchik
Lenchik / git.tex
Created August 7, 2016 19:27 — forked from ScumCoder/git.tex
Код для печати 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()
@Lenchik
Lenchik / example.md
Created July 6, 2016 16:43 — forked from ericclemmons/example.md
HTML5 <details> in GitHub

Using <details> in GitHub

Suppose you're opening an issue and there's a lot noisey logs that may be useful.

Rather than wrecking readability, wrap it in a <details> tag!

<details>
 <summary>Summary Goes Here</summary>
@Lenchik
Lenchik / hack4tex
Created March 8, 2016 11:12 — forked from gramian/hack4tex
A small script to use the hack truetype font in pdflatex
#!/bin/sh
# hack4tex 0.1
# Copyright (c) 2016 Christian Himpe
# released under BSD 2-Clause License ( opensource.org/licenses/BSD-2-Clause )
# based on Stephan Lehmke's answer to "How do I use TrueType Fonts with PDFTeX
# using otftotfm?" on tex.stackexchange.com/a/52902
#
# requires otftotfm which is part of lcdf-typetools
#
@Lenchik
Lenchik / highlighting_mwe.tex
Created November 6, 2015 22:28
Very good Highlighting for pdflatex % http://tex.stackexchange.com/a/220067/79756 Unfortunately only for pdflatex for now
\documentclass{minimal}
%Very good Highlighting % http://tex.stackexchange.com/a/220067/79756
\usepackage{soulutf8} %PACKAGE %slight modification from ordinary soul. may become more buggy
\usepackage{tikz} %PACKAGE
\usetikzlibrary{calc} %PACKAGE
\usetikzlibrary{decorations.pathmorphing}
\makeatletter
\newcommand{\defhighlighter}[3][]{%
@Lenchik
Lenchik / README.md
Created November 2, 2015 20:36
rumath.sty (http://dxdy.ru/post690463.html#p690463) Знак интеграла в русской традиции (требует основательных доработок)

Автор изначальной версии: ptrvc. Цитата с Re: Знак интеграла в русской традиции: Для себя решил эту проблему следующим образом. Сделал стилевой файл на основе amsmath...

Добавил туда такие возможности:

  • прямые греческие буквы (наклонные тоже доступны, но через \mathit);
  • прямые интегралы из шрифта mathx;
  • команды для интегралов в отечественном стиле:
\intl \intL \inth \intH
@Lenchik
Lenchik / escaping_url.tex
Created July 21, 2015 21:19
Попытка написать функцию по борьбе с неэкранированными символами в ссылках из библиографии LaTeX
\makeatletter
\verbtocs{\diez} |#|
\newcommand*{\doit}[2]{%
\StrSubstitute{#2}{_}{\_}[\doit@text]%
% \StrSubstitute{\doit@text}{\diez}{\diez}[\doit@text]%
\StrSubstitute{\doit@text}{<}{\textless}[\doit@text]%
\StrSubstitute{\doit@text}{>}{\textgreater}[\doit@text]%
\StrSubstitute{#1}{<}{\@percentchar3C}[\doit@link]%
% \StrSubstitute{\doit@link}{\diez}{\%23}[\doit@link]%
\StrSubstitute{\doit@link}{>}{\@percentchar3E}[\doit@link]%
@Lenchik
Lenchik / Coder.ini
Last active January 1, 2016 19:59
Autohotkey file for highlighting tests
[Options]
/San_dr=53005400520020002200230030003000310032004100460022000D0043004F004D004D0020002200230044003900300030003000300022000D0056004100520020002200230034004200370034004100350022000D00440045004C00310020002200230030003000380032003800320022000D00440045004C00320020002200230036003400300030003000300022000D00540059005000450020002200230043004300360031003300370022000D004F00500020002200230038003000380030003000300022000D0054004100470020002200230030003000330039003800380022000D00410054005400520020002200230034003400340034003600460022000D004900460020002200230039003200300033004600310022000D00410052004500410020002200230030003000380032003000300022000D004E0055004D0020002200230036003300320037003500330022000D0048006900670068004C0069006700680074005F0046006F006E0074005300740079006C00650020002200300022000D0048006900670068004C0069006700680074005F0046006F006E007400530069007A00650020002200300022000D0048006900670068004C0069006700680074005F0046006100630065004E0061006D0065002000220022000D0048006900670068004C0069006700680074005F0042