Skip to content

Instantly share code, notes, and snippets.

View gvsrepins's full-sized avatar

Gabriel Silva gvsrepins

View GitHub Profile
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your
@gvsrepins
gvsrepins / .gitconfig
Last active August 29, 2015 13:58 — forked from pksunkara/config
[user]
name = Gabriel Vitor
email = [email protected]
[core]
editor = vim
whitespace = fix,-indent-with-non-tab,trailing-space,cr-at-eol
excludesfile = ~/.gitignore
[sendemail]
smtpencryption = tls
smtpserver = smtp.gmail.com
@gvsrepins
gvsrepins / gist:5713610
Created June 5, 2013 12:47
Import a dabase from the comand line with a sql.gz file.
zcat /path/to/file.sql.gz | mysql -u 'root' -p your_database
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@gvsrepins
gvsrepins / snippet.xml
Last active September 25, 2018 00:03 — forked from JeffreyWay/snippet.xml
Laravel Resource - Sublime Text 2 Snippet
<snippet>
<content><![CDATA[
// ${1} Resource
Route::get('${1}s', array('as' => '${1}s', 'uses' => '${1}s@index'));
Route::get('${1}s/(:any)', array('as' => '${1}', 'uses' => '${1}s@show'));
Route::get('${1}s/new', array('as' => 'new_${1}', 'uses' => '${1}s@new'));
Route::get('${1}s/(:any)/edit', array('as' => 'edit_${1}', 'uses' => '${1}s@edit'));
Route::post('${1}s', '${1}s@create');
Route::put('${1}s/(:any)', '${1}s@update');
Route::delete('${1}s/(:any)', '${1}s@destroy');
@gvsrepins
gvsrepins / Conf vhost.conf
Created November 14, 2012 00:33
Conf:VHost Configuration File
<VirtualHost *:80>
ServerAdmin user@server
DocumentRoot /var/www/project
ServerName project.local
# This should be omitted in the production environment
SetEnv APPLICATION_ENV development
<Directory /var/www/project>
Options Indexes MultiViews FollowSymLinks
@gvsrepins
gvsrepins / mysql-backup-dbs.sh
Created November 4, 2012 15:42
SSH:MySQL Backup
#!/bin/bash
# This script backups every MySQL database to its own file
#Some variables you can set how you like
USER='username'
PASSWORD='password'
OUTPUTDIR='/var/backup'
MYSQLDUMP='/usr/bin/mysqldump'
MYSQL='/usr/bin/mysql'