Get boot2docker working with nfs instead of vboxsf.
Tested on:
- Boot2Docker-cli version: v1.6.0
Git commit: 9894ae9
- Boot2Docker-cli version: v1.6.2
Git commit: cb2c3bc
#!/bin/bash | |
VENV=$1 | |
if [ -z $VENV ]; then | |
echo "usage: runinenv [virtualenv_path] CMDS" | |
exit 1 | |
fi | |
. ${VENV}/bin/activate | |
if [ -f ${VENV}/bin/postactivate ]; then | |
. ${VENV}/bin/postactivate |
PREFIX=projectA #adjust this | |
TAB=$'\t' | |
git filter-branch --index-filter ' | |
git ls-files -s | | |
sed "s,${TAB},&"$PREFIX"/," | | |
GIT_INDEX_FILE=$GIT_INDEX_FILE.new git update-index --index-info && | |
mv $GIT_INDEX_FILE.new $GIT_INDEX_FILE | |
' HEAD |
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
" Plugins begin | |
call vundle#begin() | |
Plugin 'gmarik/Vundle.vim' | |
Plugin 'tpope/vim-fugitive' |
# subcommunities.py | |
import sys | |
sys.modules['__main__'].__dict__.update({ | |
'PyCon': type('PyCon', (object,), {}), | |
'numpy': type('numpy', (object,), {'infty': 'foo'}), | |
'pythonistas': type('Foo', (object,), {'enjoy': lambda x: x, 'fun': 'foo'}) | |
}) | |
sys.modules['subcommunities'] = list() | |
sys.modules['numpy.nifty'] = 'foo' |
import time | |
import random | |
# fill the input list | |
a = [random.randrange(0,130) for x in range(10**6)] | |
# std sort, keep a unsorted | |
t = time.time() | |
b = sorted(a) | |
print(time.time() - t) |
Get boot2docker working with nfs instead of vboxsf.
Tested on:
- Boot2Docker-cli version: v1.6.0
Git commit: 9894ae9
- Boot2Docker-cli version: v1.6.2
Git commit: cb2c3bc
from PyQt4 import uic | |
from PyQt4.QtCore import pyqtWrapperType | |
UI_DIR='path_to_ui_files' | |
class WindowMeta (pyqtWrapperType, type): | |
"""This is the metaclass of all Qt-Windows. It automatically | |
sets the correct base classes, so they do not have to be set | |
by the programmer. | |
@attention: The class has to have the same name as the .ui-file. |
def mixIn (base, addition): | |
"""Mixes in place, i.e. the base class is modified. | |
Tags the class with a list of names of mixed members. | |
""" | |
assert not hasattr(base, '_mixed_') | |
mixed = [] | |
for item, val in addition.__dict__.items(): | |
if not hasattr(base, item): | |
setattr(base, item, val) |
# Per funzionare il programma ha bisogno della libreria pygame | |
# | |
# Le istruzioni per installare pygame sono a questo indirizzo: | |
# http://pygame.org/download.shtml | |
# | |
import pygame, random | |
pygame.init() | |
random.seed() | |
screen = pygame.display.set_mode((400, 400)) |
# -*- coding: utf-8 -*- | |
from django.db import models | |
from django.core.serializers.json import DjangoJSONEncoder | |
from django.utils import simplejson as json | |
class JSONField(models.TextField): | |
""" | |
JSONField is a generic textfield that neatly serializes/unserializes | |
JSON objects seamlessly. | |
Django snippet #1478 |