Skip to content

Instantly share code, notes, and snippets.

View fernandojunior's full-sized avatar

Fernando Felix fernandojunior

  • Brazil
View GitHub Profile
@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
@fernandojunior
fernandojunior / gist:c249add9de6b9a10291500233bfde8d1
Created June 26, 2020 10:42
Databricks Labs CI/CD Templates
https://databricks.com/session_na20/continuous-delivery-of-ml-enabled-pipelines-on-databricks-using-mlflow
https://databricks.com/blog/2020/06/05/automate-continuous-integration-and-continuous-delivery-on-databricks-using-databricks-labs-ci-cd-templates.html
https://github.com/databrickslabs/cicd-templates
https://github.com/mshtelma/cicdtestdev
https://github.com/mshtelma/lendingclubsscoringdemo
@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 / k_custom.py
Last active March 27, 2020 23:33
Perform data clustering using any distance or centroid metric as euclidian or cosine distance and median or mean centroid
# adapted from https://pythonprogramming.net/k-means-from-scratch-machine-learning-tutorial/
from sklearn import datasets
import numpy as np
from scipy import spatial
euclidian_distance = lambda a, b: np.linalg.norm(a - b)
cosine_distance = lambda a, b: spatial.distance.cosine(a, b)
class KCustom:
@fernandojunior
fernandojunior / gist:b4e587f5aaf29be16827e087065f103b
Last active October 2, 2019 13:55
read lines from zipped file stored in google cloud file system
import zipfile
import gcsfs
fs = gcsfs.GCSFileSystem(project='project-name')
with fs.open('file.zip') as f:
z = zipfile.ZipFile(f)
for filename in z.namelist():
if not os.path.isdir(filename):
@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 / .eslintrc.json
Last active May 19, 2018 01:50
ohlcv challenge
{
"extends": "standard"
}
install.packages("nortest")
# install and import package needed for normality measures
install.packages("moments")
normality_measuares <- function (data) {
require("moments")
print(paste("skewness=", skewness(data), sep=""))
print(paste("kurtosis=", kurtosis(data), sep=""))
}
@fernandojunior
fernandojunior / gistFile.js
Created July 13, 2017 19:06
Handle monitor(s) changes in Windows
const { spawn } = require('child_process');
/**
* Handle monitor(s) changes, ig, perform an action when a monitor is connected or disconnected.
*
* Notes:
* - Windows implementation is based on Windows Management Interface (WMI) and WMI Query Language (WQL)
*
* Reference:
* - https://stackoverflow.com/questions/5278860/using-wmi-to-identify-which-device-caused-a-win32-devicechangeevent
@fernandojunior
fernandojunior / gist:990d4cea9281db1ee3ea7462e2a61e07
Created February 17, 2017 12:47
sparse checkout clone submodules git
http://askubuntu.com/questions/460885/how-to-clone-git-repository-only-some-directories
http://www.richsomerfield.com/post/2014-03-05-adventures-in-git-sparsecheckouts/
http://stackoverflow.com/questions/600079/how-do-i-clone-a-subdirectory-only-of-a-git-repository/13738951#13738951