command | description |
---|---|
ctrl + a | Goto BEGINNING of command line |
This file contains 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
#!/usr/bin/env python3 | |
import sys | |
from datetime import datetime | |
import webbrowser | |
MONTHS = { | |
1: 'januar', | |
2: 'februar', | |
3: 'marcius', |
This file contains 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
/* Lorenz system animation | |
* $ cc -Ofast lorenz.c -lm | |
* $ ./a.out | mpv --no-correct-pts --fps=60 --fs - | |
* $ ./a.out | x264 --fps 60 --frames 3600 -o lorenz.mp4 /dev/stdin | |
* This is free and unencumbered software released into the public domain. | |
* Ref: https://nullprogram.com/blog/2017/11/03/ | |
* Ref: https://nullprogram.com/blog/2018/02/15/ | |
*/ | |
#include <math.h> | |
#include <stdio.h> |
This file contains 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
{ | |
"alap": { | |
"prefix": "alap", | |
"body": [ | |
"#!/usr/bin/env julia", | |
"", | |
"function main()", | |
" println(\"hello$0\")", | |
"end", | |
"", |
This file contains 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
# aliases for the video https://www.youtube.com/watch?v=ETLb4moY4Rc | |
alias venv_init="python3 -m venv .venv" | |
alias venv_freeze="pip freeze --local" | |
alias on="deactivate 2>/dev/null; source .venv/bin/activate" | |
# alias on="source .venv/bin/activate" | |
alias off="deactivate" |
This file contains 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
{ | |
"files.eol": "\n", | |
"editor.codeLens": false, | |
"workbench.colorTheme": "Default Light+", | |
"workbench.colorCustomizations": { | |
"editor.background": "#fcf5e3", | |
"sideBar.background": "#f9edcd", | |
// "editor.lineHighlightBackground": "#e9f2fa", | |
"editor.lineHighlightBackground": "#efefef", | |
// "editor.lineHighlightBorder": "#9292ac" |
This file contains 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
#!/usr/bin/env python3 | |
import sympy | |
from sympy.parsing.sympy_parser import parse_expr | |
def main(): | |
text = "(4 + (2 * (x - 3))) / 4 = 150" | |
equation = "(4 + (2 * (x - 3))) / 4 - 150" | |
p = parse_expr(equation) |
This file contains 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
# these work in both Bash and ZSH | |
alias md="mkdir" | |
alias ..="cd .." | |
alias ...="cd ../.." | |
mdgo () { | |
if [[ -z "$1" ]] | |
then | |
echo "Usage: mdgo <dir>" |
This file contains 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
// https://en.wikipedia.org/wiki/Graph_(discrete_mathematics) | |
digraph D { | |
graph [concentrate=true]; | |
layout=neato; | |
// rankdir=LR; | |
edge [dir=none]; | |
6 -> 4 -> 5; | |
4 -> {6 3 5}; |
This file contains 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
# Add the following lines to the end of your ~/.bashrc file: | |
alias top10dirs='(du -h --max-depth=1) 2> /dev/null | sort -hr | head -n 10' | |
alias top10files='find . -type f -print0 | du -h --files0-from=- | sort -hr | head -n 10' |