Skip to content

Instantly share code, notes, and snippets.

View danieltomasz's full-sized avatar

Daniel Borek danieltomasz

View GitHub Profile
@danieltomasz
danieltomasz / jupyter_markdown_citations.md
Created June 19, 2018 15:41
making .bib references in jupyter notebook

Formatted Reference Links for Jupyter Notebooks based on .bib Files

Installation

This requires the bibtex-parser package also.

First, download the dependencies and package to the ~/.jupyter/custom location

@danieltomasz
danieltomasz / virtualenv
Created June 16, 2018 12:02
moving python virtualenv
$ cd ~/first
$ virtualenv my-venv
$ grep 'VIRTUAL_ENV=' my-venv/bin/activate
VIRTUAL_ENV="/home/username/first/my-venv"
$ virtualenv --relocatable my-venv
Making script my-venv/bin/easy_install relative
Making script my-venv/bin/easy_install-2.7 relative
Making script my-venv/bin/pip relative
Making script my-venv/bin/pip2 relative
Making script my-venv/bin/pip2.7 relative
@danieltomasz
danieltomasz / shelllcommands.md
Last active June 19, 2018 16:56
bash shortcuts
cd - # go to previuos directory
pushd level-1/level-2
# do work ...
popd 
# now we're back to the directory we started in
@danieltomasz
danieltomasz / subfolder-git
Created June 15, 2018 21:46
pull only subfolder from git repository
```
git init <repo>
cd <repo>
git remote add -f origin <url>
git config core.sparseCheckout true
echo "some/dir/" >> .git/info/sparse-checkout
echo "another/sub/tree" >> .git/info/sparse-checkout
````
@danieltomasz
danieltomasz / uninstallpackage.sh
Created June 15, 2018 21:33
Uninstall package with dependencies
for dep in $(pip show python-neutronclient | grep Requires | sed 's/Requires: //g; s/,//g') ; do sudo pip uninstall -y $dep ; done
pip uninstall -y python-neutronclient
Source: http://stackoverflow.com/a/32698209/4828478

Description

Use these commands to run a jupyter server on a remote server and access it locally in a browser. You must have SSH access to the browser. Use any port you want.

Do not forget to change username@server to the correct value!

TLDR

where using command
@danieltomasz
danieltomasz / vsconfig
Created June 15, 2018 10:42
vscode powerline font for terminal
# patched from nerdfonts https://github.com/ryanoasis/nerd-fonts
"terminal.integrated.fontFamily": "'RobotoMono Nerd Font'"
@danieltomasz
danieltomasz / dotfiles.sh
Last active March 1, 2021 22:44
dotfiles
git init --bare $HOME/.dotfiles
alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'
dotfiles config --local status.showUntrackedFiles no
echo "alias dotfiles='/usr/bin/git --git-dir=$HOME/.dotfiles/ --work-tree=$HOME'" >> $HOME/.bashrc
dotfiles status
dotfiles add .bashrc
dotfiles add .i3/config
dotfiles add .config/i3
dotfiles add .config/termite
@danieltomasz
danieltomasz / check.packages.r
Created June 5, 2018 14:27 — forked from smithdanielle/check.packages.r
Check if multiple R packages are installed. Install them if they are not,then load them into the R session.
# check.packages function: install and load multiple R packages.
# Check to see if packages are installed. Install them if they are not, then load them into the R session.
check.packages <- function(pkg){
new.pkg <- pkg[!(pkg %in% installed.packages()[, "Package"])]
if (length(new.pkg))
install.packages(new.pkg, dependencies = TRUE)
sapply(pkg, require, character.only = TRUE)
}
# Usage example
@danieltomasz
danieltomasz / Makefile
Created May 31, 2018 22:52 — forked from dogukancagatay/Makefile
Simple latex Makefile using latexmk
# Latex Makefile using latexmk
# Modified by Dogukan Cagatay <[email protected]>
# Originally from : http://tex.stackexchange.com/a/40759
#
# Change only the variable below to the name of the main tex file.
PROJNAME=main
# You want latexmk to *always* run, because make does not have all the info.
# Also, include non-file targets in .PHONY so they are run regardless of any
# file of the given name existing.