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
# Connect to terminal server with license problems("without" delays) | |
rdesktop <ip> -n <random_name> -a 15 -z -P |
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
# MySQL gui tools hangs when select an schema | |
export DEBUG_DONT_SPAWN_FETCHES=1 | |
/usr/bin/mysql-admin |
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
#!/bin/bash | |
# Restore table(table+data or only data) from mysqldump file | |
# | |
# NOTE: 'foo' is the table to restore and 'bar' next table in backup. | |
# Restore one table | |
zcat backup_20090316-0200.sql.gz | awk '/Table structure for table .foo./,/Table structure for table .bar./{print}' > output.sql | |
# Restore only data from one table | |
zcat backup_20090316-0200.sql.gz | awk '/Dumping data for table .foo./,/Table structure for table .bar./{print}' > output.sql |
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
; Enable username:[email protected] in Internet Explorer and Windows Explorer. | |
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_HTTP_USERNAME_PASSWORD_DISABLE] | |
"iexplore.exe"=dword:00000000 | |
"explorer.exe"=dword:00000000 |
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
# Add this to every host running WP (either in Apache conf files - a recommended method - or in .htaccess): | |
<Files ~ "wp-cron\.php$"> | |
<IfModule mod_security.c> | |
SecFilterEngine Off | |
</IfModule> | |
Order Deny,Allow | |
Deny from All | |
Allow from my.own.IP.address | |
</Files> |
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
ExpiresActive on | |
ExpiresByType text/css "access plus 1 month" | |
ExpiresByType text/javascript "access plus 1 month" | |
ExpiresByType application/x-javascript "access plus 1 month" | |
ExpiresByType application/javascript "access plus 1 month" | |
ExpiresByType image/gif "access plus 1 month" | |
ExpiresByType image/jpg "access plus 1 month" | |
ExpiresByType image/jpeg "access plus 1 month" | |
ExpiresByType image/png "access plus 1 month" | |
ExpiresByType application/x-shockwave-flash "access plus 1 month" |
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
test "should create photo" do | |
assert_difference('Photo.count') do | |
post :create, :album_id => albums(:gallery_one_one).to_param, :photo => {:name => 'photo_fooooo', :description => 'bar', :image => fixture_file_upload('rails.png')} | |
end | |
assert_redirected_to admin_album_photos_path(assigns(:album)) | |
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
Problem: `load_missing_constant’: uninitialized constant ActionController::AbstractRequest (NameError) | |
Solution: | |
-ActionController::AbstractRequest.relative_url_root = "your_root" | |
+config.action_controller.relative_url_root = "your_root" | |
# More gotchas: http://giantrobots.thoughtbot.com/2009/4/15/rails-2-3-2-upgrade-gotchas |
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
FORK - PUSH - PULL - KEEPING THE TRACK | |
====================================== | |
FORK | |
==== | |
Le doy a fork en el repositorio y luego uso "Your clone URL". | |
$ git clone [email protected]:rgo/drgtest.git | |
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
# You need to call the next and previous records. Just put the following in your model. | |
# From http://snippets.dzone.com/posts/show/7163 | |
def next | |
self.class.find :first, | |
:conditions => ["created_at > ? ",self.created_at], | |
:order => "created_at DESC" | |
end | |
def previous | |
self.class.find :first, |