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 enable_edit_mode(){ | |
$('.is_editable').each(function(){ | |
$(this).bind('click.edit_mode', function(e){ | |
edit_element(this); | |
return false; | |
}); | |
}); | |
}; | |
function edit_element(edititable_element) { |
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
Embed |
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
SlideTweet = function(){ | |
// setTimeout(function(){ | |
// }, 2000) | |
$("li:last").slideUp({ | |
duration: 320, | |
complete: function(){$(this).remove()} | |
}) | |
}; | |
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 ActionController::CgiRequest | |
def search_bot? | |
self.user_agent =~ /(Baidu|bot|Google|SiteUptime|Slurp|WordPress|ZIBB|ZyBorg|Jeeves|ms)/i | |
end | |
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
*/5 * * * * /usr/local/bin/lockrun --lockfile=/tmp/detweeter.lockrun -- cd /home/deploy/www/dp_neocon/current/ && /usr/local/bin/rake RAILS_ENV=production detweeter |
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
*/5 * * * * cd /home/deploy/www/dp_neocon/current/ && /usr/local/bin/lockrun --lockfile=/tmp/detweeter.lockrun -- /usr/local/bin/rake RAILS_ENV=production detweeter |
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
development: &global_settings | |
database: textual_development | |
host: 127.0.0.1 | |
port: 27017 | |
test: | |
database: textual_test | |
<<: *global_settings | |
production: |
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
# include this in application controller | |
module Authentication | |
protected | |
# Inclusion hook to make #current_user and #signed_in? | |
# available as ActionView helper methods. | |
def self.included(base) | |
base.send :helper_method, :current_user, :signed_in?, :authorized? if base.respond_to? :helper_method | |
end | |
# Returns true or false if the user is signed in. |
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
//Newly needed function | |
var war_switch_function = function(e){ | |
window.location = '/wars/embed/neocon/?war_id='+e.target.value.split('/')[2]; | |
// Talk about disproportionate... | |
// //unbind to prevent double firing | |
// $('#war_selector select').unbind('change'); | |
// $(document).unbind('/cast_vote'); | |
// | |
// | |
// $(document).trigger('/load_war', { |
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 parse_git_branch { | |
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
function superprompt { | |
local RED="\[\033[0;31m\]" | |
local LIGHT_RED="\[\033[1;31m\]" | |
export PS1="\[\e]2;\u@\h\a[\[\e[37;44;1m\]\t\[\e[0m\]]$RED\$(parse_git_branch) \[\e[32m\]\W\[\e[0m\] \$ " | |
PS2='> ' |