Skip to content

Instantly share code, notes, and snippets.

View fernandojunior's full-sized avatar

Fernando Felix fernandojunior

  • Brazil
View GitHub Profile
@fernandojunior
fernandojunior / dados2.csv
Last active June 11, 2016 22:01
Análise simples de disciplinas que um aluno quer cursar
aluno trilha quantidade aprovacoes taxa
a 41119 7 4 0.57
b 32799 7 7 1
c 32927 7 5 0.5
d 41119 7 6 0.86
e 41119 7 3 0.42
f 32925 6 5 0.83
$ nosetests --ckan --reset-db --with-pylons=test-core.ini ckan
.........................../usr/lib/ckan/default/local/lib/python2.7/site-packages/sqlalchemy/orm/unitofwork.py:79: SAWarning: Usage of the 'related attribute set' operation is not currently supported within the execution stage of the flush process. Results may not be consistent. Consider using alternative event listeners or connection-level operations instead.
sess._flush_warning("related attribute set")
........................................FF................................................................................................................................................./usr/lib/ckan/default/src/ckan/ckan/tests/controllers/test_user.py:156: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
assert_true('/my/prefix/user/logout' in e.message)
.................................................................................................................................................S.S.S.S......
@fernandojunior
fernandojunior / gist:6994e6e0108c22062cee5d84ee0e54e9
Last active May 23, 2016 17:45
cross domain cors javascript server client
http://enable-cors.org/
http://www.html5rocks.com/en/tutorials/cors/
http://community.bonitasoft.com/node/939#node-4039
http://community.bonitasoft.com/questions-and-answers/get-no-access-control-allow-origin-error
http://techblog.constantcontact.com/software-development/using-cors-for-cross-domain-ajax-requests/
https://tomcat.apache.org/tomcat-7.0-doc/config/filter.html#CORS_Filter
import re
import shutil
import requests
USERNAME = '***'
PASSWORD = '***'
MAILBOX_ID = '***'
OUTPUT_FOLDER = 'inbox'
MESSAGE_START = 1
MESSAGE_END = 149
<html>
<body>
<ul>
<li>Item:
<ol>
<li>Point:
<div>
<ul>
# pip install beautifulsoup4
# pip install six
from datetime import datetime
from six.moves.urllib.request import urlopen
from bs4 import BeautifulSoup
def get_posts():
url = 'https://bitcointalk.org/index.php?topic=1463943.0'
html = urlopen(url).read()
@fernandojunior
fernandojunior / jinx.py
Last active November 29, 2016 04:10 — forked from Scoppio/jinx.py
A simple gradient descent devised to capture the match ID of a game in a specific day, month and year.
'''
Script to find a match at a specific date time by using gradient descendent.
Adaptaded from Lucas Coppio:
https://gist.github.com/Scoppio/2d5cf12311239ca9807f643ef21b88d1
'''
import math
import time
import random
from datetime import datetime
@fernandojunior
fernandojunior / gist:231792cc6daaf1143ca40799ef564a1e
Created May 1, 2016 02:45
NoSQL, JSON, MongoDB, Elasticsearch
http://blog.quarkslab.com/mongodb-vs-elasticsearch-the-quest-of-the-holy-performances.html
http://kkovacs.eu/cassandra-vs-mongodb-vs-couchdb-vs-redis
@fernandojunior
fernandojunior / gist.py
Last active April 28, 2016 12:32
Python, numpy, matrix, functions
import time
import numpy as np
ROW = int(1 * 1e5)
COL = int(1 * 1e3)
data = np.random.rand(ROW, COL)
functions = [np.mean, np.median, np.std, np.var, np.sum]
def ze():
values = []