This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% Math %% | |
si = @(x) sin(x) ./ (x + (x==0)); % cardinal sine without pi multiplied argument | |
hsin = @(x) 0.5 * (1.0 - cos(x)); % haversed sine | |
hcos = @(x) 0.5 * (1.0 + cos(x)); % haversed cosine | |
sigm = @(x,k) 0.5 * tanh(0.5 * k * x) + 0.5; % sigmoid function to (exp(-kx)+1)^-1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function m = antijet(n) | |
% antijet colormap | |
% by Christian Himpe 2014 | |
% released under BSD 2-Clause License ( opensource.org/licenses/BSD-2-Clause ) | |
if(nargin<1 || isempty(n)), n = 256; end; | |
L = linspace(0,1,n); | |
R = -0.5*sin( L*(1.37*pi)+0.13*pi )+0.5; | |
G = -0.4*cos( L*(1.5*pi) )+0.4; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HISTIGNORE='git *' | |
alias cd..='cd ..' | |
alias uncommit='git reset --soft HEAD~' | |
alias forcepull='git fetch --all && git reset --hard origin/master' | |
alias oct='octave-cli' | |
alias mem='/usr/bin/time -f "%M KB"' | |
alias nano='nano -c -S' | |
alias ls='ls -la' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function x = ainv(m) | |
% ainv - approximate inverse | |
% by Christian Himpe 2016 | |
% released under BSD 2-Clause License ( opensource.org/licenses/BSD-2-Clause ) | |
d = diag(m); | |
d(d~=0) = 1.0./d(d~=0); | |
n = numel(d); | |
x = bsxfun(@times,m,-d); | |
x = bsxfun(@times,x,d'); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\usepackage{adjustbox} % \ftitle | |
\usepackage{bbold} % for \1 | |
% Text | |
%% Identifiers | |
\newcommand*{\doi}[1]{DOI \href{http://doi.org/#1}{\texttt{#1}}} % doi command | |
\newcommand*{\isbn}[1]{ISBN \href{http://www.worldcat.org/search?q=#1}{\texttt{#1}}} % isbn command | |
%% Colors |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo $((`cat /sys/class/thermal/thermal_zone0/temp` / 1000)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
for i in *.eps; do | |
epspdf ${i} | |
done | |
for i in *.pdf; do | |
pdfcrop ${i} ${i} | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# project: build_oct | |
# version: 1.12 (2023-01-01) | |
# authors: C. Himpe (0000-0003-2194-6754), M. Koehler (0000-0003-2338-9904) | |
# license: BSD-2-Clause License (opensource.org/licenses/BSD-2-Clause) | |
# summary: Build Octave and numerical dependencies from source (in Ubuntu 20.04 with GCC >= 10.3). | |
# requires hardware: either X86-64 with AVX2 or ARM64 with NEON. | |
# requires software packages: octave libpcre2-dev libreadline-dev libgmp3-dev libmpfr-dev libfreetype6-dev libgl2ps-dev libfontconfig1-dev libglu1-mesa-dev |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function flamegraph(profdata) | |
### project: flamegraph | |
### authors: Christian Himpe (0000-0003-2194-6754) | |
### version: 0.3 (2021-02-06) | |
### license: BSD-2-Clause (opensource.org/licenses/BSD-2-Clause) | |
### summary: Flame graph visualization for Octave's profiler output. | |
# | |
# USAGE: | |
# | |
# profile on; |
OlderNewer