Skip to content

Instantly share code, notes, and snippets.

View jesusangelm's full-sized avatar

Jesus Marin jesusangelm

View GitHub Profile

Keybase proof

I hereby claim:

  • I am jesusangelm on github.
  • I am jesusangelm (https://keybase.io/jesusangelm) on keybase.
  • I have a public key whose fingerprint is 7867 1133 740C 53E5 7AD3 481E 73EF F2EC 327A 7FB0

To claim this, I am signing this object:

@jesusangelm
jesusangelm / breadcrumb.rb
Created March 2, 2015 13:49
breadcrumb adaptado para TwitterBootstrap. le falta optimizacion.
def breadcrumbs(include_home = true)
levels = request.path.split('?')[0].split('/')
levels.delete_at(0)
links = content_tag("li") { content_tag('a', "Inicio", :href => root_path ) if include_home }
nocrumb = []
levels.each_with_index do |level, index|
level = level.gsub(/^[0-9]+\-/,"") #if levels[index-1] == "photos"
level = level.gsub("-", " ")
if index+1 == levels.length
elsif !nocrumb.include?(level)
@jesusangelm
jesusangelm / skype.desktop
Created April 24, 2015 18:55
archivo skype.desktop modificado para cargar libreria v4l y hacer funcionar la camara en Kubuntu 14.04 LTS
[Desktop Entry]
Name=Skype
Comment=Skype Internet Telephony
Exec=env PULSE_LATENCY_MSEC=60 LD_PRELOAD=/usr/lib/i386-linux-gnu/libv4l/v4l1compat.so skype %U
Icon=skype.png
Terminal=false
Type=Application
Encoding=UTF-8
Categories=Network;Application;
MimeType=x-scheme-handler/skype;
@jesusangelm
jesusangelm / parser_clasificados.rb
Created May 27, 2015 14:40
Parseador que extrae los clasificados de alquiler de apartamento y casa de la web del periodico El Sol de Margarita.
require 'nokogiri'
require 'open-uri'
class ParserClasificados
def urls(type)
case type
when :apartment_rent
return "http://www.elsoldemargarita.com.ve/clasificados/index/fsection:1"
when :house_rent
@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
@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}!!!"
@jesusangelm
jesusangelm / wordpress_importer.rb
Created March 22, 2012 02:39 — forked from stammy/wordpress_importer.rb
Importa los post de un blog WordPress a .MarkDown para Jekyll
# based on the import script by icebreaker, which is based on mojombo's
# https://github.com/mojombo/jekyll/blob/master/lib/jekyll/migrators/wordpress.rb
# https://gist.github.com/303570
# edited to rewrite image URLs to use my CloudFront URL
require 'rubygems'
require 'sequel'
require 'fileutils'
require 'yaml'
@jesusangelm
jesusangelm / lector.rb
Created May 24, 2012 17:41
simple script de prueba que lee el archivo de texto que se le pase como argumento.
#!/usr/bin/env ruby
def leer archivo
File.foreach(archivo).with_index do |linea, indice |
puts "#{indice}: #{linea}"
end
end
if ARGV.size > 1
puts "Este script solo admite un argumento!"
@jesusangelm
jesusangelm / .gitignore
Created May 29, 2012 19:06
mi .gitignore snippet
# Ignore bundler config
/.bundle
# Ignore the default SQLite database.
/db/*.sqlite3
# Ignore all logfiles and tempfiles.
/log/*.log
/tmp