Skip to content

Instantly share code, notes, and snippets.

View igr-santos's full-sized avatar

Igor dos Santos igr-santos

  • Belo Horizonte - MG
View GitHub Profile
@igr-santos
igr-santos / mongo_manager.py
Last active August 29, 2015 14:03
Object used to support the construction and manipulation of a MongoDB aggregation
#!/usr/bin/env python
from pymongo import MongoClient
from datetime import datetime
class Cache(object):
def __init__(self, cached):
self.date = datetime.today()
self.cached = cached
@igr-santos
igr-santos / example_pymongo.py
Created June 26, 2014 18:56
Sample handling MongoDB with Python
from pymongo import MongoClient
# Connect client MongoDB and database
client = MongoClient()
database = client['database_name']
# or
database = MongoClient().database_name
function ReportChart(url) {
this.url = url;
}
ReportChart.prototype.getChart = function() {
$.get(
this.url,
function(result) {
chart = result['chart'];
data = result['data'];
@igr-santos
igr-santos / Preferences.sublime-settings
Created June 10, 2014 20:47
Configuration SublimeText 3 (Perv Orange)
{
"always_show_minimap_viewport": true,
"bold_folder_labels": true,
"color_scheme": "Packages/User/Perv Orange Moonlight (SL).tmTheme",
"draw_minimap_border": true,
"enable_telemetry": false,
"ensure_newline_at_eof_on_save": true,
"folder_exclude_patterns":
[
".svn",
@igr-santos
igr-santos / virtualenvwrapper.md
Last active August 29, 2015 13:58
Organizing the development environment with Virtualenvwrapper
  1. Com o pip instalado, digite o seguinte comando no terminal:

pip install virtualenvwrapper

  1. Agora é necessário uma pasta onde ficaram armazenados seus ambientes e os seus projetos:

mkdir ~/.Envs [Criando uma pasta oculta Envs na pasta pessoal do usuário]

mkdir ~/Projects [Criando uma pasta comum Projects na pasta pessoal do usuário]