Skip to content

Instantly share code, notes, and snippets.

@technic
technic / .bashrc
Last active October 25, 2019 10:04
Powershell profile
# ssh-agent
check-ssh-agent() {
test -S "$SSH_AUTH_SOCK" && {
ssh-add -l >& /dev/null
if [ $? -ne 2 ]; then
echo "ssh-agent is already running ($SSH_AUTH_SOCK)"
true
else
false
fi
@technic
technic / README.md
Last active September 19, 2019 06:40
Fast rust implementation for https://habr.com/ru/post/450512, reference C++ and Go implementations also present
@technic
technic / set-tags-magic.ipynb
Created February 8, 2019 12:32
jupyter magic to manipulate notebook tags
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@technic
technic / Vagrantfile
Created January 31, 2019 14:26
for yocto oe
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# Based on Ubuntu 16.04
config.vm.box = "ubuntu/xenial32"
config.vm.provider "virtualbox" do |vb|
# Customize VirtualBox machine
@technic
technic / lighten_color.py
Created January 30, 2019 16:32 — forked from ihincks/lighten_color.py
Function to lighten any color in matplotlib
def lighten_color(color, amount=0.5):
"""
Lightens the given color by multiplying (1-luminosity) by the given amount.
Input can be matplotlib color string, hex string, or RGB tuple.
Examples:
>> lighten_color('g', 0.3)
>> lighten_color('#F034A3', 0.6)
>> lighten_color((.3,.55,.1), 0.5)
"""
@technic
technic / mkl.py
Created January 24, 2019 16:09
MKL_NUM_THREADS python context manager
import ctypes
class MKLThreads(object):
_mkl_rt = None
@classmethod
def _mkl(cls):
if cls._mkl_rt is None:
try:
@technic
technic / custom.css
Created January 10, 2019 22:35 — forked from felixlaumon/custom.css
My iPython / Jupyter notebook custom styling
@import url('http://fonts.googleapis.com/css?family=Crimson+Text');
@import url('http://fonts.googleapis.com/css?family=Source+Code+Pro');
/* Change code font */
.CodeMirror pre {
font-family: 'Input Mono Narrow', 'Source Code Pro', Consolas, monocco, monospace;
}
div.input_area {
border-color: rgba(0,0,0,0.10);
@technic
technic / alias.sh
Created December 3, 2018 15:54
Git aliases
alias gd='git diff'
alias gst='git status'
alias gc='git commit -v'
alias ga='git add'
alias gb='git branch'
alias gds='git diff --staged'
alias gp='git push'
alias gup='git pull --rebase'
alias gupa='git pull --rabase --autostash'
alias gco='git checkout'
@technic
technic / README.md
Created October 17, 2018 09:59
Increase margin/border in LyX editor area.

Go to Document -> Settings -> Local layout and enter something like

LeftMargin MM
RightMargin MM

Done! Thx to this forum topic

@technic
technic / .gitignore
Last active July 12, 2018 12:10
Jupyter notebook cheat sheat
*.aux
*.log
*.out
*.tex