Skip to content

Instantly share code, notes, and snippets.

View alphabraga's full-sized avatar
🎯
Focusing

Alfredo Braga alphabraga

🎯
Focusing
View GitHub Profile
@luzfcb
luzfcb / configurar_pyenv.md
Last active May 6, 2024 19:56
instalar pyenv no ubuntu
@alphabraga
alphabraga / index.php
Created March 5, 2015 17:39
Simples exemplo de como usar o respect/validation não utilize isso em produção!
<!DOCTYPE html>
<html>
<meta charset="UTF8" />
<head>
<title>Login</title>
</head>
<body>
<?php
require 'vendor/autoload.php';
@nickbabcock
nickbabcock / graphite.conf
Last active December 6, 2019 06:18
Installs Graphite on CentOS 6
server {
listen 80;
root /opt/graphite/webapp/content;
location / {
# checks for static file, if not found proxy to app
try_files \$uri @app;
}
location @app {
@rufhausen
rufhausen / homestead_extras.sh
Last active August 11, 2021 03:33
My script for adding some "extras" (LDAP, Oracle, MSSQL, Oh-My-Zsh, etc.) to a Laravel Homestead Vagrant VM.
#!/bin/bash
apt-get update
#Additional Packages
apt-get install -y cifs-utils winbind smbclient bindfs gvfs gvfs-bin keyutils unzip php5-ldap php5-mssql zsh
wget --no-check-certificate http://install.ohmyz.sh -O - | sh
chsh vagrant -s /bin/zsh
@rufhausen
rufhausen / dbbackup.sh
Last active September 16, 2015 19:04
Local MySQL backup with "hidden" credentials. Backups over 30 days old are removed.
#!/bin/bash
#MYSQL DATABASE BACKUP
#Author: Gary Taylor <gary.taylor@du.edu>
#Credentials are stored in a separate file that you can keep them out of your repository while including the dbbackup script itself.
#Credentials Location
source $PWD/.backup.vars
#BACKUP FILE NAMING
@garrettdieckmann
garrettdieckmann / CRON job
Last active November 8, 2021 03:16
RMAN Incremental backup via BASH Cron job
[oracle@database scripts]$ crontab -l
# Perform full backup on database Sunday at 3:05 am
5 3 * * 0 /$HOME/scripts/backup_db database_name full > /$HOME/scripts/logs/full_backup.log
# Perform incremental backups on database Mon-Sat at 3:05 am
5 3 * * 1-6 /$HOME/scripts/backup_db database_name inc > /$HOME/scripts/logs/inc_backup.log
@webandphp
webandphp / gist:7548706
Last active December 28, 2015 19:09
Taken from Joey Rivera's tutorial on Phing in the December 2013 issue of Web & PHP Magazine. For more info, see http://webandphp.com/
<?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" />
@bencooling
bencooling / README.md
Last active December 19, 2015 09:29
PHP: boilerplate code for php libraries Swiftmailer, Illuminate

##php: boilerplate code for various php libraries Sample php code for php libraries found in packagist

  • Swiftmailer
@floer32
floer32 / centos_cx_Oracle
Last active January 6, 2020 23:29
CentOS 6: Set up Oracle Instant Client and Python package cx_Oracle
#!/bin/bash
# INSTALL ORACLE INSTANT CLIENT #
#################################
# NOTE: Oracle requires at least 1176 MB of swap (or something around there).
# If you are using CentOS in a VMWare VM, there's a good chance that you don't have enough by default.
# If this describes you and you need to add more swap, see the
# "Adding a Swap File to a CentOS System" section, here:
# http://www.techotopia.com/index.php/Adding_and_Managing_CentOS_Swap_Space
@alganet
alganet / tipagem_primitiva.md
Last active August 12, 2019 22:48
PHP Prático: Tipagem Primitiva

PHP Prático: Tipagem Primitiva

A primeira coisa a saber sobre a tipagem do PHP é que ela não é parecida com Java, JavaScript, Python, Ruby, C, C++, C# ou qualquer linguagem que tenha uma tipagem baseada em alguma dessas citadas. A tipagem do PHP é incomparável, e assim como tudo que não pode ser comparado é difícil de ser explicada.

De qualquer forma, a tipagem do PHP é extremamente simples se você apenas confiar na sua intuição. A primeira coisa que você tem que saber sobre a tipagem do PHP é que ela faz malabarismos. É exatamente essa a palavra: malabarismo. E o PHP é um ótimo malabarista, exceto por alguns poucos deslizes fáceis de decorar. O type juggling, traduzido para "malabarismo com tipos" é a habilidade que o PHP tem de tomar decisões intuitivas sobre conversões de tipos. Em termos grosseiros, o PHP decide toda e qualquer tipagem de variáveis em tempo de execução, não compilação (pros pedante aí que tão lendo).

Note bem: tipagem de variáveis. O PHP é multi-paradigma e, ao m