Skip to content

Instantly share code, notes, and snippets.

View carlosipe's full-sized avatar
⛰️
🪂

Carlos I. Peña carlosipe

⛰️
🪂
View GitHub Profile
curl -sSL https://get.docker.com/ | sh
sudo bash
curl -L https://github.com/docker/compose/releases/download/1.4.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
#https://docs.docker.com/compose/
docker run --name phpmyadmin-mysql -e MYSQL_ROOT_PASSWORD=password -d mysql
Start PHPMyAdmin
docker run -d --link phpmyadmin-mysql:mysql -e MYSQL_USERNAME=root --name phpmyadmin -p 80 corbinu/docker-phpmyadmin
http://davidmburke.com/2014/09/26/docker-in-dev-and-in-production-a-complete-and-diy-guide/
@carlosipe
carlosipe / gist:06e233e67a358d4ae013
Created November 18, 2015 03:59
markdown to pdf (or html)
pandoc README.md -o readme-pandoc.pdf
ssh -R 19999:localhost:22 [email protected] # ssh localhost -p 19999
@carlosipe
carlosipe / flatten.rb
Created July 9, 2016 10:43
Array flatten
def flatten(arr)
return [arr] unless arr.respond_to?(:each)
arr.reduce([]) {|result, x| result + flatten(x)}
end
# It fails miserably when arr is a recursive array, v.g:
# x = [] ; x << x ; flatten(x) ==> SystemStackError: stack level too deep
# Anyway what are you using recursive arrays for? Depending on the case,
# the flatten method should be modified to handle those cases.
image.clean
slices = image.recortar(..)
slices.map {|slice| identificar(slice)}.join
@carlosipe
carlosipe / logrotate
Created August 9, 2016 23:44
Log rotate
# http://juhomi.com/blog/2015/3/4/how-to-rotate-log-files-in-your-rails-application
cd /etc/logrotate.d
vi hello_world
# copy this content over
<path_to_rails_app>/log/production.log {
daily
size 100M
missingok
notifempty
@carlosipe
carlosipe / vim-ruby-command-t-install.markdown
Created August 10, 2016 10:32 — forked from jwieringa/vim-ruby-command-t-install.markdown
Install Vim with Ruby Interpreter and Command-T on Ubuntu

Summary

The following instructions will install Vim with the Ruby interpreter and Command-T. I keep my vim settings under revision control, thus I have chosen to use Git's submodules and Pathogen to manage Command-T. Depending on your preferences, you may want to setup Command-T differently. I recommend reading through the Command-T Readme

Install dependencies (what my system required), hg, and rake

sudo apt-get install ruby ruby-dev libncurses5-dev mercurial clone build-essential rake

I chose to compile vim with my system Ruby, 1.8.7. It is important that you use the same version to compile both Vim and Command-T. If your using RVM and you want to do the same, before proceeding you will want to:

rvm use system