Skip to content

Instantly share code, notes, and snippets.

View fernandojunior's full-sized avatar

Fernando Felix fernandojunior

View GitHub Profile
package org.saiku.web;
import java.net.URL;
import java.util.UUID;
import junit.framework.TestCase;
import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.UsernamePasswordCredentials;
import org.apache.commons.httpclient.methods.GetMethod;
@fernandojunior
fernandojunior / note.md
Created January 28, 2016 20:14 — forked from fyears/note.md
how to install scipy numpy matplotlib ipython in virtualenv

if you are using linux, unix, os x:

pip install -U setuptools
pip install -U pip

pip install numpy
pip install scipy
pip install matplotlib
#pip install PySide
@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 / lambda.r
Created June 26, 2016 22:02 — forked from klmr/lambda.r
Finally a proper lambda for R
`<-` = function (body, params) {
vars = all.vars(substitute(params))
formals = as.pairlist(setNames(replicate(length(vars), quote(expr = )), vars))
eval.parent(call('function', formals, substitute(body)))
}
sapply(1 : 4, x -> 2 * x)
# 2 4 6 8
mapply(x ~ y -> x + y,
@fernandojunior
fernandojunior / cluster_lines.py
Created June 30, 2016 00:53 — forked from amix/cluster_lines.py
Groups (clusters) similar lines together from a text file using k-means clustering algorithm.
"""
Groups (clusters) similar lines together from a text file
using k-means clustering algorithm.
Also does some simple cleaning (such as removing white space and replacing numbers with (N)).
Example:
python cluster_lines.py --clusters 20 invalid_dates.txt
@fernandojunior
fernandojunior / CmisSampleClient.java
Created August 23, 2016 13:19 — forked from mryoshio/CmisSampleClient.java
CMIS sample client code using Apache Chemistry
/**
* This code uses Apache Chemistry (http://chemistry.apache.org/).
* License accords to Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
*/
import java.io.ByteArrayInputStream;
import java.io.UnsupportedEncodingException;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;
@fernandojunior
fernandojunior / bobp-python.md
Created January 3, 2017 15:07 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@fernandojunior
fernandojunior / arbitrage.py
Created May 23, 2018 01:26 — forked from Valian/arbitrage.py
Short script for finding Binance Triangle arbitrage opportunities - requires python-binance installed
from collections import defaultdict
from operator import itemgetter
from time import time
from binance.client import Client
FEE = 0.0005
PRIMARY = ['ETH', 'USDT', 'BTC', 'BNB']
@fernandojunior
fernandojunior / sufixos
Created May 2, 2020 08:39 — forked from vgeorge/sufixos
Importação IBGE Censo 2010 - Resultados do Universo
AC
AL
AM
AP
BA
CE
DF
ES
GO
MA
@fernandojunior
fernandojunior / slack_webhook_post.py
Created July 3, 2020 17:51 — forked from devStepsize/slack_webhook_post.py
POST a JSON payload to a Slack Incoming Webhook using Python requests
'''
This is an example of how to send data to Slack webhooks in Python with the
requests module.
Detailed documentation of Slack Incoming Webhooks:
https://api.slack.com/incoming-webhooks
'''
import json
import requests