Skip to content

Instantly share code, notes, and snippets.

View MischaTheEvil's full-sized avatar

Mischa The Evil MischaTheEvil

View GitHub Profile
@MischaTheEvil
MischaTheEvil / gist:103483
Created April 28, 2009 23:50
Global Menu Renderer helper
# Renders the global menu as an unordered list
# Returns a string containing the HTML for the global menu
def render_global_menu
s = ''
s << "<ul>\n"
# Global issues link
s << "<li>" +
# Add 'alt-selected'-class to the 'a'-element if on global level (!= :controller == issues && != :action == index && != :project_id == nil)
if params[:controller] == 'issues' && params[:action] == 'index' && params[:project_id] == nil
link_to l(:label_issue_view_all), { :controller => 'issues', :id => nil }, :class => 'alt-selected'
Rails::Plugin.class_eval do
def reloadable!
load_paths.each { |p| Dependencies.load_once_paths.delete(p) }
end
end
reloadable!
REDMINE VERSION SHARING TESTS
Redmine trunk@3129
Role: Manager (which has version-management permission) on ALL projects
* Version TST, not shared, in project: "parent2" "child2-1" "nested2-1-1"
Davide Zipeto wrote:
> Is is possible jsut to write the < pre> tag on a line by disabling temporarly the textile markup engine ? I cannot find any tricks with that...
A neat trick (AFAIK not officially supported by Redmine (nor RedCloth)) can be the use of Redmine's inline code markup.
With a nifty syntax the following results can be achieved: <@pre@>, [@[links]@], <@/code@>, <@/pre@>, <@code@>, @h1.@ and @_italic_@.
I've posted the source of this reply to a gist to easily show the syntax I've used for the examples: <PasteGistURL>.
&nbsp;
@MischaTheEvil
MischaTheEvil / gist:265068
Created December 29, 2009 01:02
0.9-decision_blockers
FEEDBACK?:
http://www.redmine.org/issues/1157#note-15
http://www.redmine.org/issues/4277#note-5
http://www.redmine.org/issues/2755
http://www.redmine.org/issues/3359
CAN BE CLOSED?:
===
To GitHub
===
[mischa@server redmine_collapse]# git remote add origin git@github.com:MischaTheEvil/redmine_collapse.git
[mischa@server redmine_collapse]# git push origin --all
Counting objects: 520, done.
Compressing objects: 100% (452/452), done.
Writing objects: 100% (520/520), 74.55 KiB, done.
Total 520 (delta 315), reused 0 (delta 0)
To git@github.com:MischaTheEvil/redmine_collapse.git
@MischaTheEvil
MischaTheEvil / BitNami Tracks Stack Upgrade to Tracks 1.7.1.diff
Created September 9, 2010 02:54
Patch to update Tracks to 1.7.1 in current BitNami Stack
Index: app/controllers/data_controller.rb
===================================================================
--- app/controllers/data_controller.rb (revision 0)
+++ app/controllers/data_controller.rb (working copy)
@@ -18,25 +18,27 @@
def yaml_export
all_tables = {}
- all_tables['todos'] = current_user.todos.find(:all)
+ all_tables['todos'] = current_user.todos.find(:all, :include => [:tags])
@MischaTheEvil
MischaTheEvil / development_profiler.rb
Last active December 31, 2015 03:59 — forked from hiltmon/development_profiler.rb
A helper class to support easy ruby-prof profiling in Rails applications.
# encoding: utf-8
#
# Copyright (c) 2012 Hilton Lipschitz
# Copyright (c) 2013 Mischa The Evil
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to