Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Juan Roa roadev

🎯
Focusing
View GitHub Profile
@roadev
roadev / rails_server_output_merit.rb
Created Aug 1, 2015
My view doesn't show the corrent amount of earned points - merit gem
View rails_server_output_merit.rb
Started POST "/solucions" for 127.0.0.1 at 2015-08-01 00:05:47 -0500
ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
Processing by SolucionsController#create as HTML
Parameters: {"utf8"=>"✓", "authenticity_token"=>"S2gf6bbCbA33KY2NNTk3F3lnBcwOFUuk0jJHgKLY3D0=", "solucion"=>{"micropost_id"=>"1", "solucion"=>"This is the content"}, "commit"=>"Crear Solución"}
User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = 1 ORDER BY "users"."id" ASC LIMIT 1
/home/jroa/.rvm/gems/ruby-2.2.1/gems/activerecord-4.0.4/lib/active_record/associations/has_many_association.rb:76: warning: circular argument reference - reflection
/home/jroa/.rvm/gems/ruby-2.2.1/gems/activerecord-4.0.4/lib/active_record/associations/has_many_association.rb:80: warning: circular argument reference - reflection
/home/jroa/.rvm/gems/ruby-2.2.1/gems/activerecord-4.0.4/lib/active_record/associations/has_many_association.rb:84: warning: circular argument reference - reflection
/home/j
View problem
# Emails are "examples" for security reasons"
Sent mail to email@gmail.com (62.7ms)
Date: Mon, 03 Aug 2015 04:43:59 +0000
From: postmaster@domain.org
To: email@gmail.com
Message-ID: <55bef18f8dbf6_33ff4eacb9e9476ed@268869cd-5732-4ba4-ade9-c53f70250a53.mail>
Subject: Success! You did it.
Mime-Version: 1.0
Content-Type: text/plain;
@roadev
roadev / user.rb
Last active Aug 29, 2015 — forked from benoror/user.rb
devise_invitable: Confirm after set password
View user.rb
class User < ActiveRecord::Base
devise :invitable, :database_authenticatable, :registerable, :recoverable,
:rememberable, :confirmable, :validatable, :encryptable
# ...
# devise confirm! method overriden
def confirm!
welcome_message
super
@roadev
roadev / reset.css
Created Oct 22, 2015 — forked from marulango/reset.css
Hoja de estilo para eliminar inconsistencias a través de navegadores
View reset.css
/* http://meyerweb.com/eric/tools/css/reset/
v2.0 | 20110126
License: none (public domain)
*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
@roadev
roadev / apple-mq.css
Created Jan 1, 2016 — forked from AllThingsSmitty/apple-mq.css
iPhone 6/6 Plus and Apple Watch CSS media queries
View apple-mq.css
/* iPhone 6 landscape */
@media only screen and (min-device-width: 375px)
and (max-device-width: 667px)
and (orientation: landscape)
and (-webkit-min-device-pixel-ratio: 2)
{ }
/* iPhone 6 portrait */
@media only screen
and (min-device-width: 375px)
@roadev
roadev / post-commit_hook.md
Last active Apr 1, 2021
Post-commit hook for git - Spanish
View post-commit_hook.md

Aquí explicaré cómo automatizar tareas con hooks de git, en éste caso específico, después de hacer commit.

Como ejemplo, se realizará un push automático al remoto cuando se realice un commit.

En nuestro projecto git, accedemos a la carpeta oculta .git

cd .git

luego accedemos a hooks:

@roadev
roadev / deploy-sh__git.md
Created Jan 7, 2016
Automatizar deploy a servidor (VPS) con git
View deploy-sh__git.md

Aquí explicaré cómo realizar un deploy automático en servidor (VPS de DigitalOcean). Realizaremos un push primero a github y necesitaremos una conexión ssh para poder jalar automáticamente desde el servidor de deploy. Para comenzar, debemos tener nuestra llave ssh agregada en github, así que seguimos los siguientes pasos (ésto si nunca lo hemos hecho...).

En nuestro equipo, ejecutamos:

ssh-keygen

Con ello generamos una clave ssh en nuestro directorio home, si ya la tenemos la terminal les preguntará si quieren sobre-escribir la llave. Elegimos según corresponda (nota, si ya está generada, tener en cuenta si se ha usado con otros servidores o para otro tipo de autenticación...). Nos pedirá una passphrase, la cuál no es más que una contraseña segura que deseemos colocarle a nuestra llave privada.

@roadev
roadev / a.md
Created Jan 19, 2016 — forked from danharper/a.md
Laravel Queue Supervisor
View a.md

Install Supervisor with sudo apt-get install supervisor. Ensure it's started with sudo service supervisor restart.

In /etc/supervisord/conf.d/ create a .conf file. In this example, laravel_queue.conf (contents below). Give it execute permissions: chmod +x laravel_queue.conf.

This file points at /usr/local/bin/run_queue.sh, so create that file there. Give this execute permissions, too: chmod +x run_queue.sh.

Now update Supervisor with: sudo supervisorctl reread. And start using those changes with: sudo supervisorctl update.

View keybase.md

Keybase proof

I hereby claim:

  • I am roadev on github.
  • I am roadev (https://keybase.io/roadev) on keybase.
  • I have a public key ASAfXOThX2pFu8iWyDfwCuTlpKR1t8IYVzPkMrECzXK7Ugo

To claim this, I am signing this object:

@roadev
roadev / bluetooth_serial.md
Last active Apr 1, 2016 — forked from 0/bluetooth_serial.md
Connecting a Bluetooth device for serial communication on Arch Linux.
View bluetooth_serial.md

The following are instructions for connecting a Bluetooth device for serial communication on Arch Linux using BlueZ 5.31.

Prerequisites

The following packages are required:

  • bluez: bluetoothd
  • bluez-utils: bluetoothctl, rfcomm