Skip to content

Instantly share code, notes, and snippets.

Avatar
🙃

Christian Himpe gramian

🙃
View GitHub Profile
@gramian
gramian / init.sh
Last active November 16, 2022 20:21
ArcadeDB initialization
View init.sh
#!/bin/bash
# Usage: ./init.sh localhost 2480 mydb root password myscript.sql
## Assign input commandline arguments
HOST=$1
PORT=$2
NAME=$3
USER=$4
@gramian
gramian / arcadedbsql-cheatsheet.md
Last active October 11, 2022 18:52
ArcadeDB SQL Cheat Sheet | build: pandoc arcadedb-cheatsheet.md -f markdown -o arcadedb-sql.pdf -V geometry:margin=1.5cm,landscape -V pagestyle=empty -V header-includes:"\hypersetup{colorlinks=false,allbordercolors={0 0 0},pdfborderstyle={/S/U/W 1}}"
View arcadedbsql-cheatsheet.md

ArcadeDB SQL Cheat Sheet

CRUD

INSERT INTO [TYPE:]<type>|BUCKET:<bucket>|INDEX:<index> [(<field>[,]*) VALUES (<expression>[,]*)[,]*]|
$~~~~~~~~~~~$[SET <field> = <expression>|<command>[,]*]|[CONTENT {<json>}] [RETURN <expression>] [FROM <query>]

SELECT [<projections>] [FROM <target> [LET <assignment>*]] [WHERE <condition>*] [GROUP BY <field>*] [ORDER BY <fields>* [ASC|DESC]*]
$~~~~~~~~~~~$[UNWIND *] [SKIP ] [LIMIT ] [TIMEOUT []]

@gramian
gramian / versioninfo.m
Created February 7, 2019 12:20
Clone of Julia's versioninfo for Octave and MATLAB on Linux
View versioninfo.m
function v = versioninfo()
%%% project: versioninfo (clone of Julia's versioninfo for Octave and MATLAB)
%%% version: 1.0 ( 2019-02-07 )
%%% authors: C. Himpe ( 0000-0003-2194-6754 )
%%% license: BSD 2-Clause License ( opensource.org/licenses/BSD-2-Clause )
%%% summary: Collect compute environment and version information on Linux
% Interpreter name
if(exist('OCTAVE_VERSION','builtin'))
v.name = 'OCTAVE';
@gramian
gramian / flamegraph.m
Last active July 28, 2021 18:01
Flame graph visualization for Octave's profiler output.
View flamegraph.m
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;
@gramian
gramian / build_oct.sh
Last active January 5, 2023 14:37
Build Octave and numerical dependencies from source in Ubuntu 20.04
View build_oct.sh
#!/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
@gramian
gramian / cropper
Created November 15, 2017 08:22
Convert all files in a directory from eps to pdf and crop the pdf to minimum area.
View cropper
#!/bin/sh
for i in *.eps; do
epspdf ${i}
done
for i in *.pdf; do
pdfcrop ${i} ${i}
done
@gramian
gramian / neotemp
Created March 28, 2017 18:35
Read CPU temperature of Nanopi Neo
View neotemp
#!/bin/sh
echo $((`cat /sys/class/thermal/thermal_zone0/temp` / 1000))
@gramian
gramian / texutils.tex
Created January 9, 2017 12:47
Useful TeX macros
View texutils.tex
\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
@gramian
gramian / ainv.m
Last active July 18, 2016 14:27
Approximate matrix inverse of quadratic complexity ( A⁻¹ ≈ D⁻¹ - D⁻¹ E D⁻¹ )
View ainv.m
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');
@gramian
gramian / hack4tex
Last active April 23, 2017 08:52
A small script to use the hack truetype font in pdflatex
View hack4tex
#!/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
#