Skip to content

Instantly share code, notes, and snippets.

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

William Wong Garay willywg

🏠
Working from home
View GitHub Profile
@czarneckid
czarneckid / Rails 4 Upgrade Notes.md
Created August 28, 2013 05:05
Rails 4 Upgrade Notes

Rails 4 Upgrade Notes

I recently completed our upgrade to Rails 4. Below are various notes and links that may help you if you are upgrading your application to Rails 4. YMMV.

Overview

There is a good Rails Guide on upgrading, with a specific section on upgrading from Rails 3.2 to Rails 4.0. First, a bit about our specific application and the technologies used, pre-Rails 4 upgrade:

  • Rails 3.2.14
  • Ruby 2.0.0-p247
@jjb
jjb / gist:950975
Created May 1, 2011 23:16
Using whenever with capistrano and bundler in multiple environments
We couldn’t find that file to show.
@willywg
willywg / devise_helper.rb
Last active November 5, 2016 15:46 — forked from seyhunak/devise_helper.rb
Devise Error Messages with Bootstrap 3 style
# /app/helpers/devise_helper.rb
module DeviseHelper
def devise_error_messages!
return '' if resource.errors.empty?
messages = resource.errors.full_messages.map { |msg| content_tag(:li, msg) }.join
sentence = I18n.t('errors.messages.not_saved',
count: resource.errors.count,
resource: resource.class.model_name.human.downcase)
@willywg
willywg / image_magick_install_centos_6
Last active July 28, 2018 13:37
Instalando ImageMagick y rmagick en Centos 6
1. Desinstalar todo rastro de ImageMagick e ImageMagik-devel
sudo yum remove ImageMagick
sudo yum remove ImageMagick-devel
2. Instalar complementos previos:
sudo yum install tcl-devel libpng-devel libjpeg-devel ghostscript-devel bzip2-devel freetype-devel libtiff-devel
3. Bajarse el ImageMagick desde las fuentes:
mkdir ~/sources
cd ~/sources
@Sebfh
Sebfh / gist:4585872
Last active September 26, 2018 20:14
javascript number to currency á la rails
function number_to_currency(number, options) {
try {
var options = options || {};
var precision = options["precision"] || 2;
var unit = options["unit"] || "\u20AC";
var separator = precision > 0 ? options["separator"] || "." : "";
var delimiter = options["delimiter"] || ",";
var parts = parseFloat(number).toFixed(precision).split('.');
return unit + number_with_delimiter(parts[0], delimiter) + separator + parts[1].toString();
@jhjguxin
jhjguxin / how_to_concerns.md
Last active November 28, 2018 17:16 — forked from dhh/gist:1014971
how to concerns with rails 3
@willywg
willywg / devise.es.yml
Created August 9, 2011 12:38
devise I18n file in spanish for devise 1.4.2
# Additional translations at http://github.com/plataformatec/devise/wiki/I18n
# Translation by William Wong Garay (willywg) https://github.com/willywg
es:
errors:
messages:
expired: "ha expirado, por favor solicita una nueva"
not_found: "no se encontró"
already_confirmed: "ya fue confirmado, por favor intenta iniciar sesión"
not_locked: "no estaba bloqueado"
@rothgar
rothgar / install-tmux
Last active April 5, 2023 06:53 — forked from ekiara/how_to_install_tmux_on_centos
Install tmux 1.9 on rhel/centos 6
# Install tmux on Centos release 6.5
# install deps
yum install gcc kernel-devel make ncurses-devel
# DOWNLOAD SOURCES FOR LIBEVENT AND MAKE AND INSTALL
curl -OL https://github.com/downloads/libevent/libevent/libevent-2.0.21-stable.tar.gz
tar -xvzf libevent-2.0.21-stable.tar.gz
cd libevent-2.0.21-stable
./configure --prefix=/usr/local
@zentetsukenz
zentetsukenz / ruby_on_rails_deployment.md
Last active September 22, 2023 18:32
Deploy Ruby on Rails application with Docker Compose and Capistrano with ease

Docker

Files and Folders.

|
|\_ app
|...
|\_ docker
| |
@sr75
sr75 / run-ie-7-8-9-virtualbox-on-osx.txt
Created March 15, 2012 13:52
Run IE 7, 8, and 9 in Mac OS X
# the admin password for all of the IE VMs is “Password1″ without the quotes, it's also used for the password hints
1) Install VirtuaBox on your mac
http://download.virtualbox.org/virtualbox/4.1.10/VirtualBox-4.1.10-76795-OSX.dmg
2) Decide which versions of Internet Explorer you want to download and install – each version of Internet Explorer is contained within a separate virtual machine that runs within VirtualBox. In other words, if you want to run Internet Explorer 7, 8, and 9, you will need to download three separate VM’s, which may take a while so keep that in mind. Select the text below and copy it:
# Install ALL versions of Internet Explorer: IE 7, IE 8, and IE 9 (for now this script will also pull down a IE 6 vm with windows xp)