Skip to content

Instantly share code, notes, and snippets.

@cgiovanii
cgiovanii / CSS-Pure-Flat-iPhone-5S.markdown
Created December 1, 2014 01:23
CSS Pure Flat iPhone 5S
@cgiovanii
cgiovanii / Pure-CSS-browser-mockups.markdown
Created December 1, 2014 00:26
Pure CSS browser mockups
@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>
@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 / 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 / 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 / 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 / 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 / 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;