Skip to content

Instantly share code, notes, and snippets.

View jesusangelm's full-sized avatar

Jesus Marin jesusangelm

View GitHub Profile
@arteezy
arteezy / puma.service
Last active April 23, 2024 00:31
Manage Puma with systemd and rbenv
[Unit]
Description=Puma Rails Server
After=network.target
[Service]
Type=simple
User=deploy
WorkingDirectory=/home/deploy/app/current
ExecStart=/home/deploy/.rbenv/bin/rbenv exec bundle exec puma -C /home/deploy/app/shared/config/puma.rb
ExecStop=/home/deploy/.rbenv/bin/rbenv exec bundle exec pumactl -S /home/deploy/app/shared/tmp/pids/puma.state stop
@rubencaro
rubencaro / install_elixir.md
Last active September 30, 2023 03:58
Elixir installation guide

Elixir installation guide

Version numbers should be the ones you want. Here I do it with the last ones available at the moment of writing.

The simplest way to install elixir is using your package manager. Sadly, at the time of writing only Fedora shows the intention to keep its packages up to date. There you can simply sudo dnf install erlang elixir and you are good to go.

Anyway, if you intend to work with several versions of erlang or elixir at the same time, or you are tied to a specific version, you will need to compile it yourself. Then asdf is your best friend.

@gmccreight
gmccreight / master.vim
Last active September 23, 2023 08:41
A script that gives you a playground for mastering vim
" copy all this into a vim buffer, save it, then...
" source the file by typing :so %
" Now the vim buffer acts like a specialized application for mastering vim
" There are two queues, Study and Known. Depending how confident you feel
" about the item you are currently learning, you can move it down several
" positions, all the way to the end of the Study queue, or to the Known
" queue.
" type ,, (that's comma comma)
@wsargent
wsargent / docker_cheat.md
Last active August 31, 2023 12:10
Docker cheat sheet
@jesusangelm
jesusangelm / cumplePOO.rb
Created January 20, 2012 21:31
Script en Ruby para felicitar a una persona por su cumpleaños - Version POO
#!/usr/bin/env ruby
#coding: utf-8
# Felicitador V2.0 POO
class Cumple
def initialize(nombre, anios)
@minombre = nombre
@mianios = anios
end
@jesusangelm
jesusangelm / cumple1.rb
Created January 20, 2012 21:29
Script en Ruby para felicitar a una persona por su cumpleaños - Version sencilla
#!/usr/bin/env ruby
# coding: utf-8
puts "Favor ingresa tu nombre"
nombre = gets.chomp
puts "#{nombre} cuantos años cumples???"
anios = gets.chomp.to_i
anios.times do |num|
puts "#{num.to_s} Feliz Cumpleaños #{nombre}!!!"
@cblunt
cblunt / Gemfile
Created October 21, 2011 08:55
Configure Carrierwave for Amazon S3 Storage and Heroku
# ...
gem 'carrierwave'
gem 'fog', '~> 1.0.0' # Need to specify version, as carrierwave references older (0.9.0) which doesn't allow configuration of Rackspace UK Auth URL
@jesusangelm
jesusangelm / MB_enviados_recibidos.rb
Created May 19, 2011 17:26
Script para obtener los Mb enviados y recibidos por una interfaz de red determinada
#Script para obtener los Mb enviados y recibidos por
#una interfaz de red determinada.
#incluye una funcion para convertir Bytes a MB
#tiene unas pequeñas fallas que pronto arreglare! :)
def bytestomb bytes
mb = bytes.to_f / (1024*1024)
mb
end
@r00k
r00k / gist:906356
Created April 6, 2011 19:33
Custom devise strategy
# In config/initializers/local_override.rb:
require 'devise/strategies/authenticatable'
module Devise
module Strategies
class LocalOverride < Authenticatable
def valid?
true
end