Skip to content

Instantly share code, notes, and snippets.

Alfredo Braga alphabraga

Block or report user

Report or block alphabraga

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View VagrantFile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at
@alphabraga
alphabraga / zeravaloresorcados.sql
Created Dec 14, 2018
procedure para zerar valores orçados
View zeravaloresorcados.sql
create or replace PROCEDURE ZERARVALORESORCAMENTO(ANO VARCHAR2) IS
ID_PERIODO NUMBER;
BEGIN
/**
Autores: ALfredo Braga / Paulo Moraes
Data : 05/11/2014
Atualmente o RM gerencia os itens de Orçamento de maneira peculiar.
View gist:ed86f443b9a8ae98848fc758876be539
declare
cursor c1 is
SELECT DISTINCT P.IDLANCAMENTO,
P.IDPARTIDA,
M.IDMOV,
M.TIPO,
M.CODCONTA AS CONTA_MOV,
CPRD.CODCONTA AS CONTA_PRD,
M.VALOR AS VALOR_CONTABIL,
PRD.CODCONTAGER AS CONTA_GERENCIAL_PRD,
@alphabraga
alphabraga / index.php
Created Mar 5, 2015
Simples exemplo de como usar o respect/validation não utilize isso em produção!
View index.php
<!DOCTYPE html>
<html>
<meta charset="UTF8" />
<head>
<title>Login</title>
</head>
<body>
<?php
require 'vendor/autoload.php';
@alphabraga
alphabraga / files_backup.sh
Last active Aug 29, 2015
BACKUP DE ARQUIVOS DO SITE
View files_backup.sh
#!/bin/bash
#Esse simples script realiza o ZIP dos arquivos de uma determinada pasta e
#em seguida os envia via rsync para um outro servidor.
#É necessário que em sua maquina você tenha instalado o rysnc
#É necessário também a criação de uma chave ssh para que não seja necessário a digitação de senha
echo "Iniciando compressão de arquivos da pasta de uploads";
zip -9 -r /root/files-backup/backup-arquivos-site-`date +"%d_%m_%Y"`.zip /var/www/html/site/public/files;
@alphabraga
alphabraga / mssql_connect.php
Created Feb 28, 2014
Simple code for connect with mssql
View mssql_connect.php
error_reporting(-1);
ini_set('display_errors', 'On');
ini_set("display_errors",1);
ini_set("error_reporting",E_ALL);
$conn = mssql_connect('localhost','user', 'pass');
mssql_select_db('database', $conn);
View gist:8617338
<?xml version="1.0" encoding="UTF-8"?>
<project name="DB Post Deploy Restore" default="run">
<property file="properties" />
<!-- find out what db's need to be restored and loop through the process for each -->
<target name="run">
<input propertyname="production.user">(Required) Please enter your ssh user name:</input>
<foreach list="${dbs}" param="db" target="prepare" />
@alphabraga
alphabraga / consertar tabelas com problemas
Last active Jan 3, 2016
Use o comando para otimizar as tabeles de todos os bancos de dados
View consertar tabelas com problemas
mysqlcheck -A -o -u username -p databasename
mysqlcheck --all-databases -o -u username -p databasename
mysqlcheck --all-databases -o -u username -p
@alphabraga
alphabraga / build.xml
Created Jan 6, 2014
Example of build.xml for deploy an php web application. Unit tests API Docs Composer install Compress Send code to server
View build.xml
<?xml version="1.0" encoding="UTF-8" ?>
<project name="ProjectName" basedir="." default="build">
<property name="project-name" value="ProjectName" />
<property name="tag-name" value="." />
<property name="dir-build" value="./build" />
<property name="dir-tests" value="tests" />
<property name="dir-tests-logs" value="tests/_reports" />
<property name="dir-logs" value="./build/logs" />
<property name="dir-app" value="./core" />
View gist:7798497
git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
You can’t perform that action at this time.