Skip to content

Instantly share code, notes, and snippets.

Using Pyenv with virtualenv ( Ubuntu / Linux. Sorry Windows :-( )

This is a little guide to installing pyenv with virtualenv so that you never again need to worry about whether you your version of Python and pip packages are working. Pyenv is like virtualenv except that it lets you install any version of Python and then by using the pyenv plugin for virtualenv it is possible to create a box with the Python version you want plus all the packages you need.

Installing Pyenv

Run the command below to git checkout pyenv to your home directory

git clone https://github.com/pyenv/pyenv.git ~/.pyenv

Keybase proof

I hereby claim:

  • I am rollick on github.
  • I am rollick (https://keybase.io/rollick) on keybase.
  • I have a public key ASDmCFIgmDBukrMiaVWUJltkamqRhQASyZLWpVnRWMOLdAo

To claim this, I am signing this object:

@rollick
rollick / PG::Error: ERROR: new encoding (UTF8) is incompatible
Created September 15, 2016 11:59 — forked from amolkhanorkar/PG::Error: ERROR: new encoding (UTF8) is incompatible
Postgres PG::Error: ERROR: new encoding (UTF8) is incompatible
======= Prolbem =================================================================================================================
I have installed : ruby-2.0.0,postgres-9.2 , now in rails app when I execute:
rake db:create , command I get:
PG::InvalidParameterValue: ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)
HINT: Use the same encoding as in the template database, or use template0 as template.
: CREATE DATABASE "my_db_name" ENCODING = 'unicode'.......
bin/rake:16:in `load'
#!/bin/bash
SAUCE_TMP_DIR="$(mktemp -d)"
cd $SAUCE_TMP_DIR
SC_ZIP=Sauce-Connect-latest.zip
SC_READYFILE=sauce-connect-ready
SC_LOGFILE=$HOME/sauce-connect.log
echo "Downloading Sauce Connect"
.bar {fill: #1D8300;}
.label {fill: #FFF; font-size:10px; font-family:sans-serif;}
fieldset {margin-bottom:20px}
@rollick
rollick / gist:7416944
Last active December 28, 2015 00:59
Routes and Templates
Object.keys(App.Router.router.recognizer.names).forEach( function (name) {
var resolver = Ember.DefaultResolver.create(),
routeName = 'route:' + name,
parsedName = resolver.parseName(routeName),
found = typeof resolver.resolveTemplate(parsedName) == 'function' ? ' - Found!' : '',
templateName = parsedName.fullNameWithoutType.replace(/\./g, '/'),
camelizeName = Ember.String.decamelize(templateName);
console.log(routeName + ' => ' + templateName + ( camelizeName != templateName ? ' / ' + camelizeName : '' ) + found );
});
@rollick
rollick / gist:3695704
Created September 11, 2012 03:19
Remove branches already in master
git checkout master
git fetch
git remote prune origin
git branch -r --merged |
grep origin |
grep -v '>' |
grep -v master |
xargs -L1 |
cut -c8- |
Gem::Specification.new do |s|
s.name = "feature_tour_repository"
s.version = "0.8.1"
s.platform = "ruby"
s.authors = ["Glenn Tweedie", "Mark Gallop", "Agworld"]
s.email = ["glenn.tweedie@agworld.com.au"]
s.homepage = "http://agworld.com.au"
s.summary = "Le Tour d'Agworld"
s.description = "Feature Tour Repository"
s.required_rubygems_version = ">= 1.3.6"
@rollick
rollick / po2json.js
Created May 10, 2012 14:54 — forked from zaach/po2json.js
PO parser from http://jsgettext.berlios.de/lib/Gettext.js adapted for Node.js and modified to be more like po2json.pl
#!/usr/bin/env node
/*
PO parser from http://jsgettext.berlios.de/lib/Gettext.js
adapted for Node.js and modified to be more like po2json.pl
- Zach Carter <zcarter@cse.usf.edu>
*/
/*
Pure Javascript implementation of Uniforum message translation.
module PaperclipMigrations
def self.included(base)
base.extend ClassMethods
end
module ClassMethods
def add_paperclip_fields(table, prefix)
add_column table, "#{prefix}_file_name", :string
add_column table, "#{prefix}_content_type", :string