git clone <repo>
clone the repository specified by ; this is similar to "checkout" in some other version control systems such as Subversion and CVS
Add colors to your ~/.gitconfig file:
#include <stdio.h> | |
#include <stdlib.h> | |
#include <ctype.h> | |
#include <unistd.h> | |
int main (int argc, char *argv[]) | |
{ | |
int opcao; // Opção passada pelo usuário ao programa. | |
int indice; // Usado para pegar argumentos que não são opções | |
// Nem argumentos usados em opções. |
from django.contrib import admin | |
class ReadOnlyModelAdmin(admin.ModelAdmin): | |
""" | |
ModelAdmin class that prevents modifications through the admin. | |
The changelist and the detail view work, but a 403 is returned | |
if one actually tries to edit an object. |
from cProfile import Profile | |
from django.core.management.base import BaseCommand | |
class ProfileEnabledBaseCommand(BaseCommand): | |
"""Enable profiling a command with --profile. | |
Requires child class to define _handle instead of handle. | |
via https://gist.github.com/dfrankow | |
""" |
/* | |
In the node.js intro tutorial (http://nodejs.org/), they show a basic tcp | |
server, but for some reason omit a client connecting to it. I added an | |
example at the bottom. | |
Save the following server in example.js: | |
*/ | |
var net = require('net'); |
Suppose you have, by mistake, added your IDE's project folder (you know, these .idea
folders with all kinds of local paths and configuration data and settings in it) to the Git repository of your project. (We're talking about a whole folder here, but the same rules apply to individual files as well.)
Of course, you only realize that two days after the fact and have already pushed it, and your colleagues have already pulled it. They use the same IDE as you do, so whenever they change a setting or fix paths, they can either
# to generate your dhparam.pem file, run in the terminal | |
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
from abc import ABCMeta, abstractmethod | |
class AbstractModelMeta(ABCMeta, type(models.Model)): | |
pass | |
class ABCModel(models.Model): | |
__metaclass__ = AbstractModelMeta | |
class Meta: |
# Retorna dados sobre o pregão | |
http://www.bmfbovespa.com.br/Pregao-Online/ExecutaAcaoCarregarDados.asp?CodDado=IBOV,ticker&CA=undefined | |
# Retorna ações e seus últimos valores negociados | |
http://www.bmfbovespa.com.br/Pregao-OnLine/ExecutaAcaoCarregarDados.asp?CodDado=Ticker | |
# Retorna o histórico do dia de um papel | |
http://www.bmfbovespa.com.br/Pregao-Online/ExecutaAcaoCarregarDadosPapeis.asp?CodDado=petr4 | |
# Retorna dados de um papel |