Skip to content

Instantly share code, notes, and snippets.

Avatar

Bernardo Gomes Bernardoow

  • Belo Horizonte - Brazil
View GitHub Profile
View teste-yasmine.csv
nome cidade sobrenome
yasmine joao monlevade costa
bernardo manhuaçu gomes
View raml2html_task_gulp.js
function raml2html(options) {
var gutil = require('gulp-util');
var through = require('through2');
var raml2html = require('raml2html');
var simplifyMark = function(mark) {
if (mark) mark.buffer = mark.buffer.split('\n', mark.line + 1)[mark.line].trim();
}
options = options || {};
View SWAGGER_SETTINGS
SWAGGER_SETTINGS = {
'SECURITY_DEFINITIONS': {
'api_key': {
'type': 'apiKey',
'in': 'header',
'name': 'Authorization'
}
},
'CUSTOM_HEADERS': {
'HTTP_AUTHORIZATION': 'Token a476957f3c20a3a262a760fc2194569315ea5670'
@Bernardoow
Bernardoow / Sync gh-pages + master branches
Created Jul 26, 2018 — forked from mandiwise/Sync gh-pages + master branches
Keep gh-pages up to date with a master branch
View Sync gh-pages + master branches
// Reference: http://lea.verou.me/2011/10/easily-keep-gh-pages-in-sync-with-master/
$ git add .
$ git status // to see what changes are going to be commited
$ git commit -m 'Some descriptive commit message'
$ git push origin master
$ git checkout gh-pages // go to the gh-pages branch
$ git rebase master // bring gh-pages up to date with master
$ git push origin gh-pages // commit the changes
View Performance of Flask, Tornado, GEvent, and their combinations.md

Performance of Flask, Tornado, GEvent, and their combinations

Wensheng Wang, 10/1/11

Source: http://blog.wensheng.org/2011/10/performance-of-flask-tornado-gevent-and.html

When choosing a web framework, I pretty much have eyes set on Tornado. But I heard good things about Flask and Gevent. So I tested the performance of each and combinations of the three. I chose something just a little more advanced than a "Hello World" program to write - one that use templates. Here are the codes:

1, Pure Flask (pure_flask.py)

View Performance of Flask, Tornado, GEvent, and their combinations.md

Performance of Flask, Tornado, GEvent, and their combinations

Wensheng Wang, 10/1/11

Source: http://blog.wensheng.org/2011/10/performance-of-flask-tornado-gevent-and.html

When choosing a web framework, I pretty much have eyes set on Tornado. But I heard good things about Flask and Gevent. So I tested the performance of each and combinations of the three. I chose something just a little more advanced than a "Hello World" program to write - one that use templates. Here are the codes:

1, Pure Flask (pure_flask.py)

@Bernardoow
Bernardoow / docker-compose-node-mongo.yml
Created Jun 30, 2018 — forked from wesleybliss/docker-compose-node-mongo.yml
Docker Compose with example App & Mongo
View docker-compose-node-mongo.yml
version: '2'
services:
myapp:
build: .
container_name: "myapp"
image: debian/latest
environment:
- NODE_ENV=development
- FOO=bar
volumes:
View betamax
import betamax
from betamax.fixtures import unittest
import requests
def function():
response = requests.get('https://httpbin.org/get')
return response.json().get('url')
View gist:fff41d366e7fc192da00755585a25db2

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
View post send
def _send_post(self, url, params, headers):
req = urllib2.Request(url, json.dumps(params), headers)
response = urllib2.urlopen(req)
result = response.read()