Skip to content

Instantly share code, notes, and snippets.

@eveevans
eveevans / inflections.rb
Created January 29, 2014 15:30
Rails configuration for spanish Inflection
# Be sure to restart your server when you modify this file.
# Add new inflection rules using the following format
# (all these examples are active by default):
ActiveSupport::Inflector.inflections do |inflect|
inflect.plural /([taeiou])$/, '\1s'
inflect.plural /([rlmnd])$/, '\1es'
inflect.singular /([taeiou])s$/, '\1'
inflect.singular /([aeiou][rlmnd])es$/, '\1'
@eveevans
eveevans / gist:00e866f149cba24b70ea
Created June 24, 2014 20:37
Wordpress queries for Migrate sites
#CHANGE SITEURL & HOMEURL
UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldsiteurl.com', 'http://www.newsiteurl.com') WHERE option_name = 'home' OR option_name = 'siteurl';
#CHANGE GUID
UPDATE wp_posts SET guid = REPLACE (guid, 'http://www.oldsiteurl.com', 'http://www.newsiteurl.com');
# CHANGE URL IN CONTENT
UPDATE wp_posts SET post_content = REPLACE (post_content, 'http://www.oldsiteurl.com', 'http://www.newsiteurl.com');
@eveevans
eveevans / gist:d74ff3ad23e6c538b99a
Created July 3, 2014 17:58
Edit HTML content on the Fly
javascript:document.body.contentEditable='true'; document.designMode='on'; void 0
@eveevans
eveevans / gist:bbe32d1cebce34366eba
Created September 9, 2014 19:43
Change MTU Ubuntu
sudo ifconfig wlan0 mtu 1398
⨀_⨀
⨂_⨂
(/◔ ◡ ◔)/
°ﺑ°
(¬_¬)
(´・ω・`)
(ʘ_ʘ)
(ʘ‿ʘ)
(๏̯͡๏ )
(◕_◕)
@eveevans
eveevans / ruby-http-header
Created September 21, 2011 16:32
http headers
require 'rubygems'
require 'net/http'
url = URI.parse('http://laurel.datsi.fi.upm.es/index.php')
req = Net::HTTP::Get.new(url.path)
req.add_field 'Range', 'bytes=714-732'
res = Net::HTTP.start(url.host, url.port) {|http|
@eveevans
eveevans / indicador cargando
Created October 17, 2011 18:54
// plugin para indicador de cargando
// plugin para indicador de cargando
$.fn.showLoading = function(top, left) {
top = top || 0;
left = left || 0;
this.each(function() {
// crear indicador
var $this = $(this);
var offset = $this.offset();
offset.top += top;
offset.left += $this.width() + left;
@eveevans
eveevans / ruby-thumb.rb
Created November 16, 2011 23:26
Generacion de Miniaturas usando Ruby e Image Magick
# Ruby, Generacion de minuaturas usando Image Magick
i = 0
full = "1200x900"
thumb = "320x240"
images = Dir.entries(".")
images.each do |file|
if file.match(/\.jpg$/i)
@eveevans
eveevans / application.html.erb
Created February 16, 2012 18:31
Rails Breadcrumb
<%= make_breadcrumb(yield :breadcrumb) %>
@eveevans
eveevans / jquery.split_in_span.js
Created March 13, 2012 21:03
jquery extension for split element words into span
/*! split_in_span v1 | flasheves.com */
jQuery.fn.extend({
split_in_span: function(){
var arr = jQuery(this).text().split(' ');
var tamo = arr.length;
for(i=0;i<tamo;i++){ arr[i] = '<span>' + arr[i] + '</span>'; }
jQuery(this).html(arr.join(' '));
}
});