Skip to content

Instantly share code, notes, and snippets.

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

Rubens Cividati Cividati

🏠
Working from home
  • Home Office
View GitHub Profile
@alexandreio
alexandreio / clean_str.py
Created April 22, 2021 17:24
Clean STR Master!
import re
import codecs
from unicodedata import normalize
def normalize_string(string):
text = string.encode("utf8").decode()
text = normalize("NFKD", text)
proccessed_text = text.encode("ASCII", "ignore").decode("utf8")
proccessed_text = re.sub(r"[\x00-\x1F]+", " ", proccessed_text)
@Zekfad
Zekfad / conventional-commits.md
Last active June 3, 2024 14:44
Conventional Commits Cheatsheet

Quick examples

  • feat: new feature
  • fix(scope): bug in scope
  • feat!: breaking change / feat(scope)!: rework API
  • chore(deps): update dependencies

Commit types

  • build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
  • ci: Changes to CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
  • chore: Changes which doesn't change source code or tests e.g. changes to the build process, auxiliary tools, libraries
@henriqueblang
henriqueblang / rle.py
Last active June 13, 2020 03:04
RLE zigzag
def RLE_zigzag_encoder(data, rows, columns):
encoding = []
prev = data[0][0]
count = 1
go_down = None
change_direction = True
next_position = [0, 1]
sklearn.metrics.pairwise_distances
https://scikit-learn.org/stable/modules/generated/sklearn.metrics.pairwise_distances.html
Start:
[[3,9,10,1],[8,12,13,7],[2,11,14,5],[15,4,6,0]]
Goal:
[[0,1,2,3],[4,5,6,7],[8,9,10,11],[12,13,14,15]]
@shreyakupadhyay
shreyakupadhyay / checkARP.txt
Last active May 16, 2022 12:05
Check ARP requests in a network using mininet and tcpdump
$ sudo mn --topo single,3 --controller=remote,ip=<controller ip>,port=6633
(To make a topology with 1 switch, 1 remote controller and 3 hosts)
mininet> xterm h1 h2 h3
h2> tcpdump -XX -n -i h2-eth0 (run tcpdump to capture packets)
h3> tcpdump -XX -n -i h3-eth0
h1> ping -c1 10.0.0.2
(Do not do pingall before these. Otherwise you won't see the same ARP request on h2 and h3)
mininet> exit
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active June 8, 2024 13:20
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@FrancesCoronel
FrancesCoronel / sampleREADME.md
Last active March 26, 2024 01:21
A sample README for all your GitHub projects.

Repository Title Goes Here

Frances Coronel

INSERT GRAPHIC HERE (include hyperlink in image)

Subtitle or Short Description Goes Here

ideally one sentence >

@PurpleBooth
PurpleBooth / README-Template.md
Last active June 8, 2024 05:20
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites