Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View xxdavid's full-sized avatar

David Pavlík xxdavid

View GitHub Profile
@tajpure
tajpure / marked-katex.js
Created August 14, 2016 10:44
Support katex for marked.
const renderer = new marked.Renderer()
let originParagraph = renderer.paragraph.bind(renderer)
renderer.paragraph = (text) => {
const blockRegex = /\$\$[^\$]*\$\$/g
const inlineRegex = /\$[^\$]*\$/g
let blockExprArray = text.match(blockRegex)
let inlineExprArray = text.match(inlineRegex)
for (let i in blockExprArray) {
const expr = blockExprArray[i]
const result = renderMathsExpression(expr)
@bitmorse
bitmorse / lastexport.py
Created March 20, 2013 00:51
lastfm scrobble exporter (from https://gitorious.org/fmthings/lasttolibre/blobs/master/lastexport.py // changed the script to try more often on failure )
#!/usr/bin/env python
#-*- coding: utf-8 -*-
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
@erszcz
erszcz / .gitignore
Last active May 3, 2023 14:45
Comparison of Erlang type checkers: Dialyzer, ETC, and Gradualizer
*.beam
*.erltypes
@DmitrySoshnikov
DmitrySoshnikov / static-dynamic-scope.pl
Created November 12, 2010 22:05
Static and dynamic scope in Perl
# Lexical and dynamic scopes in Perl;
# Static (lexical) scope uses model of
# environments with frames; dynamic scope
# uses single global var frame.
$a = 0;
sub foo {
return $a;
}
sub staticScope {
@VolkerH
VolkerH / feret_diameter.py
Created January 12, 2021 19:45
Calculate minimum and maximum feret diameters for connected components in label images in python
# Volker Hilsenstein
# BSD-3 license
import numpy as np
import skimage.morphology
from rotating_calipers import min_max_feret
def get_min_max_feret_from_labelim(label_im, labels=None):
""" given a label image, calculate the oriented
bounding box of each connected component with
@soxofaan
soxofaan / README.md
Last active January 19, 2024 17:48
Simple pretty CSV and TSV file viewer.
@jaydenseric
jaydenseric / ffmpeg-web-video-guide.md
Last active February 17, 2024 23:49
A quick guide to using FFmpeg to create cross-device web videos.

Video conversion with FFmpeg

Install

On mac:

  1. Download the latest release.
  2. Extract the binary and place it in /usr/local/bin.

Command basics

@isaacs
isaacs / node-and-npm-in-30-seconds.sh
Last active March 8, 2024 02:11
Use one of these techniques to install node and npm without having to sudo. Discussed in more detail at http://joyeur.com/2010/12/10/installing-node-and-npm/ Note: npm >=0.3 is *safer* when using sudo.
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
mkdir ~/local
mkdir ~/node-latest-install
cd ~/node-latest-install
curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1
./configure --prefix=~/local
make install # ok, fine, this step probably takes more than 30 seconds...
curl https://www.npmjs.org/install.sh | sh
@pmeinhardt
pmeinhardt / download-site.md
Created October 10, 2013 17:12
download an entire page (including css, js, images) for offline-reading, archiving… using wget

If you ever need to download an entire website, perhaps for off-line viewing, wget can do the job — for example:

$ wget --recursive --no-clobber --page-requisites --html-extension --convert-links --restrict-file-names=windows --domains website.org --no-parent  www.website.org/tutorials/html/

This command downloads the website www.website.org/tutorials/html/.

The options are:

  • --recursive: download the entire website
  • --domains website.org: don't follow links outside website.org
@XVilka
XVilka / TrueColour.md
Last active April 8, 2024 14:02
True Colour (16 million colours) support in various terminal applications and terminals

THIS GIST WAS MOVED TO TERMSTANDARD/COLORS REPOSITORY.

PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!