Skip to content

Instantly share code, notes, and snippets.

View aviflombaum's full-sized avatar

Avi Flombaum aviflombaum

View GitHub Profile
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) {
SlideTweet = function(){
// setTimeout(function(){
// }, 2000)
$("li:last").slideUp({
duration: 320,
complete: function(){$(this).remove()}
})
};
class ActionController::CgiRequest
def search_bot?
self.user_agent =~ /(Baidu|bot|Google|SiteUptime|Slurp|WordPress|ZIBB|ZyBorg|Jeeves|ms)/i
end
end
*/5 * * * * /usr/local/bin/lockrun --lockfile=/tmp/detweeter.lockrun -- cd /home/deploy/www/dp_neocon/current/ && /usr/local/bin/rake RAILS_ENV=production detweeter
*/5 * * * * cd /home/deploy/www/dp_neocon/current/ && /usr/local/bin/lockrun --lockfile=/tmp/detweeter.lockrun -- /usr/local/bin/rake RAILS_ENV=production detweeter
development: &global_settings
database: textual_development
host: 127.0.0.1
port: 27017
test:
database: textual_test
<<: *global_settings
production:
# 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.
//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', {
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='> '