Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View edupsousa's full-sized avatar

Eduardo Pereira de Sousa edupsousa

  • Pode Perguntar / Instituto Federal de São Paulo
  • Caraguatatuba, Brazil
View GitHub Profile
@edupsousa
edupsousa / extract_skills.js
Created April 19, 2024 15:25
Extract skills list from GitHub skills page
// Visit: https://www.linkedin.com/in/edupsousa/details/skills/ (change edupsousa by your username)
// Open the Chrome DevTools console and use the code below
let els = [...document.querySelectorAll('a[data-field="skill_page_skill_topic"]')];
let skills = [...new Set(els.flatMap(el => el.href.split('?')[1].split('&').map(v => v.split('=')).filter(v => v[0] === 'keywords').flat()).filter(v => v !== 'keywords').map(decodeURIComponent).map(v => v.replaceAll('+',' ')))].sort();
console.log(JSON.stringify(skills))
@edupsousa
edupsousa / detect_vunerable_sshd.sh
Created April 1, 2024 18:37
A script by Vegard Nossum to detect if sshd is vulnerable to CVE-2024-3094
#! /bin/bash
set -eu
# find path to liblzma used by sshd
path="$(ldd $(which sshd) | grep liblzma | grep -o '/[^ ]*')"
# does it even exist?
if [ "$path" == "" ]
then
@edupsousa
edupsousa / heap.ts
Created January 3, 2024 15:30
TypeScript Data Structures
type HeapNodeCompareFn<T> = (a: T, b: T) => number;
class Heap<T> {
private nodes: T[];
private compare: HeapNodeCompareFn<T>;
constructor(compareFn: HeapNodeCompareFn<T>, nodes: T[] = []) {
this.compare = compareFn;
this.nodes = nodes;
@edupsousa
edupsousa / resize-active-window.sh
Created October 29, 2023 16:16
Resize Active Window to 1920 by 1080
wmctrl -r :ACTIVE: -e 0,-1,-1,1920,1080
@edupsousa
edupsousa / index.css
Created June 8, 2022 14:48
Aula CSS Modules
.titulo {
font-weight: bold;
font-size: 2em;
}
@edupsousa
edupsousa / .eslintrc.js
Created November 12, 2021 04:13
Recipe for using a custom eslint@8 config file in the vscode-eslint extension (.vscode_settio
module.exports = {
env: {
browser: true,
es2021: true,
},
parserOptions: {
sourceType: "module",
},
rules: {
"no-console": "warn",
@edupsousa
edupsousa / Exemplos.java
Created June 10, 2021 18:56
Exemplos - Análise de Algoritmos
package aula3;
import java.util.Random;
class Exemplos {
public static void main(String[] args) {
int[] valores;
boolean encontrado;
const vogais = ["a", "e", "i", "o", "u"];
function Lista() {
return (
<ul>
{vogais.map((letra) => (
<li>{letra}</li>
))}
</ul>
);
@edupsousa
edupsousa / tarefas.html
Created February 23, 2021 00:22
Lista de Tarefas - React
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Document</title>
<link
href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/css/bootstrap.min.css"
rel="stylesheet"
integrity="sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl"
@edupsousa
edupsousa / pee_pandas_ex1.csv
Created September 15, 2020 18:52
PEE - Pandas - Exercício 1
Aluno Semestre Disciplina Nota
Ana 1 Matemática 1
Ana 1 Português 6
Ana 2 Física 8
Ana 2 História 8
Beatriz 1 Matemática 7
Beatriz 1 Português 5
Beatriz 2 Física 4
Beatriz 2 História 8
Carlos 1 Matemática 4