Skip to content

Instantly share code, notes, and snippets.

View emtudo's full-sized avatar

Leandro Henrique Reis emtudo

View GitHub Profile
@emtudo
emtudo / smarapd_203.php
Created August 18, 2025 21:14 — forked from luizvaz/smarapd_203.php
Assinatura e Envio de XML SMARAPD padrão ABRASF 2.03 (Vila Velha)
<?php
/**
* User: LuizVAz
* Date: 28/02/2021
* Time: 19:46
*/
namespace Provedores\webService;
use DOMDocument;
defmodule App.Tenant.OrganizationTest do
use ExUnit.Case, async: true
use App.DataCase
alias App.Tenant.Organization
@valid_attrs %{name: "Some Organization", domain: "example.com"}
@update_attrs %{name: "Updated Organization", domain: "updated.com"}
@invalid_attrs %{name: nil, domain: nil}
defmodule App.Tenant.Organization do
# Using Ash.Resource turns this module into an Ash resource.
use Ash.Resource,
# Tells Ash where the generated code interface belongs
domain: App.Tenant,
# Tells Ash you want this resource to store its data in Postgres.
data_layer: AshPostgres.DataLayer,
extensions: [AshArchival.Resource]
archive do
#!/bin/bash
API_KEY="SUA CHAVE SECRETA AQUI"
API_EMAIL="seu email"
ZONE_ID="ZONA DNS"
DOMINIO="dominio.com"
#Lista os registros, necessário para pegar o id para alterar a zona DNS
#curl -X GET "https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/dns_records" \
// Controller
// Metodo do controle que faz a chacagem
protected function checkRecaptcha($token, $ip)
{
$response = (new Client)->post('https://www.google.com/recaptcha/api/siteverify', [
'form_params' => [
'secret' => config('services.recaptcha.secret'),
'response' => $token,
<template>
<div>
</div>
</template>
<script>
/**
* base: https://github.com/finpo/vue2-recaptcha-invisible
*global window document
*/
@emtudo
emtudo / sqs.mjs
Last active August 2, 2022 20:35
read sqs and save to file
import { SQSClient, ReceiveMessageCommand } from "@aws-sdk/client-sqs";
import { join } from 'node:path'
import { fileURLToPath } from 'node:url'
import { writeFile } from 'node:fs/promises'
const QueueUrl = ""
const client = new SQSClient({ region: "sa-east-1" });
const TARGET_DIR = join(fileURLToPath(new URL('.', import.meta.url)), 'data')
@emtudo
emtudo / captcha_tradicional.js
Created May 24, 2021 19:57 — forked from zerobugs-oficial/captcha_tradicional.js
Script que quebra captchas tradicionais (imagem com letras e números) usando a API do 2captcha.com e o Node.js
const request = require('request');
const fs = require('fs');
const puppeteer = require('puppeteer');
const API_KEY = "SUA_API_KEY_DO_2captcha";
async function curl(options) {
return new Promise((resolve, reject) => {
request(options, (err, res, body) => {
if(err)
@emtudo
emtudo / recaptcha_v2.js
Created May 24, 2021 19:57 — forked from zerobugs-oficial/recaptcha_v2.js
Robô que quebra captchas Recaptcha V2 usando Node.js, 2captcha.com e o Pupppeteer
const request = require('request');
const puppeteer = require('puppeteer');
const API_KEY = "SUA_API_KEY_NO_2captcha"
async function curl(options) {
return new Promise((resolve, reject) => {
request(options, (err, res, body) => {
if(err)
return reject(err);
# Primeira versão, ainda precisa verificar se tem 11 dígitos
# Devolver true/false
# Tratar excessão de caracteres inválidos
defmodule Cpfcalc.Valid do
def calc(cpf) do
String.codepoints(cpf)
|> Enum.map(fn d -> String.to_integer(d) end)
|> IO.inspect()
|> calcD10()