Skip to content

Instantly share code, notes, and snippets.

View ronsuez's full-sized avatar

Ronald Suez ronsuez

View GitHub Profile
@ronsuez
ronsuez / gist:27a8cbacd31830a55b99
Created December 16, 2014 13:40
git-sh-setup
Mac OSX Issue
When the Iterm throws the following error:
/usr/local/libexec/git-core/git-pull: line 11: git-sh-setup: No such file or directory
Do this:
/usr/bin/login -f <your user name>
@ronsuez
ronsuez / gitBranches.sh
Last active August 29, 2015 14:14
Git Course - Basic Usage
#!/bin/bash
git branch <new-branch> <origin-branch>
git checkout <new-branch>
echo "my new changes from <new-branch>" >> hello_world.txt
git add .
git commit -m "first commit for my new feature"
@ronsuez
ronsuez / gist:94dcff8de42851e6353b
Last active August 29, 2015 14:17
PHPExcel Basic Usage - Template importing
<?php
// Importamos la clase PHPExcel
App::import('Vendor', 'Classes/PHPExcel');
$locale = 'es';
$validLocale = PHPExcel_Settings::setLocale($locale);
if (!$validLocale) {
echo 'Unable to set locale to '.$locale." - reverting to en_us<br />\n";
}
@ronsuez
ronsuez / gist:034ab91cc0e878b6bd60
Last active August 29, 2015 14:17
PHPExcel - Read File
public function readExcel(){
// Include PHPExcel_IOFactory
App::import('Vendor', 'Classes/PHPExcel');
$inputFileName = "../Vendor/phpExcel/docs/vacas-empleados.xlsx";
// Read your Excel workbook
@ronsuez
ronsuez / reverse-proxy-conf
Created April 15, 2015 07:37
Nginx Reverse Proxy Template
server {
listen 80;
server_name server_name;
location / {
proxy_set_header Host $host;
proxy_set_header X-REAL-IP $remote_addr;
proxy_pass http://host:port/;
proxy_buffering off;
}
@ronsuez
ronsuez / steps
Created May 4, 2015 21:27
django-gunicorn-supervisord
1.- ssh into the vps
2.- create a new virtualenv
3.- clone the repository
4.- install the needed dependencies (through the requeriments file)
5.- check the database connection and then migrate the models
6.- config static folder and collectstatic
6.- configure gunicorn/supervisord
7.- configure nginx reverse proxy
@ronsuez
ronsuez / config_psql_osx
Created May 9, 2015 20:18
Config Postgresql on Yosemite OSX
After install postgresql on mac os x, generally you need to do the following things:
you need to replace the /usr/lib/libpq.5.dylib library because its version is too old.
Here's my solution to this problem:
$ sudo mv /usr/lib/libpq.5.dylib /usr/lib/libpq.5.dylib.old
$ sudo ln -s /Library/PostgreSQL/9.4/lib/libpq.5.dylib /usr/lib
@ronsuez
ronsuez / phpmyadmin.conf
Created May 10, 2015 00:39
Nginx phpmyadmin.conf file
server {
listen 443;
ssl on;
ssl_certificate /etc/nginx/ssl/server.crt;
ssl_certificate_key /etc/nginx/ssl/server.key;
server_name phpmyadmin.example.loc;
root /var/www/vhosts/pma/;
index index.php;
@ronsuez
ronsuez / install.sh
Created June 2, 2015 14:28
brew base libraries
brew install autoconf
brew install automake
brew install libtool
brew install apple-gcc42
brew install libyaml
brew install libxslt
brew install libksba
brew install openssl

Install portaudio using homebrew (or method of your choice)

brew install portaudio

create $HOME/.pydistutils.cfg using the include and lib directories of your portaudio install:

[build_ext]