Skip to content

Instantly share code, notes, and snippets.

@cgiovanii
cgiovanii / ir.css
Last active January 17, 2019 17:05
Css: Image replacement
.ir { /*Image replacement */
border:0;
font: 0/0 a;
color:transparent;
background-color: transparent;
}
@cgiovanii
cgiovanii / bones
Created November 4, 2013 12:58
php: bones_head_cleanup
/*********************
WP_HEAD GOODNESS
The default wordpress head is
a mess. Let's clean it up by
removing all the junk we don't
need.
*********************/
function bones_head_cleanup() {
// category feeds
@cgiovanii
cgiovanii / laravel_migration_tutorial.md
Last active September 1, 2018 23:24
laravel: Comandos migrate do artisan para criar tabelas

Criar tabelas com o artisan:migrate

php artisan migrate:make create_filmes_table --table=filmes --create

/app/database/migrations/xxx_create_filmes_table.php
<?php

use Illuminate\Database\Schema\Blueprint;
@cgiovanii
cgiovanii / gist:7482543
Last active December 28, 2015 09:59
Markdown: Cheat Sheet

Header 1

Header 2

Header 3 ### (Hashes on right are optional)

Header 4

Header 5

Markdown plus h2 with a custom ID ## {#id-goes-here}

Link back to H2

This is a paragraph, which is text surrounded by whitespace. Paragraphs can be on one

@cgiovanii
cgiovanii / bootstrap.sh
Last active December 30, 2015 13:09
Vagrant: bootstrap.sh
#!/usr/bin/env bash
#----------------------------------------------------
# Minimal installation of LAMP on Vagrant box on up!
#----------------------------------------------------
apt-get update
apt-get install -y apache2 vim mc htop bmon git curl iftop
apt-get install -y php5 php5-mcrypt
apt-get install -y mysql-server php5-mysql
#----------------------------------------------------
# Create a sylink for batcave :) (Vagrant Home/Shared Folder) to /var/www
@cgiovanii
cgiovanii / bash_aliases
Last active October 22, 2016 22:19
Shell: bash_aliases
# ---------------------------
# Autor: giovani Oliveira
# Data: 20-10-2016.
#-------------------------------------------------------
# Enable aliases to be sudo’ed
#-------------------------------------------------------
alias sudo='sudo '
#-------------------------------------------------------
@cgiovanii
cgiovanii / bashrc
Last active October 21, 2016 11:23
Shell: bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
#Suporte ao Git:
source ~/.git-completion.bash #https://github.com/git/git/blob/master/contrib/completion/git-completion.bash
source ~/.git-prompt.sh #https://github.com/git/git/blob/master/contrib/completion/git-prompt.sh
# If not running interactively, don't do anything
[ -z "$PS1" ] && return
@cgiovanii
cgiovanii / bs3_table_macro.php
Created April 20, 2014 21:20
Bootstrap 3 Table Editable
// Macro
HTML::macro('table', function($fields = array(), $data = array(), $resource, $showEdit = true, $showDelete = true, $showView = true){
$table = '<table class="table table-bordered">';
$table .='<tr>';
if ($showEdit || $showDelete || $showView )
$table .= '<th></th>';
foreach ($fields as $field)
{
$table .= '<th>' . Str::title($field) . '</th>';
@cgiovanii
cgiovanii / auto_menu_macro.php
Created April 20, 2014 21:34
Generate navigation menu's using unordered lists: Generate navigation menu's that look clean using a custom class HTML::nav(); Automatically set active state, use conditions to display links, and optionally pass only one value for both url and link name if you want to type a little less.
/*
We will create a navigation menu like this:
{{ HTML::nav(array('login', 'register', 'wiki', 'forum', '/' => 'Home')) }}
Which will output:
<ul>
<li><a href="yourdomain.com/login" class="active">Login</a></li>
<li><a href="yourdomain.com/register">Register</a></li>
<li><a href="yourdomain.com/wiki">Wiki</a></li>
<li><a href="yourdomain.com/forum">Forum</a></li>