Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am Ivoz on github.
  • I am ivo (https://keybase.io/ivo) on keybase.
  • I have a public key whose fingerprint is 2F04 3DCC D6E6 D5AC D262 2E0B C046 E8A8 7452 2973

To claim this, I am signing this object:

#!/usr/bin/bash
# Reset
Reset='\[\e[0m\]'
# Regular Colors
Black='\[\e[0;30m\]'
Red='\[\e[0;31m\]'
Green='\[\e[0;32m\]'
Yellow='\[\e[0;33m\]'
#!/usr/bin/bash
# Reproduce namespace / editable install problem with pip
# https://github.com/pypa/pip/issues/3
# cleanup from previous invocations
foos=('foo-main' 'foo-client' 'foo-env')
rm -rf -- "${foos[@]}"
@Ivoz
Ivoz / screens.sh
Created May 26, 2014 11:05
Do xrandr stuff
#!/bin/bash
laptop_screen="LVDS1"
external_screen="HDMI1"
position="left"
if [[ ! -z "$1" ]]; then
external_screen="$1"
fi
@Ivoz
Ivoz / alias.sh
Last active September 14, 2015 01:21
My aliases
#!/usr/bin/sh
# cd
alias ..='cd ..'
alias ...='cd ../..'
alias ....='cd ../../..'
alias .....='cd ../../../..'
# common
alias cls='clear'
alias sctl='sudo systemctl'
@Ivoz
Ivoz / quine.py
Last active January 31, 2016 18:10
A self-checking python quine, of sorts
#!/usr/bin/env python3
'''
A "self-verifying" quine - `<quine> <source_file>` will only print itself
if `<quine>` has the same output as `cat <source_file>`
'''
source = r'''{foreword}
import sys, subprocess
if len(sys.argv) > 1:
@Ivoz
Ivoz / AddPythonToPath.py
Created July 20, 2020 04:49
If you are able to run python code, use this to add python to your path on windows
import sys
from pathlib import Path
# Get the path to the Scripts directory
scripts_path = Path(sys.base_prefix) / "Tools" / "Scripts"
# Append it to python's import path so we can grab it
sys.path.append(str(scripts_path))
# Import the main function from the win_add2path script
from win_add2path import main
# run the main function to add python to out path