Skip to content

Instantly share code, notes, and snippets.

View hugofcampos's full-sized avatar
:octocat:

Hugo Campos hugofcampos

:octocat:
View GitHub Profile
@hugofcampos
hugofcampos / CakePHP I18n extract
Created December 17, 2013 18:59
CakePHP I18n extract
../Vendor/bin/cake i18n extract --exclude Test,Vendor --extract-core no --overwrite
@hugofcampos
hugofcampos / ubuntu-nvidea-fix
Created February 27, 2014 14:24
Ubuntu fixing NVidea driver crashes
sudo apt-get install linux-source
sudo apt-get install linux-headers-generic
sudo apt-get install linux-image
sudo apt-get install nvidia-current
jockey-text -e xorg:nvidia_current
sudo reboot
@hugofcampos
hugofcampos / boxfile-cakephp
Created March 7, 2014 18:32
Boxfile for CakePHP
web1:
# App settings
name: raiox
shared_writable_dirs:
- raiox/tmp/logs
- raiox/tmp/cache
- raiox/tmp/sessions
- raiox/tmp/tests
# Apache settings
@hugofcampos
hugofcampos / export-data-from-mysql
Created March 13, 2014 22:25
Export data from mysql
#!/bin/bash
host=''
database=''
user=''
password=''
file_dir=''
echo 'Exporting MySQL data'
mysqldump \
@hugofcampos
hugofcampos / import-mysql-data
Created March 13, 2014 22:27
Import MySQL data
#!/bin/bash
host=''
database=''
user=''
password=''
file_dir=''
echo 'Importing MySQL data'
mysql -h "$host" -u "$user" "-p$password" "$database" < $file_dir
@hugofcampos
hugofcampos / fish-shell-config
Created May 8, 2014 18:11
Fish shell configure to use with Homebrew
set PATH ~/bin $PATH
set PATH /usr/local/bin $PATH
#PHP 5.5 (brew install php55)
set PATH /usr/local/Cellar/php55/5.5.12/bin $PATH
@hugofcampos
hugofcampos / sublime-text-user-settings.json
Last active March 27, 2019 13:29
Sublime Text User Settings
{
"bold_folder_labels": true,
"color_scheme": "Packages/Dracula Color Scheme/Dracula.tmTheme",
"copy_with_empty_selection": false,
"ensure_newline_at_eof_on_save": true,
"font_options": "subpixel_antialias",
"font_size": 14,
"highlight_line": true,
"ignored_packages":
[
// FROM: http://www.mongodb.org/display/DOCS/Updating#Updating-update%28%29
//
// db.collection.update( criteria, objNew, upsert, multi )
// criteria - query which selects the record to update;
// objNew - updated object or $ operators (e.g., $inc) which manipulate the object
// upsert - if this should be an "upsert"; that is, if the record does not exist, insert it
// multi - if all documents matching criteria should be updated
//
// SQL VERSION:
// UPDATE myTable SET dateField = '2011-01-01' WHERE condField = 'condValue'
@hugofcampos
hugofcampos / run-mysql-dump-with-progress-bar
Last active August 29, 2015 14:10
Run MySQL Dump with progress bar
#install pv: sudo apt-get install pv
pv <file>.sql.bz2 | bunzip2 -c | mysql --host <host> -u admin -p ingresse
@hugofcampos
hugofcampos / .bash_aliases
Created July 7, 2015 14:03
Puphpet Bash Aliases
if [ -f /etc/bash_completion ]; then
source /etc/bash_completion
fi
__has_parent_dir () {
# Utility function so we can test for things like .git/.hg without firing up a
# separate process
test -d "$1" && return 0;
current="."