Skip to content

Instantly share code, notes, and snippets.

@svcavallar
svcavallar / python_environment_setup.md
Last active December 8, 2020 23:08 — forked from Geoyi/python_environment_setup.md
Setting up your python development environment (with pyenv, virtualenv, and virtualenvwrapper)

Overview

When you're working on multiple coding projects, you might want a couple different version of Python and/or modules installed. That way you can keep each project in its own sandbox instead of trying to juggle multiple projects (each with different dependencies) on your system's version of Python. This intermediate guide covers one way to handle multiple Python versions and Python environments on your own (i.e., without a package manager like conda). See the Using the workflow section to view the end result.

Use cases

  1. Working on 2+ projects that each have their own dependencies; e.g., a Python 2.7 project and a Python 3.6 project, or developing a module that needs to work across multiple versions of Python. It's not reasonable to uninstall/reinstall modules every time you want to switch environments.
  2. If you want to execute code on the cloud, you can set up a Python environment that mirrors the relevant
@svcavallar
svcavallar / n900_dev_reflash_instructions.md
Last active May 18, 2023 08:25
Nokia N900 Device Development & Flashing
@svcavallar
svcavallar / rpi_opencv_install.sh
Last active September 20, 2020 16:09
Raspberry Pi OpenCV install script
echo "Maintain and update the distro"
sudo apt-get -y update
sudo apt-get -y upgrade
sudo rpi-update -y
echo "Install developer tools"
sudo apt-get install -y build-essential cmake pkg-config
echo "Install image I/O packages"
sudo apt-get install -y libjpeg8-dev libtiff4-dev libjasper-dev libpng12-dev
@svcavallar
svcavallar / howto-patch-paper-dialog.md
Created March 20, 2017 21:45
How to patch Polymer paper-dialog so appears in-front of its backdrop

This howto is especially for when using a custom modal paper-dialog that is not within the <body> element - for example within a custom page element.

Add the following to your custom element:

// https://github.com/PolymerElements/paper-dialog/issues/7
patchOverlay: function (e) {
  if (e.target.withBackdrop) {
    e.target.parentNode.insertBefore(e.target.backdropElement, e.target);
 }
@svcavallar
svcavallar / rabbitmq_reconnect.go
Created September 20, 2016 22:23
Golang example to reconnect to RabbitMQ on a connection closed event
package main
import (
"flag"
"github.com/streadway/amqp"
"log"
"time"
)
var amqpUri = flag.String("r", "amqp://guest:guest@127.0.0.1/", "RabbitMQ URI")