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 | |
directory="/home/YOUR_USER_NAME/projects/YOUR_PROJECT_DIR/trunk" | |
command="script/server" | |
title_dev="Dev_Trunk" | |
title_running="Running_Trunk" | |
profile2="P2" | |
firefox_profile="p2" | |
clear | |
echo "" |
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
ln -s /home/YOUR_USER_NAME/scripts/launch_YOUR_PROJECT.sh launch_YOUR_PROJECT |
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
EXEC dbo.sp_help_job @execution_status = 0; |
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
class ApplicationController < ActionController::Base | |
helper :all # include all helpers, all the time | |
# ... | |
rescue_from Exception, :with => :handler_exception | |
# ... | |
def handler_exception(exception) | |
if request.xhr? then | |
message = "Error: #{exception.class.to_s}" | |
message += " in #{request.parameters['controller'].camelize}Controller" if request.parameters['controller'] |
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
function defaultAjaxErrorHandler(result, isAjaxError) { | |
// do stuff, hide spinner etc... | |
var defaultAjaxError = "Your friendly error message"; | |
var errorToken = "Error:"; | |
if(!isUndefinedOrNull(result) && !isUndefinedOrNull(result.responseText)) { | |
if(result.responseText.startsWith(errorToken)) { | |
// localhost | |
var x = (result.responseText.length > 350) ? 350 : result.responseText.length; | |
alert(result.responseText.substring(0, x) + "...\n\n - Check firebug console for more info.\n - This message for localhost only."); |
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
$j.ajax({ | |
type: "POST", | |
url: "/some_controller/some_action", | |
data: { | |
first_name: $j("#first_name").val(), | |
last_name: $j("#last_name").val(), | |
}, | |
success: function(data, textStatus) { | |
// do what you like | |
}, |
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
<a href="http://www.google.com/" target="_blank">Google</a> |
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
<a href="http://www.google.com/" class="target-blank">Google</a> | |
<script type="text/javascript"> | |
$j(document).ready(function() { | |
$j('a.target-blank').click(function() { | |
this.target = '_blank'; | |
}); | |
} | |
</script> |
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
require 'net/http' | |
require 'uri' | |
def get_html_content(requested_url) | |
url = URI.parse(requested_url) | |
full_path = (url.query.blank?) ? url.path : "#{url.path}?#{url.query}" | |
the_request = Net::HTTP::Get.new(full_path) | |
the_response = Net::HTTP.start(url.host, url.port) { |http| | |
http.request(the_request) |
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
# see http://gist.github.com/341290 (sort_index_controller_usage.rb) | |
# see http://gist.github.com/341295 (sort_index_view_usage.html.erb) | |
# The classes in this module help to enable sorting on index pages | |
# building sql order clauses and rendering html table header links | |
module SortIndex | |
SORT_KEY_ASC = 'asc' | |
SORT_KEY_DESC = 'desc' | |
SORT_DIRECTION_MAP = { |