Skip to content

Instantly share code, notes, and snippets.

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

Andrés Duarte M. aduartem

🏠
Working from home
View GitHub Profile
@aduartem
aduartem / curso_rails.md
Last active May 21, 2022 19:36
Curso de Ruby on Rails 4 desde cero

Curso de Ruby on Rails 4 desde cero

Instalar RVM, Ruby 2.3.0 y Ruby on Rails 4.2.6 en OS X El Capitan

Antes de comenzar es necesario tener instalado Xcode y Homebrew.

Xcode se puede instalar desde la App Store

Homebrew es un gestor de paquetes para OS X.

@aduartem
aduartem / xdebug.md
Last active May 21, 2022 19:37
Debug de código PHP con Xdebug y Netbeans

Debug de código PHP con XDebug y Netbeans

Requisitos

  • Tener instalado php
  • Tener instalador un web server (Apache o Nginx)

Mac OS X - El Capitan

Instalar Netbeans con soporte para PHP

@aduartem
aduartem / downgrade_php7.md
Created August 19, 2016 02:15
Downgrade de php7 a php5.6 en Ubuntu 16.04

Downgrade de php7 a php5.6 en Ubuntu 16.04

Update

$ sudo a2dismod proxy_fcgi proxy
$ sudo service apache2 restart

Reinstalar php 5.6

@aduartem
aduartem / request_headers_helper.php
Created August 24, 2016 00:05
PHP - Apache Request Headers Helper
<?php
if( !function_exists('apache_request_headers') ) {
function apache_request_headers() {
$arh = array();
$rx_http = '/\AHTTP_/';
foreach($_SERVER as $key => $val) {
if( preg_match($rx_http, $key) ) {
$arh_key = preg_replace($rx_http, '', $key);
@aduartem
aduartem / .vimrc
Created August 30, 2016 00:04
.vimrc for developers
set enc=utf-8
set fenc=utf-8
set termencoding=utf-8
set nocompatible
set autoindent
set smartindent
set expandtab
set tabstop=2
set shiftwidth=2
set textwidth=120
@aduartem
aduartem / .vimrc
Created August 31, 2016 07:31
Config .vimrc + plugins
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
call vundle#begin()
Plugin 'Vundle.vim'
Plugin 'git@github.com:tomasr/molokai.git'
Plugin 'git@github.com:scrooloose/nerdtree.git'
@aduartem
aduartem / upload.js
Created September 6, 2016 13:43
Subir archivo con jQuery utilizando AJAX
$("#btn-upload").on('click',function () {
e.preventDefault();
var self = this;
$('#btn-upload').prop('disabled', true);
var data = new FormData(document.forms.namedItem('frm_upload'));
$.ajax({
url: '/documentos',
dataType: 'json',
method: 'POST',
@aduartem
aduartem / svn.md
Created October 6, 2016 14:39
Subversion por línea de comandos (SVN)

SVN Workflow Básico

  1. Realizar una copia local del repositorio (working copy) (svn checkout svn://svnrepo/ejemplo {destino})
  2. Agregar/Modificar archivos
  3. Revisar el status (svn status)
  4. Revisar si hay diferencia entre los archivos locales y el repositorio remoto (svn diff {archivo})
  5. Agregar los archivos nuevos (svn add {archivo1 archivo2...})
  6. Revisar el status (svn status)
  7. Actualizar copia local (svn update)
  8. Revisar diferencias y corregir conflictos
@aduartem
aduartem / useradd.sh
Created October 8, 2016 20:10
Herramienta para crear usuario en Debian
#!/bin/bash
# Autor: Andrés Duarte M.
# Crear usuario en linux
echo "Ingresa nombre de usuario:"
read user
useradd $user
passwd $user
@aduartem
aduartem / temas_sublime.md
Last active May 21, 2022 19:00
Los mejores temas para Sublime Text

Los mejores temas para sublime text 3

  • Material Theme
  • Theme - Spacegray
  • Boxy
  • Agila
  • Lanzhou
  • Sunrise
  • Kronuz
  • Autumn