Pattern file: /etc/logstash/patterns/nginx
Logstash shipper: /etc/logstash/conf.d/shipper.conf
Nginx http log module: http://nginx.org/en/docs/http/ngx_http_log_module.html
import React, { Component } from 'react'; | |
import cytoscape from 'cytoscape'; | |
import cydagre from 'cytoscape-dagre'; | |
cydagre(cytoscape); | |
let cyStyle = { | |
height: '400px', | |
display: 'block' | |
}; |
Pattern file: /etc/logstash/patterns/nginx
Logstash shipper: /etc/logstash/conf.d/shipper.conf
Nginx http log module: http://nginx.org/en/docs/http/ngx_http_log_module.html
import React, { Component } from 'react' | |
import { Redirect } from 'react-router' | |
export default class ContactForm extends Component { | |
constructor () { | |
super(); | |
this.state = { | |
fireRedirect: false | |
} | |
} |
#!/bin/sh | |
# coloque esse arquivo dentro da pasta .git/hooks/ no seu projeto | |
# e de permissao de execucao com: | |
# chmod +x .git/hooks/pre-commit | |
# | |
# funciona somente com django 1.8 | |
# necessita de algumas pequenas modificacoes para funcionar com django 1.10 | |
exec 1>&2 |
import React, { Component } from 'react'; | |
import TextField from 'components/base/TextField'; | |
const WAIT_INTERVAL = 1000; | |
const ENTER_KEY = 13; | |
export default class TextSearch extends Component { | |
constructor(props) { | |
super(); |
import unicodedata | |
import re | |
""" | |
A remoção de acentos foi baseada em uma resposta no Stack Overflow. | |
http://stackoverflow.com/a/517974/3464573 | |
""" | |
def removerAcentosECaracteresEspeciais(palavra): |
def monkeypatch_queryset_first(): | |
""" Monkeypatch QuerySet adding a `.first()` method which is compatible | |
with Django 1.6's `.first()`. """ | |
from django.db.models.query import QuerySet | |
if hasattr(QuerySet, "first"): | |
import warnings | |
warnings.warn("QuerySet.first is already defined! " | |
"Monkey patch should be removed.") | |
return | |
def first(self): |
* { | |
margin: 0; | |
padding: 0; | |
box-sizing: border-box; | |
} | |
body { | |
font: 13px Helvetica, Arial; | |
} |
# Based on https://github.com/dcramer/mock-django | |
import mock | |
from django.utils.unittest import TestCase | |
from project.app.models import Category | |
class ModelMock(mock.MagicMock): |
#!/usr/bin/env python | |
#-*- coding:utf-8 -*- | |
import imaplib | |
import getpass | |
import argparse | |
argparser = argparse.ArgumentParser(description="Dump a IMAP folder into .eml files") | |
argparser.add_argument('-s', dest='host', help="IMAP host, like imap.gmail.com", required=True) | |
argparser.add_argument('-u', dest='username', help="IMAP username", required=True) |