Skip to content

Instantly share code, notes, and snippets.

View fernandojunior's full-sized avatar

Fernando Felix fernandojunior

View GitHub Profile
@fernandojunior
fernandojunior / publickey-git-error.markdown
Created May 16, 2021 18:26 — forked from adamjohnson/publickey-git-error.markdown
Fix "Permission denied (publickey)" error when pushing with Git

"Help, I keep getting a 'Permission Denied (publickey)' error when I push!"

This means, on your local machine, you haven't made any SSH keys. Not to worry. Here's how to fix:

  1. Open git bash (Use the Windows search. To find it, type "git bash") or the Mac Terminal. Pro Tip: You can use any *nix based command prompt (but not the default Windows Command Prompt!)
  2. Type cd ~/.ssh. This will take you to the root directory for Git (Likely C:\Users\[YOUR-USER-NAME]\.ssh\ on Windows)
  3. Within the .ssh folder, there should be these two files: id_rsa and id_rsa.pub. These are the files that tell your computer how to communicate with GitHub, BitBucket, or any other Git based service. Type ls to see a directory listing. If those two files don't show up, proceed to the next step. NOTE: Your SSH keys must be named id_rsa and id_rsa.pub in order for Git, GitHub, and BitBucket to recognize them by default.
  4. To create the SSH keys, type ssh-keygen -t rsa -C "your_email@example.com". Th
@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 / 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 / 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 / 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 / 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 / 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 / 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 / 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 / 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