Skip to content

Instantly share code, notes, and snippets.

@miku
miku / marked-katex.js
Created January 30, 2025 13:03 — forked from carmel/marked-katex.js
marked with katex
import { marked } from 'marked'
import hljs from 'highlight.js'
import katex from 'katex'
marked.setOptions({
langPrefix: 'hljs lang-',
pedantic: false,
gfm: true, // 是否启动类似Github样式的Markdown
breaks: false, // 是否支持Github换行符
tables: true, // 是否支持Github形式的表格
@miku
miku / improveEdgeLabels.gvpr
Created January 28, 2025 16:15 — forked from steveroush/improveEdgeLabels.gvpr
A GVPR program to improve Graphviz edge labels
/***********************************************
1. save this file as improveEdgeLabels.gvpr
2. what it does: it allows you to re-position Graphviz edge labels
3. command line example (works with any Graphviz engine):
dot myfile.gv |gvpr -cf improveEdgeLabels.gvpr |neato -n2 -Tpng >myfile.png
4. how to use:
improveEdgeLabels adds 3 new edge attributes to Graphviz:
- labelOverlay, labelAdjust, label2Node
- they can be used separately or in combination
- if labelOverlay=true
@miku
miku / wordlist-german.txt
Created January 21, 2025 23:38 — forked from MarvinJWendt/wordlist-german.txt
All german words (german wordlist).
This file has been truncated, but you can view the full file.
AA
AAA
Aachen
Aachener
Aachenerin
Aachenerinnen
Aachenern
Aacheners
Aachens

via (https://www.linux.com/learn/tutorials/442438-vim-tips-folding-fun)

  • zf#j creates a fold from the cursor down # lines.
  • zf/string creates a fold from the cursor to string .
  • zj moves the cursor to the next fold.
  • zk moves the cursor to the previous fold.
  • zo opens a fold at the cursor.
  • zO opens all folds at the cursor.
  • zm increases the foldlevel by one.
  • zM closes all open folds.
@miku
miku / clx.go
Created November 14, 2024 00:15 — forked from Sh4yy/clx.go
Generate CLI commands for common tasks.
package main
import (
"context"
"errors"
"fmt"
"io"
"log"
"os"
"runtime"
@miku
miku / add_gaussian_noise.py
Created October 27, 2024 12:52 — forked from Prasad9/add_gaussian_noise.py
Python code to add random Gaussian noise on images
import cv2
def add_gaussian_noise(X_imgs):
gaussian_noise_imgs = []
row, col, _ = X_imgs[0].shape
# Gaussian distribution parameters
mean = 0
var = 0.1
sigma = var ** 0.5
@miku
miku / spread.cpp
Last active September 25, 2024 12:08
4-1
/** getSpread returns the difference between the highest bid and the lowest
* offer (ask). It throws an exception, if the orders do not contain both bids
* and asks. */
double OrderBook::getSpread(std::vector<OrderBookEntry>& orders)
{
if (orders.empty()) {
return 0;
}
// https://web.stanford.edu/class/cme241/lecture_slides/Tour-OrderBook.pdf#page=3
@miku
miku / .gitignore
Last active August 23, 2024 09:56
Rotating fds for keeping logs intact after logrotate / golang
go.log
@miku
miku / colors.py
Created May 16, 2024 09:51 — forked from rene-d/colors.py
ANSI color codes in Python
# SGR color constants
# rene-d 2018
class Colors:
""" ANSI color codes """
BLACK = "\033[0;30m"
RED = "\033[0;31m"
GREEN = "\033[0;32m"
BROWN = "\033[0;33m"
BLUE = "\033[0;34m"
@miku
miku / 01-Learning-Python3.md
Created March 29, 2024 22:25 — forked from kenjyco/01-Learning-Python3.md
Learn Python 3 with Jupyter Notebook