Skip to content

Instantly share code, notes, and snippets.

View drmcarvalho's full-sized avatar
❤️
:D

Dener Carvalho drmcarvalho

❤️
:D
View GitHub Profile
@thesamesam
thesamesam / xz-backdoor.md
Last active March 19, 2025 15:17
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

Update: I've disabled comments as of 2025-01-26 to avoid everyone having notifications for something a year on if someone wants to suggest a correction. Folks are free to email to suggest corrections still, of course.

Background

@juanje
juanje / podman_comands.sh
Created June 10, 2020 14:53
Run Redis with Podman. As a Systemd service and as a Pod.
# This is a simple example of how to run a basic service inside a container with Podman
# Podman
## Pull the Docker image
podman pull docker.io/redis
## Run the container as you would do with Docker
podman run -d --name redis_server -p 6379:6379 redis
# But Podman facilitate some extra ways:
@rafael-neri
rafael-neri / validar_cpf.php
Last active March 6, 2025 11:02
Validar CPF em PHP (Completo)
<?php
function validaCPF($cpf) {
// Extrai somente os números
$cpf = preg_replace( '/[^0-9]/is', '', $cpf );
// Verifica se foi informado todos os digitos corretamente
if (strlen($cpf) != 11) {
return false;
@brcontainer
brcontainer / ux-homologation.js
Last active December 9, 2016 13:18
Ajuda a distinguir o ambiente de homologação do de produção baseado pelo domínio
// ==UserScript==
// @name UxHomologation
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Ajuda a detectar se esta em que ambiente baseado no domínio
// @author Guilherme Nascimento
// @match *://dominio-do-ambiente-de-homologação.com.br/*
// @grant none
// ==/UserScript==
@define-private-public
define-private-public / HttpServer.cs
Last active March 9, 2025 22:07
A Simple HTTP server in C#
// Filename: HttpServer.cs
// Author: Benjamin N. Summerton <define-private-public>
// License: Unlicense (http://unlicense.org/)
using System;
using System.IO;
using System.Text;
using System.Net;
using System.Threading.Tasks;
@eyecatchup
eyecatchup / git-commit-log-stats.md
Last active February 6, 2025 14:35
Some commands to get git commit log statistics for a repository on the command line.

git commit stats

Commands to get commit statistics for a Git repository from the command line -
using git log, git shortlog and friends.




@umidjons
umidjons / web-service-soap-client-server-php.md
Last active March 18, 2025 19:24
Simple Web service - SOAP Server/Client in PHP

Simple Web service - SOAP Server/Client in PHP

Implementation of the SOAP server - server.php:

<?php
// turn off WSDL caching
ini_set("soap.wsdl_cache_enabled","0");

// model, which uses in web service functions as parameter
@pavelbinar
pavelbinar / gist:6333285
Last active July 27, 2022 07:49
JavaScript: Random Boolean
/* Random Boolean */
var randomNumber = Math.random() >= 0.5;
console.log(randomNumber);
@uris77
uris77 / repo_pattern.py
Last active May 8, 2024 14:20
Example of Repository Pattern with SQLAlchemy
# This is a very crud example of using the Repository Pattern with SQLAlchemy. It allows me to completely ignore interactions with
# the database. This is only pulled in whenever I require to persist or retrieve an object from the database. The domain/business
# logic is entirely separated from persistence and I can have true unit tests for those.
# The tests for persistence are then limited to very specific cases of persistence and retrieving instances, and I can do those
# independent of the business logic. They also tend to be less tests since I only need to test them once.
@jonashansen229
jonashansen229 / class.database.php
Last active June 20, 2023 08:41
PHP OOP Database class using MySQLI and Singleton pattern. Only one instance of the class will be made, this requires less memory.
<?php
/*
* Mysql database class - only one connection alowed
*/
class Database {
private $_connection;
private static $_instance; //The single instance
private $_host = "HOSTt";
private $_username = "USERNAME";
private $_password = "PASSWORd";