Skip to content

Instantly share code, notes, and snippets.

@konfou
konfou / compile_MathLink_linux.sh
Last active February 8, 2023 17:58 — forked from xrq-phys/compile_MathLink_linux.sh
Compile Wolfram Engine Backend for TeXmacs on Linux (Nix)
@konfou
konfou / README.md
Created April 1, 2021 20:07
Fix gksqt error when plotting with Julia on NixOS

TL;DR Run julia-fix-gksqt.sh, then nix-shell julia-fix-gksqt.nix --run julia.

If you're running NixOS and trying to plot something in Julia you're probably getting the following error (where kon will and 9Vi4m may differ)

sh: /home/kon/.julia/packages/GR/9Vi4m/src/../deps/gr/bin/gksqt: No such file or directory
connect: Connection refused
GKS: can't connect to GKS socket application
number description authors status
0 Feature-based conditional expansion construct Marc Feeley final
1 List Library Olin Shivers final
2 AND-LET* Oleg Kiselyov final
3 List-Set Library Olin Shivers withdrawn
4 Homogeneous numeric vector datatypes Marc Feeley final
5 A compatible let form with signatures and rest arguments Andy Gaynor final
6 Basic String Ports William D Clinger final
7 Feature-based program configuration language Richard Kelsey final
@konfou
konfou / README.md
Last active March 21, 2021 17:03
fake sudo bash script
@konfou
konfou / .bash_profile.sh
Last active July 26, 2018 10:50 — forked from mrpoptart/.bash_profile.sh
Today, bash_profile based task logger
today() {
[[ -z "$*" ]] && < ~/.today || echo "$(date +'%F %T') $*" >> ~/.today
}
"""
@do begin
body
end when condition
Macro emulating a do-until construct.
"""
@eval macro $(:do)(body, when::Symbol, condition)
quote
while true
@konfou
konfou / script.js
Last active October 25, 2017 11:27 — forked from vielhuber/script.js
replace all occurences in a string without regex #js
String.prototype.replaceAll = function(foo, bar) {
return this.split(foo).join(bar);
};
@konfou
konfou / ascii.m
Last active October 25, 2017 11:15
display an ASCII chart (Octave)
chr = char(32:127)(:);
spc = ' ' * ones(length(chr), 1);
nms = num2str([32:127](:));
tab = [nms spc chr spc];
qti = reshape(tab',length(tab)/2,[])';
disp(qti)
@konfou
konfou / README.md
Last active July 2, 2020 18:43
play-with-mpv youtube-dl compatible sites

The following files have been adapted from ViewTube userscript 'protocol' [[1]] instructions. But I find no reason using such a complex script just for opening a video to mpv, so instead I opted out to using a bookmarklet. The files may be installed as follows:

user$ mkdir -p $HOME/.local/{bin,share/applications}
user$ cp notube.desktop $HOME/.local/share/applications/notube.desktop
user$ install -D -m 755 notube.sh $HOME/.local/bin/notube.sh
user$ xdg-mime default notube.desktop x-scheme-handler/notube
@konfou
konfou / lolbash.sh
Last active August 24, 2017 13:17 — forked from norova/lolbash.sh
gist interface doesn't allow me to paste so I post my edited version on https://gitlab.com/snippets/1672613
# LOL!!1
alias wtf='dmesg'
alias onoz='cat /var/log/errors.log'
alias rtfm='man'
alias visible='echo'
alias invisible='cat'
alias moar='more'
alias icanhas='mkdir'
alias donotwant='rm'
alias dowant='cp'