Skip to content

Instantly share code, notes, and snippets.

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

George Mejia geoom

🏠
Working from home
View GitHub Profile
@geoom
geoom / chrome install
Created August 6, 2014 09:27
Install browsers on ubuntu 12.04
# Per http://www.ubuntuupdates.org/ppa/google_chrome
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update
sudo apt-get install google-chrome-stable
@geoom
geoom / involucrados
Last active August 29, 2015 14:04
change staging deploy
cat /etc/uwsgi/apps-enabled/royal.ini
cat /etc/nginx/sites-available/royal_production
cat /etc/supervisord.conf
cat /home/ubuntu/newrelic/newrelic.ini
@geoom
geoom / provider explain 1
Last active August 29, 2015 14:04 — forked from Mithrandir0x/gist:3639232
As a side note, service, factory, and value are all derived from provider.
// Source: https://groups.google.com/forum/#!topic/angular/hVrkvaHGOfc
// jsFiddle: http://jsfiddle.net/pkozlowski_opensource/PxdSP/14/
// author: Pawel Kozlowski
var myApp = angular.module('myApp', []);
//service style, probably the simplest one
myApp.service('helloWorldFromService', function() {
this.sayHello = function() {
return "Hello, World!"
@geoom
geoom / mysql config.txt
Last active September 9, 2015 20:29
Mysql config on ubunu 12.04
sudo apt-get install mysql-server
sudo apt-get install mysql-client
sudo apt-get install libmysqlclient-dev // for environment development
sudo /etc/init.d/mysql restart
### crear base de datos con root y asignar permisos
mysql -u root -p
Enter password:
@geoom
geoom / deploy script.rb
Last active August 29, 2015 13:57 — forked from mm53bar/deploy.rb
require File.join(File.dirname(__FILE__), 'deploy/nginx')
require File.join(File.dirname(__FILE__), 'deploy/log')
default_run_options[:pty] = true
set :ssh_options, { :forward_agent => true }
set :application, "appname"
set :repository, "git@giturl"
set :scm, :git
@geoom
geoom / new.html.erb
Created March 5, 2014 15:25
views/devise/registrations/new.html.erb
<h2>Sign up</h2>
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
<%= devise_error_messages! %>
<div><%= f.label :email %><br />
<%= f.email_field :email, :autofocus => true %></div>
<div><%= f.label :password %><br />
<%= f.password_field :password %></div>
@geoom
geoom / user.rb
Created March 4, 2014 05:14
models/user.rb
class User < ActiveRecord::Base
# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable and :omniauthable
devise :database_authenticatable, :registerable,
:recoverable, :rememberable, :trackable, :validatable
ROLES = %w[admin moderator author banned]
def roles=(roles)
self.roles_mask = (roles & ROLES).map { |r| 2**ROLES.index(r) }.inject(0, :+)
@geoom
geoom / edit.html.erb
Created March 4, 2014 05:13
views/devise/registrations/edit.html.erb
<h2>Edit <%= resource_name.to_s.humanize %></h2>
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
<%= devise_error_messages! %>
<div><%= f.label :email %><br />
<%= f.email_field :email, :autofocus => true %></div>
<% if devise_mapping.confirmable? && resource.pending_reconfirmation? %>
<div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
@geoom
geoom / install Rails on Ubuntu
Last active December 27, 2015 05:39
install Rails on Ubuntu (including ruby installing)
Primer paso:
Instalar el RVM (ruby version manager), es quien te maneja o administra las versiones de ruby y sus dependencias que hacen posible que se pueda codificar en ruby.
(cURL herramienta de transferencia de datos, para descargar el RVM de la página oficial)
$ sudo apt-get install curl
Segundo paso:
(Hacemos la descarga del RVM de la pagina oficial de http://rvm.io/)
@geoom
geoom / gist:7098367
Created October 22, 2013 10:31
Git tricks
Cambiar el author de todos los commits:
git filter-branch -f --env-filter "GIT_AUTHOR_NAME='Newname'; GIT_AUTHOR_EMAIL='newemail'; GIT_COMMITER_NAME='Newname'; GIT_COMMITTER_EMAIL='newemail';" HEAD