Skip to content

Instantly share code, notes, and snippets.

View AndyDaSilva52's full-sized avatar
🎯
Focusing

Anderson da Silva AndyDaSilva52

🎯
Focusing
View GitHub Profile
namespace SeleniumTest
{
[TestFixture(typeof(FirefoxDriver))]
[TestFixture(typeof(InternetExplorerDriver))]
public class BlogTest<TWebDriver> where TWebDriver : IWebDriver, new()
{
private IWebDriver _driver;
[Test]
public void SearchResults_ShouldHaveCorrectPageTitle()
@AndyDaSilva52
AndyDaSilva52 / lastfm_to_gmusic.py
Last active August 24, 2016 22:20 — forked from anupdhml/lastfm_to_gmusic.py
Lastfm loved tracks/playlist to Google Music playlist, either with songs from your library or from all access. Order of songs in lastfm is preserved and can export/load them from a json file.
#!/usr/bin/env python
# Lastfm loved tracks/playlist to Google Music playlist, either with songs from your library or from all access
# Order of songs in lastfm is preserved.
# First export the lastfm data in a json file, and then import it into Google Music
# You can edit the intermediate json file if you wish.
#
# Based on this script.
# https://gist.github.com/Timmmm/6572592
#
@AndyDaSilva52
AndyDaSilva52 / VBAOutlookCreateFoldersSubfolders.bas
Last active February 6, 2018 15:47
Create Folders and Subfolders in Outlook Folder Structure - Choose a Origim Folder and Create the same Subfolders in the Destination
Sub CreateFolders()
Dim olNS As NameSpace
Dim olFolder As Folder
Dim OlNewFolder As Folder
Dim olNewFolders As Folders
Dim olItems As Items
Dim olItem As MailItem
Dim strName As String
Dim i As Long
@AndyDaSilva52
AndyDaSilva52 / MSSQLExportSchema.ps1
Last active February 16, 2019 23:42 — forked from cheynewallace/ExportSchema.ps1
Export MSSQL schema with PowerShell. This script will export your schema definitions for tables, stored procs, triggers, functions and views to .sql files with Directory Hierarchy by type of Object
# Usage: powershell MSSQLExportSchema.ps1 "SERVERNAME" "DATABASE" "C:\<YourOutputPath>"
# Start Script
#Set-ExecutionPolicy RemoteSigned
# Set-ExecutionPolicy -ExecutionPolicy:Unrestricted -Scope:LocalMachine
function GenerateDBScript([string]$serverName, [string]$dbname, [string]$scriptpath)
{
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | Out-Null
@AndyDaSilva52
AndyDaSilva52 / MegaERP_T_CLI_EST_MOVTOLOTES_SPACE.sql
Created May 27, 2019 20:57
#MegaERP - Evita lançar no Lote dos Movimentos de Estoque, espaço em branco no inicio ou final da String, evitando situações em que o Mega considera dois lotes com mesmo texto como diferentes por conta do caractere de espaço
create or replace TRIGGER T_CLI_EST_MOVTOLOTES_SPACE
BEFORE INSERT OR UPDATE OF MVL_ST_LOTEFORNE ON MGADM.EST_LOTESMOVIMENTO
REFERENCING OLD AS OLD NEW AS NEW
FOR EACH ROW
BEGIN
BEGIN
/**
Quem: AGS (anderson@sanavita.com.br)
Quando: 27/05/2019
Motivo: Evitar de permitir inserir Lote com espaço em branco no inicio ou fim do Lote
@AndyDaSilva52
AndyDaSilva52 / MegaERP_T_CLI_EST_PRODUTOS.sql
Last active May 28, 2019 17:10
#MegaERP - Trigger para não permitir duplicar itens com mesma descrição + Descrição Abreviada que inclua o Código do Item no início da Descrição + Remover Múltiplo espaço em branco no campo de descrição
create or replace TRIGGER MGCLI.T_CLI_EST_PRODUTOS
FOR INSERT OR UPDATE ON MGADM.EST_PRODUTOS
COMPOUND TRIGGER
TYPE TYP_CLI_RC_PRODUTOS IS RECORD(
PRO_TAB_IN_CODIGO MGADM.EST_PRODUTOS.PRO_TAB_IN_CODIGO%TYPE,
PRO_PAD_IN_CODIGO MGADM.EST_PRODUTOS.PRO_PAD_IN_CODIGO%TYPE,
PRO_IN_CODIGO MGADM.EST_PRODUTOS.PRO_IN_CODIGO%TYPE,
PRO_ST_DESCRICAO MGADM.EST_PRODUTOS.PRO_ST_DESCRICAO%TYPE
);
@AndyDaSilva52
AndyDaSilva52 / MegaERP_T_CLI_EST_RECEBNFE_MANIF.sql
Last active June 14, 2019 16:34
#MegaERP - Gerenciamento de NFe - Utilidade para tratar alguns pontos não padrões no erp. Ex: Gravar ocorrência para quando é realizado Manifestação de Operação / Impedir alterar o status do Registro quando o Download do XML não for sido concluído.
create or replace TRIGGER MGCLI."T_CLI_EST_RECEBNFE_MANIF"
BEFORE UPDATE OF RCNF_ST_STATUSMANIFESTACAO, RCNF_ST_STATUSIMPORTA
ON MGADM.EST_RECEBIMENTONFE
REFERENCING OLD AS OLD NEW AS NEW
FOR EACH ROW
BEGIN
/**
Status Arquivo NF-e
Indica o status da importação do arquivo NF-e
@AndyDaSilva52
AndyDaSilva52 / #MegaERP MGADM.EST_MATTITENSDOCUMENTO.MIE_RE_QUANTBAIXA_vs_MGADM.EST_MATTBAIXADOCUMENTO.MER_RE_QUANTIDADE.sql
Last active June 17, 2019 16:46
#MegaERP - Mostra divergências entre o campo de Baixa da Tabela de Itens de Terceiro comparado com a Soma das Baixas OU Saldo do Item no Ctrl Terceiro comparado com o Saldo Geral de Estoque
select
case
when p.mie_re_qtdebaixatotal <> p.mer_re_quantidade then
'SOMA_BX_ITENS_VS_BX_TOTAL_ITEM'
when nvl(p.mvs_re_quantidade,0)<> p.mie_re_quantdisp then
'SALDO_CTRL_VS_SALDO_GERAL'
when p.mie_re_qtdebaixatotal <> p.mer_re_quantidade
or(p.mvs_re_quantidade)<> p.mie_re_quantdisp then
'AMBOS'
else
Verifying my Blockstack ID is secured with the address 1K66tYTj9PmuNPXaEb2xaKvwfaBuKTTTsn https://explorer.blockstack.org/address/1K66tYTj9PmuNPXaEb2xaKvwfaBuKTTTsn
@AndyDaSilva52
AndyDaSilva52 / MGCLI.F_VALIDA_CHAVE.sql
Last active July 8, 2019 14:32
#Mega - Função para Validar Chave em Lançamentos de Entrada do Mega (NFe ou CTe)
create or replace FUNCTION F_VALIDA_CHAVE
(
pRCB_ST_CHAVEACESSO IN MGADM.EST_RECEBIMENTO.RCB_ST_CHAVEACESSOCTE%TYPE,
pUF_ST_SIGLA IN MGGLO.GLO_AGENTES.UF_ST_SIGLA%TYPE,
pRCB_DT_DOCUMENTO IN MGADM.EST_RECEBIMENTO.RCB_DT_DOCUMENTO%TYPE,
pAGN_ST_CGC IN MGGLO.GLO_AGENTES.AGN_ST_CGC%TYPE,
pTDF_IN_CODIGO IN MGADM.EST_RECEBIMENTO.TDF_IN_CODIGO%TYPE,
pSER_ST_CODIGO IN MGADM.EST_RECEBIMENTO.SER_ST_CODIGO%TYPE,
pRCB_ST_NOTA IN MGADM.EST_RECEBIMENTO.RCB_ST_NOTA%TYPE
) RETURN VARCHAR2 AS -- Retorna 'S' caso seja válido