Skip to content

Instantly share code, notes, and snippets.

View edsonpatricio's full-sized avatar

Edson Patricio edsonpatricio

View GitHub Profile
@edsonpatricio
edsonpatricio / s3_accessing.py
Last active December 6, 2025 11:56
Accessando arquivos de um S3 bucket em um Jupyter Notebook
import boto3
import pandas as pd
import numpy as np
import io
import random
from dotenv import load_dotenv
import os
from enum import Enum
load_dotenv()
def sum(a, b):
return a + b
function sum(a, b) {
return a + b;
}
function subtract(a, b) {
return a - b;
}
function euclidianDistance(x1, y1, x2, y2) {
return Math.sqrt(Math.pow(x2 - x1, 2) + Math.pow(y2 - y1, 2));
import scala.collection.mutable
import java.time.{LocalDate, YearMonth}
import java.time.temporal.ChronoUnit
1 + 2
val l = List(1, 2, 3, 4, 5, 6, 7)
val s = l.foldLeft(mutable.Set.empty[Int]){(acc, elem) =>
if (elem % 2 == 0) {
def salesTax(orders: String, year: Int) = 6
//salesTax: (orders: String, year: Int)Int
salesTax(_: String, 2016)
//res30: String => Int = $$Lambda$1354/88151627@1106579f
(salesTax(_: String, 2016))
//res31: String => Int = $$Lambda$1355/1054254583@15630595
salesTax(_: String, 2016)("str")
@edsonpatricio
edsonpatricio / PipeOperator.scala
Last active September 1, 2019 23:09
Pipe Operator Implementation and use. It was inspired by Elixir (book Programming Exilir 1.3 by Dave Thomas)
package br.com.verde.example
import br.com.verde.utils.operators.PipeOperator
object App {
def times2(n: Int) = n * 2
def times3(n: Int): Int = n * 3
@edsonpatricio
edsonpatricio / gist:40cd5fa8a0e31674eb63730aeda382c1
Created February 7, 2017 02:32 — forked from stuart11n/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote
//edsonpatricio/SFPFFiddle.scala
import org.scalajs.dom
import scalatags.JsDom.tags2
import scalatags.JsDom.tags2.section
import org.scalajs.dom.{Element, DOMParser}
object ScalaJSExample extends js.JSApp{
def main(args: Array[String]) {
val greeting = "Hello"
var people: String = args(0)
println(greeting + " " + people)
}
@edsonpatricio
edsonpatricio / simple-git-workflow.md
Created November 17, 2015 12:55 — forked from leesmith/simple-git-workflow.md
Simple Git Workflow For Continuous Delivery

Simple Git Workflow For Continuous Delivery

Workflow guidelines:

  • master branch is always production-ready, deployable, 100% green test suite
  • New development is done on feature branches, with frequent rebasing onto master
  • Clean commit history by preferring to rebase instead of merge (git pull is configured to automatically rebase)

rebase workflow

Workflow