This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class GooglonComparador: | |
def __init__(self, obj, *args): | |
self.obj = obj | |
self.ordem_dict = {} | |
for i, letra in enumerate('zmbtshjpnwlrcxkqvdgf'): | |
self.ordem_dict[letra] = i | |
# Menor que = Less than | |
def __lt__(self, other): | |
return self._comparar(self.obj, other.obj) < 0 | |
# Maior que = Greater than |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
listen: "0.0.0.0:8080" | |
host: http://10.0.2.15:8080 | |
debug: true | |
admin-team: admin | |
database: | |
url: 127.0.0.1:27017 | |
name: tsurudb | |
git: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Opening config file: /etc/tsuru/tsuru.conf | |
Done reading config file: /etc/tsuru/tsuru.conf | |
Using mongodb database "tsurudb" from the server "127.0.0.1:27017". | |
Using hipache router "10.0.2.15.nip.io" with redis at "localhost:6379". | |
Using "docker" provisioner. | |
Cluster Storage: Unable to connect to mongodb: no reachable servers (docker:cluster:mongo-url = "127.0.0.1:27017"; docker:cluster:mongo-database = "dockercluster") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Thu Jan 22 17:36:17.869 [initandlisten] MongoDB starting : pid=1098 port=27017 dbpath=/var/lib/mongodb 64-bit host=vagrant-ubuntu-trusty-64 | |
Thu Jan 22 17:36:17.869 [initandlisten] db version v2.4.9 | |
Thu Jan 22 17:36:17.869 [initandlisten] git version: nogitversion | |
Thu Jan 22 17:36:17.869 [initandlisten] build info: Linux orlo 3.2.0-58-generic #88-Ubuntu SMP Tue Dec 3 17:37:58 UTC 2013 x86_64 BOOST_LIB_VERSION=1_54 | |
Thu Jan 22 17:36:17.870 [initandlisten] allocator: tcmalloc | |
Thu Jan 22 17:36:17.870 [initandlisten] options: { bind_ip: "127.0.0.1", config: "/etc/mongodb.conf", dbpath: "/var/lib/mongodb", logappend: "true", logpath: "/var/log/mongodb/mongodb.log", nojournal: "true" } | |
Thu Jan 22 17:36:17.892 [initandlisten] exception in initAndListen: 10309 Unable to create/open lock file: /var/lib/mongodb/mongod.lock errno:13 Permission denied Is a mongod instance already running?, terminating | |
Thu Jan 22 17:36:17.892 dbexit: | |
Thu Jan 22 17:36:17.892 [initandlisten] shutdown: going to close listening sockets... | |
Thu J |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from unittest import TestCase | |
from mock import patch, Mock | |
from matriz import Matriz | |
class MatrizTest(TestCase): | |
@patch('matriz.Matriz.inicializar_matriz') | |
def test_intancia_matriz(self, method): | |
method.return_value = 'matriz' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from django.conf import settings | |
settings.configure( # configure | |
DEBUG=True, | |
SECRET_KEY='thisisthesecretkey', | |
ROOT_URLCONF=__name__, | |
MIDDLEWARE_CLASSES=( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a = 2 | |
function incrementar () { | |
for (b = 1; b < 100000000; b++) { | |
b += b | |
} | |
a += 1 // valores são passados por cópia e não referência | |
} | |
incrementar() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# System Update | |
apt-get update | |
# Pre requisites Packages | |
apt-get install -y build-essential | |
apt-get install -y git | |
# Development Packages | |
apt-get install -y python3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib | |
from StringIO import StringIO | |
from django import forms | |
from django.core.files import File | |
from formexemplo.models import Pessoa | |
class PessoaModelForm(forms.ModelForm): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const produtos = [ | |
{ | |
nome: 'Bicicleta', | |
preco: 1200.0 | |
}, | |
{ | |
nome: 'Capacete', | |
preco: 450.0 | |
} | |
] |
OlderNewer