Skip to content

Instantly share code, notes, and snippets.

View jsilva74's full-sized avatar
💻

José Silva Jr. jsilva74

💻
  • Rio de Janeiro, RJ, Brasil
View GitHub Profile
@aidos-dev
aidos-dev / README.md
Last active April 18, 2025 17:38
How to connect Apple AirPods to Linux (Debian/Ubuntu/Mint)

How to connect Apple AirPods to Linux (Debian/Ubuntu/Mint)

Step 1.

Open your terminal.

In the root directory run the command:

sudo nano /etc/bluetooth/main.conf
@stephenbradshaw
stephenbradshaw / python3_https_server.py
Created November 5, 2020 01:26
Python 3 Simple HTTPS server
#!/usr/bin/env python3
# python3 update of https://gist.github.com/dergachev/7028596
# Create a basic certificate using openssl:
# openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
# Or to set CN, SAN and/or create a cert signed by your own root CA: https://thegreycorner.com/pentesting_stuff/writeups/selfsignedcert.html
import http.server
import ssl
httpd = http.server.HTTPServer(('127.0.0.1', 443), http.server.SimpleHTTPRequestHandler)
@gpoole
gpoole / tampermonkey-hide-youtube-comments.js
Last active September 2, 2024 01:55
🚨 OUTDATED AND BROKEN ON CURRENT DESIGN 🚨 Tampermonkey userscript to hide comments on YouTube with a toggle on/off button
// ==UserScript==
// @name Hide YouTube comments
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Hides YouTube comments.
// @author gpoole
// @match https://www.youtube.com/*
// @run-at document-end
// @grant none
// ==/UserScript==
@dillonstreator
dillonstreator / crumby.js
Last active November 2, 2024 11:56
Javascript generate breadcrumb array from url pathname
const titleizeWord = (str) => `${str[0].toUpperCase()}${str.slice(1)}`;
const kebabToTitle = (str) => str.split("-").map(titleizeWord).join(" ");
const toBreadcrumbs = (pathname, { rootName = "Home", nameTransform = s=>s } = {}) =>
pathname
.split("/")
.filter(Boolean)
.reduce(
(acc, curr, idx, arr) => {
acc.path += `/${curr}`;
@mort3za
mort3za / git-auto-sign-commits.sh
Last active February 5, 2025 18:58
Auto sign your git commits
# Generate a new pgp key: (better to use gpg2 instead of gpg in all below commands)
gpg --gen-key
# maybe you need some random work in your OS to generate a key. so run this command: `find ./* /home/username -type d | xargs grep some_random_string > /dev/null`
# check current keys:
gpg --list-secret-keys --keyid-format LONG
# See your gpg public key:
gpg --armor --export YOUR_KEY_ID
# YOUR_KEY_ID is the hash in front of `sec` in previous command. (for example sec 4096R/234FAA343232333 => key id is: 234FAA343232333)
@brunopinheiro
brunopinheiro / Instructions.md
Last active February 26, 2024 14:10
Empty Trash AppleScript

Empty Trash AppleScript

Using as an Application

When you save the script as an application, you can use it with Spotlight!

  1. Open Automator
  2. Create new Application
  3. Drag the Run Applescript action
  4. Type the script
  5. Save as Empty Trash
@joaohcrangel
joaohcrangel / validation-cpf.ts
Last active February 10, 2025 17:59
Função para validar CPF em TypeScript
function isValidCPF(value: string) {
if (typeof value !== 'string') {
return false;
}
value = value.replace(/[^\d]+/g, '');
if (value.length !== 11 || !!value.match(/(\d)\1{10}/)) {
return false;
}
@markreid
markreid / gitflowrebasing.md
Created January 17, 2017 04:30
git flow with rebasing
{
"UF": [
{"nome": "Acre", "sigla": "AC"},
{"nome": "Alagoas", "sigla": "AL"},
{"nome": "Amapá", "sigla": "AP"},
{"nome": "Amazonas", "sigla": "AM"},
{"nome": "Bahia", "sigla": "BA"},
{"nome": "Ceará", "sigla": "CE"},
{"nome": "Distrito Federal", "sigla": "DF"},
{"nome": "Espírito Santo", "sigla": "ES"},
@eristoddle
eristoddle / tampermonkey.jquery.js
Created January 3, 2013 04:06
How to get jQuery to work in Chrome Tampermonkey userscripts
// ==UserScript==
// @name Vortek Preload
// @namespace vortek
// @description Load variables
// @include http://localhost/vortek_php/*
// @version 1
// ==/UserScript==
// a function that loads jQuery and calls a callback function when jQuery has finished loading
function addJQuery(callback) {
var script = document.createElement("script");