Skip to content

Instantly share code, notes, and snippets.

@stanislaw
stanislaw / DYLDYN.cpp
Created February 21, 2018 21:48
Fixup selectors
// Resolve the relocations for all symbols we currently know about.
void RuntimeDyldImpl::resolveRelocations() {
MutexGuard locked(lock);
// Print out the sections prior to relocation.
DEBUG(
for (int i = 0, e = Sections.size(); i != e; ++i)
dumpSectionMemory(Sections[i], "before relocations");
);
@stanislaw
stanislaw / Beams.lus
Last active February 22, 2018 18:16
Kind2/Lustre examples for the Week 6 quiz on the course Formal Software Verification.
-- I am building a cancer treatment machine. The machine can emit two types of
-- beams; for simplicity let’s just call them A and B. There are two different
-- plates that can be placed in front of the beam; let’s call them 1 and 2. When
-- you turn the machine on it always starts ups with beam set to A and plate set
-- to 1. That is the initial state.
-- For safety reasons we never want the machine to be at beam B and plate 2.
-- If this every happens a deadline dose of radiation will be emitted and it
-- will kill the patient.
-- But all of the other combinations of beams and plates are valid.
@stanislaw
stanislaw / Keybase.md
Created February 27, 2018 15:56
Keybase.md

Keybase proof

I hereby claim:

  • I am stanislaw on github.
  • I am stanislaw (https://keybase.io/stanislaw) on keybase.
  • I have a public key ASCiwHfn7gYVr7FqXxfrYIBZmpQYEeW9PkFBUVwhQxx7Ygo

To claim this, I am signing this object:

@stanislaw
stanislaw / Idea.md
Created March 19, 2018 18:26
Idea onboarding

Notes...

  • Command + N Generate...

  • Command + E Recent files

  • Command + Shift + backspace - идет назад по истории изменений

  • Command + Alt + V создать новую переменную из выражения

    • сложные выражения
@stanislaw
stanislaw / HexDump.c
Created April 30, 2018 10:44
Printing hex dumps for diagnostics
// https://codereview.stackexchange.com/questions/165120/printing-hex-dumps-for-diagnostics
// http://coliru.stacked-crooked.com/a/95da32e8ef05d557
@stanislaw
stanislaw / wrapfigure_without_whitespace.tex
Created October 6, 2018 17:31 — forked from yig/wrapfigure_without_whitespace.tex
Eliminate white space around wrapfigure environments in LaTeX.
%% The typical answer for how to eliminate white space in wrapfigure doesn't work for me (I'm using a SIGGRAPH style sheet):
%% http://tex.stackexchange.com/questions/111393/too-much-space-around-wrap-figure
%% Instead, let's just offset the image.
%% The horizontal white space is \columnsep and the vertical white space is \intextsep.
%% Subtract them from the column width and offset the image accordingly.
%% How to move an image:
%% http://tex.stackexchange.com/questions/107340/how-to-shift-graphics-adjust-placement-of-figure-with-includegraphics
\begin{wrapfigure}[11]{R}{1in - .75\columnsep}
%\centering
\vspace{-\intextsep}
@stanislaw
stanislaw / Cheatsheet.md
Created October 6, 2018 17:49
Pandoc/Tex
\begin{wrapfigure}[8]{r}{0.25\textwidth}
\centering
\vspace{-\intextsep}
\includegraphics[width=0.25\textwidth]{files/Eschede/01_Fraunhofer.jpg}
\caption{Basic layout}
\end{wrapfigure}
@stanislaw
stanislaw / Makefile
Created January 23, 2020 20:20
RRRR
################################################################################
# Self-Documented Makefile
# http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
define HELP
If you are running this first time, follow these steps:
make image.create
make container.create
make container.run
endef
export HELP
@stanislaw
stanislaw / splitpdf.py
Created July 26, 2020 10:34 — forked from AlexDenisov/splitpdf.py
Splits a PDF file for manual double-side printing
#!/usr/bin/env python3
import sys, os
from PyPDF2 import PdfFileReader, PdfFileWriter
inputname = sys.argv[1]
pdf = PdfFileReader(inputname)
numpages = pdf.getNumPages()
if numpages % 2 == 1:
numpages = numpages - 1
@stanislaw
stanislaw / How to generate PDF with Sphinx on macOS and Linux.md
Last active May 1, 2023 09:37
How to generate PDF with Sphinx on macOS and Linux

How to generate PDF with Sphinx on macOS

Install BasicTex.

Add this to your Bash or Zsh:

export PATH="/Library/TeX/texbin/:$PATH"