Skip to content

Instantly share code, notes, and snippets.

View fenomenog4's full-sized avatar

Pedro Jiménez Díaz fenomenog4

  • Granada
View GitHub Profile
@fenomenog4
fenomenog4 / git-branches-by-commit-date.sh
Created February 14, 2017 07:44 — forked from jasonrudolph/git-branches-by-commit-date.sh
List remote Git branches and the last commit date for each branch. Sort by most recent commit date.
# Credit http://stackoverflow.com/a/2514279
for branch in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch; done | sort -r
@fenomenog4
fenomenog4 / client.rb
Created September 24, 2012 13:47
Cliente de formulario de login simple con mechanize
require 'rubygems'
require 'mechanize'
a = Mechanize.new
a.agent.http.verify_mode = OpenSSL::SSL::VERIFY_NONE
a.get('http://sau/module.php/core/authenticate.php?as=sau') do |login_page|
# Submit the login form
my_page = login_page.form_with(:name => 'f') do |f|
f.username = '******@grammata.es'
@fenomenog4
fenomenog4 / style2tag_scrubber.rb
Created December 2, 2011 12:37
Conversión de algunos tags problemáticos para el Editor Grammata en ficheros epubs con Loofah
require "loofah"
style2tag = Loofah::Scrubber.new do |node|
if node.attributes and node.attr('style')
if node.attr('style')['font-style:italic'] and
node.attr('style')['font-weight:bold']
new_node = node.dup
new_node.name = 'i'
new_node.remove_attribute('style')
@fenomenog4
fenomenog4 / gunicorn
Created November 29, 2011 11:50 — forked from suda/gunicorn
Gunicorn init.d script (debian/ubuntu)
#!/bin/sh
### BEGIN INIT INFO
# Provides: gunicorn
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the gunicorn server
# Description: starts gunicorn using start-stop-daemon