Skip to content

Instantly share code, notes, and snippets.

View gonzariosm's full-sized avatar
:octocat:
Deploying

Gonzalo Ríos gonzariosm

:octocat:
Deploying
View GitHub Profile
SSHKit::Command::Failed: rake stdout: Nothing written
rake stderr: Nothing written
/usr/local/rvm/gems/ruby-2.1.1/gems/sshkit-1.3.0/lib/sshkit/command.rb:94:in `exit_status='
/usr/local/rvm/gems/ruby-2.1.1/gems/sshkit-1.3.0/lib/sshkit/backends/netssh.rb:142:in `block (4 levels) in _execute'
/usr/local/rvm/gems/ruby-2.1.1/gems/net-ssh-2.8.0/lib/net/ssh/connection/channel.rb:551:in `call'
/usr/local/rvm/gems/ruby-2.1.1/gems/net-ssh-2.8.0/lib/net/ssh/connection/channel.rb:551:in `do_request'
/usr/local/rvm/gems/ruby-2.1.1/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:561:in `channel_request'
/usr/local/rvm/gems/ruby-2.1.1/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:465:in `dispatch_incoming_packets'
/usr/local/rvm/gems/ruby-2.1.1/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:221:in `preprocess'
/usr/local/rvm/gems/ruby-2.1.1/gems/net-ssh-2.8.0/lib/net/ssh/connection/session.rb:205:in `process'
namespace :deploy do
desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
# Your restart mechanism here, for example:
execute :touch, release_path.join('tmp/restart.txt')
end
end
scope '/admin' do
get '/' => 'pages#dashboard', as: :dashboard # default admin route
resources :services
resources :clients
end
# rutas publicas del controlador leads
resources :users, only: [:new, :create], as: :users
# rutas del administrador
scope '/aac' do
get '/' => 'pages#dashboard', as: :dashboard # ruta por defecto
resources :users, only: [:index, :destroy], as: :users_adm
resources :clientes
end
# routes.rb
resources :companies do
get 'companies/list/', to: 'companies#list'
post '/select', to: 'companies#select'
end
# rails routes RETURN
company_list GET /companies/:company_id/list(.:format) companies#list
company_select POST /companies/:company_id/select(.:format) companies#select
@gonzariosm
gonzariosm / validate.js
Created November 14, 2016 17:56
Validate JS Instapage Mobile Number
ijQuery.validator.addClassRules('phone', {
required: true,
digits: true,
minlength: 2,
maxlength: 5
//min:2,
//max:8
});
var label_phone = 'Celular';
@gonzariosm
gonzariosm / script.js
Created November 14, 2016 21:11
Validación de Landing Page Instapage
ijQuery(document).ready(function() {
// TRADUCCIONES
_Translate.set( 'Processing...', 'Procesando...' );
_Translate.set( 'Please Fix These Errors', 'Por favor, corregir los siguientes errores' );
_Translate.set( 'is required.', 'es necesario.' );
_Translate.set( 'requires a valid number.', 'solo acepta dígitos.' );
ijQuery.validator.addMethod('rut', function(value, element) {
return this.optional(element) || ijQuery.Rut.validar(value);
}, 'no tiene un formato válido.');
@gonzariosm
gonzariosm / validate.js
Created November 14, 2016 23:20
Validación InstaPage con PlaceHolder Nuevo
ijQuery(document).ready(function() {
// TRADUCCIONES
_Translate.set( 'Processing...', 'Procesando...' );
_Translate.set( 'Please Fix These Errors', 'Por favor, corregir los siguientes errores' );
_Translate.set( 'is required.', 'es necesario.' );
_Translate.set( 'requires a valid number.', 'solo acepta dígitos.' );
ijQuery.validator.addMethod('rut', function(value, element) {
return this.optional(element) || ijQuery.Rut.validar(value);
}, 'no tiene un formato válido.');
<script>
var $_GET = {};
if(document.location.toString().indexOf('?') !== -1)
{
var query = document.location.toString().replace(/^.*?\?/, '').split('&');
for(var i=0, l=query.length; i<l; i++)
{
var aux = decodeURIComponent(query[i]).split('=');
$_GET[aux[0]] = aux[1];
@gonzariosm
gonzariosm / superstack.rb
Last active September 12, 2020 23:03
Hackerank Ruby Super Stack
operations = ['push 4', 'push 5', 'inc 2 1', 'pop', 'pop']
def superStack(operations)
stack = []
size = 0
operations.each do |operation|
parameters = operation.split
if parameters[0] == "push" then
stack[size] = parameters[1].to_i