Skip to content

Instantly share code, notes, and snippets.

@jason-s
jason-s / typst-vscode-quickstart.typ
Last active April 5, 2023 16:10
Typst VSCode quickstart
#set page(width: 20cm, height:auto)
#set heading(numbering: "1.")
= Fun with typst
The typst program is pretty neat!
- Extremely fast incremental recompile
- Easier syntax
- Markup includes a well-designed scripting language
@jason-s
jason-s / math-rosetta.md
Last active March 23, 2023 03:52
LaTeX -> typst migration guide
LaTeX (render) typst (render)
$$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$$ $$\sum_{i=0}^n i^2 = \frac{(n^2+n)(2n+1)}{6}$$ sum_(i=0)^n i^2 = ((n^2+n)(2n+1))/6
\lim_{\Delta x \to 0} \frac{\sin (x + \Delta x) - \sin x}{\Delta x} = \frac{d}{dx} \sin x = \cos x $$\lim_{\Delta x \to 0} \frac{\sin (x + \Delta x) - \sin x}{\Delta x} = \frac{d}{dx} \sin x = \cos x$$ lim_(Delta x->0) (sin (x + Delta x) - sin(x))/(Delta x) = d/(d x) sin x = cos x
\mathbf{T}(\theta) = \begin{bmatrix}\cos\theta & -\sin\theta \\ \sin\theta & \cos\theta \end{bmatrix} (won't render in this form in GitHub Markdown math in a table) #let bf(x) = $upright(bold(#x))
#set math.mat(delim: "[")
bf(T)(theta) = mat(cos theta, -sin theta; sin theta, cos theta)
@jason-s
jason-s / html-table-border-test
Created January 4, 2023 17:24
Table border test for possible Chrome bug
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
body {
font-family: 'Segoe UI', 'Lucida Grande'
}
table {
border: 1px solid black;
border-collapse: collapse;
@jason-s
jason-s / README.md
Created June 29, 2022 13:52
MathJax in SVG

SVG_MathJax

This replaces MathJax inline markup in an <svg> element with SVG-rendered MathJax.

Usage is easy:

<html>
    <head>
 
@jason-s
jason-s / quepland-bonuses.txt
Last active April 14, 2022 03:15
Quepland 2 notes
Food side-effects
Jerky Bonus Cul Arts Hunting
-----
Rabbit +5 Knifesmanship 1 1
Deer +5 Archery 5 5 (18 Buck)
Bear +5 Hammership 30 50
Moose +5 Swordsmanship 45 65
Boar +5 Mining 35 43
Pigeon +5 Axemanship 1 1
@jason-s
jason-s / a1w.jpg
Last active December 24, 2021 21:57
a1w.jpg
@jason-s
jason-s / README.md
Last active April 3, 2021 03:24
Wordpress ate my матрёшка hacker code

I was looking for a motor website and noticed this suspicious looking JavaScript code:

https://web.archive.org/web/20200705182323/http://www.turnigy.com:80/about-us/

It is apparently a 3-level deep obfuscation of some website redirection that failed, because Wordpress faithfully encoded it rather than inserting directly.

  • hack1.js is the code that appears visually in the webpage.
  • hack2.js is the content of variable VWGMMLIBLQ that gets eval()d in hack1.js
  • hack3.js is the content of variable BPCDLVJEMJ that gets eval()d in hack2.js
  • hack4.js is the content of variable dec that gets executed via (new Function(dec))(); in hack3.js
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.12.0/katex.min.css" />
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.12.0/katex.min.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/KaTeX/0.12.0/contrib/auto-render.min.js"></script>
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function(event) {
@jason-s
jason-s / scavhunt-20200613.md
Last active June 13, 2020 20:24
2020 Jun 13 Scavenger Hunt Rules

Country of Origin

At-home Scavenger Hunt, June 13, 2020

J. Sachs

Version 1.01