Skip to content

Instantly share code, notes, and snippets.

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

Mário Valney mariovalney

🏠
Working from home
View GitHub Profile
@guisehn
guisehn / gist:3276302
Last active June 27, 2024 01:40
Validar CNPJ (PHP)
<?php
function validar_cnpj($cnpj)
{
$cnpj = preg_replace('/[^0-9]/', '', (string) $cnpj);
// Valida tamanho
if (strlen($cnpj) != 14)
return false;
@RafaelFunchal
RafaelFunchal / WP_Query()
Last active January 5, 2019 15:13
Como exibir apens posts de uma determinada categoria na sua página WordPress
<?php
// Documentação completa em http://codex.wordpress.org/Class_Reference/WP_Query
$args = array(
'cat' => 1, //ID da sua categoria
'posts_per_page ' => 4, // Número de posts a exibir
);
$novo_loop = new WP_Query( $args );
if ( $novo_loop->have_posts() ) : while ( $novo_loop->have_posts() ) : $novo_loop->the_post();
@johnbillion
johnbillion / wp_mail.md
Last active June 3, 2024 13:31
WordPress Emails

WordPress Emails

This document lists all the situations where WordPress sends an email, along with how to filter or disable each email.

This documentation has moved here: https://github.com/johnbillion/wp_mail

@themepaint
themepaint / Woocommerce Price Filter CSS
Created February 2, 2016 08:20
Woocommerce Price Filter CSS
.price_slider{
margin-bottom: 1em;
}
.price_slider_amount {
text-align: right;
line-height: 2.4em;
font-size: 0.8751em;
}
@mcnamee
mcnamee / bitbucket-pipelines.yml
Last active December 14, 2023 03:57
Bitbucket Pipelines - Deploy via FTP to shared hosting
# Installation ---
# 1. In Bitbucket, add FTP_USERNAME, FTP_PASSWORD and FTP_HOST as environment variables.
# 2. Commit this file (bitbucket-pipelines.yml) to your repo (in the repo root dir)
# 3. From Bitbucket Cloud > Commits > Commit Number > Run Pipeline > Custom:Init (this will
# push everything and initialize GitFTP)
#
# Usage ---
# - On each commit to master branch, it'll push all files to the $FTP_HOST
# - You also have the option to 'init' (see 'Installation' above) - pushes everything and initialises
# - Finally you can also 'deploy-all' (from Bitbucket Cloud > Commits > Commit Number > Run Pipeline > Custom:deploy-all)
@henriquecarv
henriquecarv / install_warsaw.bash
Last active October 3, 2018 19:14
Itau Warsaw Guardian Installer - Ubuntu 18.04
#!/bin/bash
sudo apt update
cd ~/Downloads
wget https://guardiao.itau.com.br/warsaw/warsaw_setup_64.deb
dpkg-deb -x ~/Downloads/warsaw_setup_64.deb /tmp/warsaw
dpkg-deb --control warsaw_setup_64.deb /tmp/warsaw/DEBIAN/
sudo sed -i -e 's/python-gpgme,//g' /tmp/warsaw/DEBIAN/control
sudo sed -i -e 's/libcurl3/libcurl4/g' /tmp/warsaw/DEBIAN/control
sudo apt -y install python-pip
@solsticedhiver
solsticedhiver / search-for-luks-header.py
Last active March 7, 2022 21:21
Script to search offset of the LUKS header on a device file
#!/usr/bin/env python3
import threading
import queue
import argparse
import os.path
import sys
NUM_WORKER_THREADS = 16
LUKS_HEADER = b'LUKS\xba\xbe'
@brianfoody
brianfoody / DeadLetterQueueStack.ts
Last active July 17, 2024 06:01
Dead Letter Queue example with CDK
import { Queue } from "@aws-cdk/aws-sqs";
import { App, Duration, Stack, StackProps } from "@aws-cdk/core";
import { Runtime, Code, Function } from "@aws-cdk/aws-lambda";
import { SqsEventSource } from "@aws-cdk/aws-lambda-event-sources";
class DeadLetterQueue extends Stack {
constructor(parent: App, name: string, props?: StackProps) {
super(parent, name, props);
@djfdyuruiry
djfdyuruiry / README.md
Last active July 22, 2024 09:05
WSL 2 - Enabling systemd

Enable systemd in WSL 2

NOTE: If you have Windows 11 there is now an official way to do this in WSL 2, use it if possible - see MS post here (WINDOWS 11 ONLY)

This guide will enable systemd to run as normal under WSL 2. This will enable services like microk8s, docker and many more to just work during a WSL session. Note: this was tested on Windows 10 Build 2004, running Ubuntu 20.04 LTS in WSL 2.

  • To enable systemd under WSL we require a tool called systemd-genie

  • Copy the contents of install-sg.sh to a new file /tmp/install-sg.sh:

<?php
/**
*
* Plugin Name: CF7 to Webhook - Add UTM Cookies
* Description: Add Cookies data to webhook
* Version: 1.0.2
* Author: Mário Valney - Modified for Handl UTM Grabber by Epic Matt
* Author URI: https://mariovalney.com + Modified by https://epicim.com
* Text Domain: cf7-to-webhook-add-cookies
*/