Skip to content

Instantly share code, notes, and snippets.

View SilvaEmerson's full-sized avatar
🏠
Working from home

Émerson Silva SilvaEmerson

🏠
Working from home
View GitHub Profile
@SilvaEmerson
SilvaEmerson / split_hof.py
Created June 5, 2019 11:41
Split function HOFed
def split_by(character):
return lambda content: content.split(character)
split_by_comma = split_by(', ')
split_by_comma('This, Is, A, Content, Example')
#result:
#['This', 'Is', 'A', 'Content', 'Example']
def split_by_comma(fn):
def wrapper(sentence):
return fn(sentence).split(',')
return wrapper
@split_by_comma
def transform_content(content):
return content.swapcase()
@SilvaEmerson
SilvaEmerson / Otsu Image Segmentation Method.ipynb
Last active October 21, 2024 12:54
Otsu Image Segmentation Method
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@SilvaEmerson
SilvaEmerson / ushallnotpass
Last active October 21, 2021 22:50
My Pi-hole sites blacklist
0koryu0.easter.ne.jp
109-204-26-16.netconnexion.managedbroadband.co.uk
1866809.securefastserver.com
2amsports.com
4dexports.com
50efa6486f1ef.skydivesolutions.be
61kx.uk-insolvencydirect.com
6b8a953b2bf7788063d5-6e453f33ecbb90f11a62a5c376375af3.r71.cf5.rackcdn.com
97b1c56132dfcdd90f93-0c5c8388c0a5897e648f883e2c86dc72.r54.cf5.rackcdn.com
999fitness.com
@SilvaEmerson
SilvaEmerson / goodstein_sequence.jl
Last active October 21, 2024 12:44
Goodstein Sequence until 50th term
# Ref.: https://en.wikipedia.org/wiki/Goodstein%27s_theorem#Goodstein_sequences
@kwdef struct GoodsteinTerm
coefficient::Int
base::Int
exp::Int
value::Function = () -> coefficient * base ^ exp
end
function factorize(n::Int, base::Int, tmp_arr=[])

Keybase proof

I hereby claim:

  • I am silvaemerson on github.
  • I am silvaemerson (https://keybase.io/silvaemerson) on keybase.
  • I have a public key ASA5u5qXGAOLJKcGNJihQkbgpadk6vLAw3gmSuSGiYYGPgo

To claim this, I am signing this object:

@SilvaEmerson
SilvaEmerson / gossip_protocol.als
Last active March 3, 2025 17:37
Gossip Protocol: Alloy spec
some sig Version {}
some sig ID {}
some sig Server {
id: one ID,
version: one Version,
var cache: set ID -> Version
}