Skip to content

Instantly share code, notes, and snippets.

View esilvas's full-sized avatar

Emilio Silvas esilvas

View GitHub Profile
@esilvas
esilvas / mountain-lion-brew-setup.markdown
Created July 30, 2012 00:24 — forked from myobie/mountain-lion-brew-setup.markdown
Fix Homebrew after Mountain Lion Upgrade

Get Mountain Lion and Homebrew to Be Happy

1) Install XCode 4.4 into /Applications

Get it from http://developer.apple.com. You will not be able to submit apps to any stores using this XCode version, so turn away if that is something you might want to do.

2) Install Command Line Tools

In XCode's Preferences > Downloads you can install command line tools.

@esilvas
esilvas / enable-php-short-tags.markdown
Created July 30, 2012 02:59
Enable PHP Short Tags

PHP Short Tags

Go to your php.ini file and set:

short_open_tag=On

Restart Apache and start using PHP short tags.

@esilvas
esilvas / useful-git-commands.markdown
Created July 31, 2012 12:37
Useful Git Commands

Useful Git Commands

Setup Git Global Variables

Copied from Github: https://help.github.com/articles/set-up-git

Tell git your name:

$git config --global user.name "Your Name Here"
# Sets the default name for git to use when you commit

Tell git your email address:

@esilvas
esilvas / mysql-import.markdown
Created September 7, 2012 12:52
Import MySQL Files

Import MySQL Database File (large or small)

MySQL Prompt

In order to import data dump files, I have started using the native MySQL import feature from within the application.

Login to MySQL:

$ mysql -umyuser -pmypassword
@esilvas
esilvas / Word-wrap.markdown
Created December 12, 2012 15:36
Word wrap with new-lines
public function pdf_word_wrap( $text = '', $line_length = 60 )
{
	    if($text) 
	    {
        $tmp_text = '';
		    $tmp_text_array = array();

		    $total_chars = strlen($text);
		    $text_array = explode(' ', $text);
@esilvas
esilvas / postgres-create-list-role.markdown
Last active December 26, 2015 02:59
Postgres create role/user and generate list

CREATE USER davide WITH PASSWORD 'jw8s0F4';

SELECT rolname FROM pg_roles;