Skip to content

Instantly share code, notes, and snippets.

View jfunez's full-sized avatar

Juan Funez jfunez

  • iib-institut.de
  • Berlin, Germany
View GitHub Profile

#MongoDB - Setting up a Replica Set

cd \mongodbdir\

mkdir db1
mkdir db2
mkdir db3

###Primary mongod --dbpath ./db1 --port 30000 --replSet "demo"

@jfunez
jfunez / 0_reuse_code.js
Created February 11, 2016 12:48
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@jfunez
jfunez / setup.py
Created December 1, 2015 18:01 — forked from rochacbruno/Makefile
Perfect setup.py
import pip
try:
from setuptools import setup, find_packages
except ImportError:
from distutils.core import setup, find_packages
links = [] # for repo urls (dependency_links)
requires = [] # for package names
from os.path import splitext
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _
from django.template.defaultfilters import filesizeformat
class FileValidator(object):
"""
Validator for files, checking the size, extension and mimetype.
import base64
import os
from tastypie.fields import FileField
from django.core.files.uploadedfile import SimpleUploadedFile
class Base64FileField(FileField):
"""
A django-tastypie field for handling file-uploads through raw post data.
It uses base64 for en-/decoding the contents of the file.
Usage: