This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example code and benchmark harness for http://blog.gregspurrier.com/articles/arbitrary-reordering-of-ruby-arrays | |
require 'rubygems' | |
require 'rspec' | |
module Enumerable | |
def reorder_by1(order, &key_proc) | |
order.map do |x| | |
find {|obj| key_proc.call(obj) == x} | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SET @old = 'http://old'; # Vecchio dominio - da cui si trasferisce l'installazione | |
SET @new = 'http://new'; # Nuovo dominio - verso cui si trasferisce l'installazione | |
UPDATE wp_options SET option_value = replace(option_value, @old, @new) WHERE option_name = 'home' OR option_name = 'siteurl'; | |
UPDATE wp_posts SET guid = replace(guid, @old, @new); | |
UPDATE wp_posts SET post_content = replace(post_content, @old, @new); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ssh -v -p 22 -nNT4 -R *:<public-port>:localhost:<local-port> <public-host-username>@<public-host> | |
ssh -v -nNT4 -R *:3000:localhost:3000 user@www.host.com |
NewerOlder