Skip to content

Instantly share code, notes, and snippets.

View BernardoSilva's full-sized avatar
🏠
Working from home

Bernardo Vieira da Silva BernardoSilva

🏠
Working from home
View GitHub Profile
@BernardoSilva
BernardoSilva / mongod
Created July 24, 2014 15:25
Service to start mongodb daemon
#!/bin/sh
#
# init.d script with LSB support.
#
# Copyright (c) 2007 Javier Fernandez-Sanguino <[email protected]>
#
# This is free software; you may redistribute it and/or modify
# it under the terms of the GNU General Public License as
# published by the Free Software Foundation; either version 2,
# or (at your option) any later version.
@BernardoSilva
BernardoSilva / .bash_profile_for_mac
Last active August 29, 2015 14:06
Mac OSX Developper shortcuts
# Config for MAMP
export PATH=/Applications/MAMP/bin/php/php5.5.10/bin:$PATH
# Show hidden files
alias showFiles="defaults write com.apple.finder AppleShowAllFiles YES; killall Finder /System/Library/CoreServices/Finder.app"
# Hide hidden files
alias hideFiles="defaults write com.apple.finder AppleShowAllFiles NO; killall Finder /System/Library/CoreServices/Finder.app"
# Git
alias gs="git status"
@BernardoSilva
BernardoSilva / Package Control.sublime-settings
Last active April 25, 2018 09:03
Sublime Text Best extensions for web developer
{
"bootstrapped": true,
"in_process_packages":
[
],
"installed_packages":
[
"A File Icon",
"Boxy Theme",
"Boxy Theme Addon - Font Face",
@BernardoSilva
BernardoSilva / how_to_use_facebook_symfony2
Last active August 29, 2015 14:08
Facebook SKD 4.0 example on Symfony 2.5
###PHP requirements to be able to use php SDK
- php-mbstring
In Centos you can install this php-module like this:
```bash
$ yum install php-mbstring
```
###Symfony changes required:
In your config.yml need to change the session handler
@BernardoSilva
BernardoSilva / how_to_remove_vagrant_password_prompt
Last active August 29, 2015 14:08
How to remove vagrant up password prompt
# This is working for vagrant 1.6.x
# If you have any problems, add a comment.
$ sudo visudo
# Paste this and save.
# let vagrant set up NFS shares without password prompt
Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/tee -a /etc/exports
Cmnd_Alias VAGRANT_NFSD = /sbin/nfsd restart
#!/bin/bash
# GTK+ and Firefox for Amazon Linux
# Written by Joseph Lawson 2012-06-03
# http://joekiller.com
# http://joekiller.com/2012/06/03/install-firefox-on-amazon-linux-x86_64-compiling-gtk/
# chmod 755 ./gtk-firefox.sh
# sudo ./gtk-firefox.sh
@BernardoSilva
BernardoSilva / optimize_git.sh
Last active May 2, 2020 18:34
Optimize your git performance on MAC OS X tips
# Highlight hash commit.
git config --global color.ui true
# Set opendiff as predefined tool to open while merging.
git config --global merge.tool opendiff
# Set alias for `git status` to `git st`.
git config --global alias.st status
# Shorter git status messages.
git config --global alias.s "status -s"
git config --global alias.co checkout
git config --global alias.br branch
@BernardoSilva
BernardoSilva / install_mcrypt.sh
Last active August 29, 2015 14:10 — forked from phillpafford/install_mcrypt.sh
Compile and install mcrypt.so PHP extension for Mac OS X Mountain Lion, Yosemite
#!/usr/bin/sh
# NOTE: To execute this script: bash install_mcrypt.sh
# Pre Reqs, These are important!!!
# Install xCode
# Launch xCode and open Preferences
# Select the Downloads Tab in the Preference Panel
# Under Components install Command Line Tools
@BernardoSilva
BernardoSilva / install_git_autocomplete.sh
Created December 16, 2014 19:02
Install git autocomplete
#!/bin/bash
# Download the magic file.
curl https://raw.githubusercontent.com/git/git/master/contrib/completion/git-completion.bash -o ~/.git-completion.bash
# Add to ~/.bash_profile file the following 'execute if it exists' code:
cat <<EOT >> ~/.bash_profile
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
fi
@BernardoSilva
BernardoSilva / .editorconfig
Last active February 3, 2016 23:44
Javascript .editorconfig
# EditorConfig helps developers define and maintain consistent
# coding styles between different editors and IDEs
# editorconfig.org
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf