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
#include <iostream> | |
#include <string> | |
namespace impl { | |
template <typename Fun> struct DeferredWrapper | |
{ | |
Fun f_; | |
DeferredWrapper(Fun &&f) : f_{std::forward<Fun>(f)} {} | |
~DeferredWrapper() { | |
f_(); |
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
#!/bin/bash | |
# i3 thread: https://faq.i3wm.org/question/150/how-to-launch-a-terminal-from-here/?answer=152#post-id-152 | |
CMD=gnome-terminal | |
CWD='' | |
# Get window ID | |
ID=$(xdpyinfo | grep focus | cut -f4 -d " ") | |
# Get PID of process whose window this is |
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
#!/bin/sh | |
if [ $# -ne 2 ]; then | |
echo "Usage:" | |
echo "dirsync <source> <target>" | |
fi | |
while inotifywait -r -e modify,create,delete "$1"; do | |
rsync -avz "$1" "$2" | |
done |
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
#!/bin/bash | |
# default zsh | |
#sudo chsh -s /bin/zsh pzelasko | |
# oh-my-zsh | |
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" | |
# syntax checker | |
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git "${HOME}/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting" |
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
%load_ext autoreload | |
%autoreload 2 | |
# conda install pandas numpy matplotlib jupyterlab | |
# pip install lhotse torch | |
from pathlib import Path | |
import matplotlib.pyplot as plt | |
import numpy as np |
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
#!/bin/bash | |
# Requires Python 3.6 virtualenv | |
source ~/venv36/bin/activate | |
# Java | |
sudo yum -y install java-1.8.0-openjdk-devel | |
# Build Esentials (minimal) | |
sudo yum -y install gcc gcc-c++ kernel-devel make automake autoconf swig git unzip libtool binutils |
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
#!/bin/bash | |
host="$1" | |
source_dir="$2" | |
target_dir="$3" | |
ssh "$host" ls "$source_dir" | parallel -j8 -v --sshdelay 0.2 rsync -raz --progress "$host":"$source_dir"/{} "$target_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
import logging | |
from sys import stdout | |
def fancy_logging(level=logging.DEBUG, stream=stdout): | |
logging.basicConfig( | |
level=level, | |
format="[%(asctime)s] %(levelname)s [%(name)s.%(funcName)s:%(lineno)d] %(message)s", | |
datefmt="%H:%M:%S", | |
stream=stream | |
) |
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
sed "/[[:punct:]]*/{ s/[^[:alnum:][:space:]'-]//g}" | tr '[:upper:]' '[:lower:]' | grep -v '[0-9]' |
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
import numpy as np | |
import panel as pn | |
pn.extension() | |
import holoviews as hv | |
hv.notebook_extension("bokeh") | |
# hv.extension('matplotlib') | |
from holoviews.streams import Stream, Params | |
from scipy.io import wavfile | |
from scipy.signal import spectrogram |
OlderNewer