This file contains hidden or 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
| # -*- coding: utf8 -*- | |
| import requests | |
| uft_conecta = {'auth_user': 'MEU_USUARIO', | |
| 'auth_pass': 'MINHA_SENHA', | |
| 'redirurl': 'http://www.google.com.br/', | |
| 'accept': 'Continue'} | |
| r = requests.post("https://ww2.uftconecta.uft.edu.br:8001/", data=uft_conecta, verify=False) |
This file contains hidden or 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 django.db import models | |
| #Imagem referencia somente 1 imovel | |
| class Imagem(models.Model): | |
| descricao = models.CharField(max_length=200) | |
| imagem = models.ImageField(upload_to='imagens') | |
| #Imovel possio 0 ou n imagens | |
| # | |
| # |
This file contains hidden or 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 os | |
| import subprocess | |
| from tempfile import NamedTemporaryFile | |
| import tempfile | |
| from django.conf import settings | |
| from django.http import HttpResponse | |
| from django.template import loader, Context | |
| #https://code.google.com/p/wkhtmltopdf/downloads/list | |
This file contains hidden or 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
| public class helloJava { | |
| public static void main(String [] args){ | |
| System.out.println("Hadouken!!!!"); | |
| } | |
| } | |
This file contains hidden or 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
| #!/bin/bash | |
| #max=$# | |
| FILE="$1" | |
| type pygmentize >/dev/null 2>&1 || { | |
| echo >&2 "pygments não encontrado. Por favor, instale-o. | |
| "; exit 1; | |
| } |
This file contains hidden or 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
| # O select você faz normal usando o 'using' para indicar a database específica | |
| # algo como: Usuario.objects.using('database_test') | |
| from django import forms | |
| # ... | |
| class UsuarioForm(forms.ModelForm): | |
| def __init__(self, *args, **kwargs): | |
| super(ContentForm, self).__init__(*args, **kwargs) | |
| self.fields["user"].queryset = Usuario.objects.using('database_test') |
This file contains hidden or 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 java.io.*; | |
| class FileReaderDemo { | |
| public static void main(String args[]) throws Exception { | |
| FileReader filereader = new FileReader("FileReaderDemo.java"); | |
| BufferedReader bufferedReader = new BufferedReader(filereader); | |
| String s; | |
| while((s = bufferedReader.readLine()) != null) { | |
| System.out.println(s); | |
| } | |
| filereader.close(); |
This file contains hidden or 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
| DATABASES = { | |
| 'default': { | |
| 'ENGINE': 'django.db.backends.postgresql_psycopg2', | |
| 'NAME': 'nome_do_seu_banco', | |
| 'USER': 'postgres', # ou troque pelo usuario que vc criou | |
| 'PASSWORD': 'sua_senha', | |
| 'HOST': '127.0.0.1', | |
| 'PORT': '5432', | |
| } | |
| } |
This file contains hidden or 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
| libv4l2: error turning on stream: Input/output error | |
| ######## | |
| oficina@oficina:~$ cheese | |
| (cheese:5086): Clutter-WARNING **: Whoever translated default:LTR did so wrongly. |
This file contains hidden or 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
| #!/bin/bash | |
| # Criado por Fabio C. Barrioneuvo da Luz | |
| # Facilitador de instalação e configuração do Oracle Instant Client | |
| # | |
| # Baixe um dos arquivos abaixo, conforme o seu sistema operacional linux. | |
| # | |
| # Oracle Instant Client 32Bits: http://www.oracle.com/technetwork/topics/linuxsoft-082809.html | |
| # Oracle Instant Client 64Bits: http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html | |
| # | |
| # Baixe o arquivo em Instant Client Package - Basic: |